: - Time-derivative of
[r; p; y]
, i.e.,[ṙ; ṗ; ẏ]
.
Returns: w_AD_D, frame D’s angular velocity in frame A, expressed in D. - Parameter
-
CalcAngularVelocityInParentFromRpyDt
(self: pydrake.math.RollPitchYaw_[float], rpyDt: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 1]]¶ Calculates angular velocity from
this
RollPitchYaw whose roll-pitch-yaw angles[r; p; y]
relate the orientation of two generic frames A and D.- Parameter
rpyDt
: - Time-derivative of
[r; p; y]
, i.e.,[ṙ; ṗ; ẏ]
.
Returns: w_AD_A, frame D’s angular velocity in frame A, expressed in A. - Parameter
-
CalcRotationMatrixDt
(self: pydrake.math.RollPitchYaw_[float], rpyDt: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]¶ Forms Ṙ, the ordinary derivative of the RotationMatrix
R
with respect to an independent variablet
(t usually denotes time) andR
is the RotationMatrix formed bythis
RollPitchYaw. The roll-pitch-yaw angles r, p, y are regarded as functions oft
[i.e., r(t), p(t), y(t)].- Parameter
rpyDt
: - Ordinary derivative of rpy with respect to an independent variable
t
(t usually denotes time, but not necessarily).
Returns: Ṙ, the ordinary derivative of R
with respect tot
, calculated as Ṙ = ∂R/∂r * ṙ + ∂R/∂p * ṗ + ∂R/∂y * ẏ. In other words, the returned (i, j) element is ∂Rij/∂r * ṙ + ∂Rij/∂p * ṗ + ∂Rij/∂y * ẏ.- Parameter
-
CalcRpyDDtFromAngularAccelInChild
(self: pydrake.math.RollPitchYaw_[float], rpyDt: numpy.ndarray[numpy.float64[3, 1]], alpha_AD_D: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 1]]¶ Uses angular acceleration to compute the 2ⁿᵈ time-derivative of
this
RollPitchYaw whose angles[r; p; y]
orient two generic frames A and D.- Parameter
rpyDt
: - time-derivative of
[r; p; y]
, i.e.,[ṙ; ṗ; ẏ]
. - Parameter
alpha_AD_D
: - , frame D’s angular acceleration in frame A, expressed in frame D.
Returns: [r̈, p̈, ÿ]
, the 2ⁿᵈ time-derivative ofthis
RollPitchYaw.Raises: RuntimeError if cos(p) ≈ 0
(p is near gimbal-lock).Note
This method has a divide-by-zero error (singularity) when the cosine of the pitch angle
p
is zero [i.e.,cos(p) = 0`]. This problem (called "gimbal lock") occurs when `p = n π + π / 2
, where n is any integer. There are associated precision problems (inaccuracies) in the neighborhood of these pitch angles, i.e., whencos(p) ≈ 0
.- Parameter
-
CalcRpyDDtFromRpyDtAndAngularAccelInParent
(self: pydrake.math.RollPitchYaw_[float], rpyDt: numpy.ndarray[numpy.float64[3, 1]], alpha_AD_A: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 1]]¶ Uses angular acceleration to compute the 2ⁿᵈ time-derivative of
this
RollPitchYaw whose angles[r; p; y]
orient two generic frames A and D.- Parameter
rpyDt
: - time-derivative of
[r; p; y]
, i.e.,[ṙ; ṗ; ẏ]
. - Parameter
alpha_AD_A
: - , frame D’s angular acceleration in frame A, expressed in frame A.
Returns: [r̈, p̈, ÿ]
, the 2ⁿᵈ time-derivative ofthis
RollPitchYaw.Raises: RuntimeError if cos(p) ≈ 0
(p is near gimbal-lock).Note
This method has a divide-by-zero error (singularity) when the cosine of the pitch angle
p
is zero [i.e.,cos(p) = 0`]. This problem (called "gimbal lock") occurs when `p = n π + π / 2
, where n is any integer. There are associated precision problems (inaccuracies) in the neighborhood of these pitch angles, i.e., whencos(p) ≈ 0
.- Parameter
-
CalcRpyDtFromAngularVelocityInParent
(self: pydrake.math.RollPitchYaw_[float], w_AD_A: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 1]]¶ Uses angular velocity to compute the 1ˢᵗ time-derivative of
this
RollPitchYaw whose angles[r; p; y]
orient two generic frames A and D.- Parameter
w_AD_A
: - , frame D’s angular velocity in frame A, expressed in A.
Returns: [ṙ; ṗ; ẏ]
, the 1ˢᵗ time-derivative ofthis
RollPitchYaw.Raises: RuntimeError if cos(p) ≈ 0
(p is near gimbal-lock).Note
This method has a divide-by-zero error (singularity) when the cosine of the pitch angle
p
is zero [i.e.,cos(p) = 0`]. This problem (called "gimbal lock") occurs when `p = n π + π / 2
, where n is any integer. There are associated precision problems (inaccuracies) in the neighborhood of these pitch angles, i.e., whencos(p) ≈ 0
.- Parameter
-
pitch_angle
(self: pydrake.math.RollPitchYaw_[float]) → float¶ Returns the pitch-angle underlying
this
RollPitchYaw.
-
roll_angle
(self: pydrake.math.RollPitchYaw_[float]) → float¶ Returns the roll-angle underlying
this
RollPitchYaw.
-
ToQuaternion
(self: pydrake.math.RollPitchYaw_[float]) → Eigen::Quaternion<double, 0>¶ Returns a quaternion representation of
this
RollPitchYaw.
-
ToRotationMatrix
(self: pydrake.math.RollPitchYaw_[float]) → pydrake.math.RotationMatrix_[float]¶ Returns the RotationMatrix representation of
this
RollPitchYaw.
-
vector
(self: pydrake.math.RollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ Returns the Vector3 underlying
this
RollPitchYaw.
-
yaw_angle
(self: pydrake.math.RollPitchYaw_[float]) → float¶ Returns the yaw-angle underlying
this
RollPitchYaw.
-
pydrake.math.
RotationMatrix
¶ alias of
pydrake.math.RotationMatrix_[float]
-
template
pydrake.math.
RotationMatrix_
¶ Instantiations:
RotationMatrix_[float]
,RotationMatrix_[AutoDiffXd]
,RotationMatrix_[Expression]
-
class
RotationMatrix_[float]
¶ This class represents a 3x3 rotation matrix between two arbitrary frames A and B and helps ensure users create valid rotation matrices. This class relates right-handed orthogonal unit vectors Ax, Ay, Az fixed in frame A to right-handed orthogonal unit vectors Bx, By, Bz fixed in frame B. The monogram notation for the rotation matrix relating A to B is
R_AB
. An example that gives context to this rotation matrix isv_A = R_AB * v_B
, wherev_B
denotes an arbitrary vector v expressed in terms of Bx, By, Bz andv_A
denotes vector v expressed in terms of Ax, Ay, Az. See multibody_quantities for monogram notation for dynamics. See orientation_discussion “a discussion on rotation matrices”.Note
This class does not store the frames associated with a rotation matrix nor does it enforce strict proper usage of this class with vectors.
Note
When assertions are enabled, several methods in this class do a validity check and throw an exception (RuntimeError) if the rotation matrix is invalid. When assertions are disabled, many of these validity checks are skipped (which helps improve speed). In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.- Authors:
- Paul Mitiguy (2018) Original author.
- Authors:
- Drake team (see https://drake.mit.edu/credits).
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.math.RotationMatrix_[float]) -> None
Constructs a 3x3 identity RotationMatrix – which corresponds to aligning two frames (so that unit vectors Ax = Bx, Ay = By, Az = Bz).
- __init__(self: pydrake.math.RotationMatrix_[float], other: pydrake.math.RotationMatrix_[float]) -> None
- __init__(self: pydrake.math.RotationMatrix_[float], R: numpy.ndarray[numpy.float64[3, 3]]) -> None
Constructs a RotationMatrix from a Matrix3.
- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - __init__(self: pydrake.math.RotationMatrix_[float], quaternion: Eigen::Quaternion<double, 0>) -> None
Constructs a RotationMatrix from an Eigen::Quaternion.
- Parameter
quaternion
: - a non-zero, finite quaternion which may or may not have unit
length [i.e.,
quaternion.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
quaternion
fails IsValid(R). For example, an - exception is thrown if
quaternion
is zero or contains a NaN or infinity.
Note
This method has the effect of normalizing its
quaternion
argument, without the inefficiency of the square-root associated with normalization.- __init__(self: pydrake.math.RotationMatrix_[float], theta_lambda: Eigen::AngleAxis<double>) -> None
Constructs a RotationMatrix from an Eigen::AngleAxis.
- Parameter
theta_lambda
: - an Eigen::AngleAxis whose associated axis (vector direction herein
called
lambda
) is non-zero and finite, but which may or may not have unit length [i.e.,lambda.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
theta_lambda
fails IsValid(R). For example, an - exception is thrown if
lambda
is zero or contains a NaN or infinity.
- __init__(self: pydrake.math.RotationMatrix_[float], rpy: drake::math::RollPitchYaw<double>) -> None
Constructs a RotationMatrix from an RollPitchYaw. In other words, makes the RotationMatrix for a Space-fixed (extrinsic) X-Y-Z rotation by “roll-pitch-yaw” angles
[r, p, y]
, which is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by “yaw-pitch-roll” angles[y, p, r]
.- Parameter
rpy
: - radian measures of three angles [roll, pitch, yaw].
- Parameter
rpy
: - a RollPitchYaw which is a Space-fixed (extrinsic) X-Y-Z rotation
with “roll-pitch-yaw” angles
[r, p, y]
or equivalently a Body- fixed (intrinsic) Z-Y-X rotation with “yaw-pitch-roll” angles[y, p, r]
.
Note
Denoting roll
r
, pitchp
, yawy
, this method returns a rotation matrixR_AD
equal to the matrix multiplication shown below.⎡cos(y) -sin(y) 0⎤ ⎡ cos(p) 0 sin(p)⎤ ⎡1 0 0 ⎤ R_AD = ⎢sin(y) cos(y) 0⎥ * ⎢ 0 1 0 ⎥ * ⎢0 cos(r) -sin(r)⎥ ⎣ 0 0 1⎦ ⎣-sin(p) 0 cos(p)⎦ ⎣0 sin(r) cos(r)⎦ = R_AB * R_BC * R_CD
Note
In this discussion, A is the Space frame and D is the Body frame. One way to visualize this rotation sequence is by introducing intermediate frames B and C (useful constructs to understand this rotation sequence). Initially, the frames are aligned so
Di = Ci = Bi = Ai (i = x, y, z)
. Then D is subjected to successive right-handed rotations relative to A.- 1st rotation R_CD: Frame D rotates relative to frames C, B, A by a
roll angle
r
aboutDx = Cx
. Note: D and C are no longer aligned.- 2nd rotation R_BC: Frames D, C (collectively – as if welded together)
rotate relative to frame B, A by a pitch angle
p
aboutCy = By
. Note: C and B are no longer aligned.- 3rd rotation R_AB: Frames D, C, B (collectively – as if welded)
rotate relative to frame A by a roll angle
y
aboutBz = Az
. Note: B and A are no longer aligned.Note
This method constructs a RotationMatrix from a RollPitchYaw. Vice-versa, there are high-accuracy RollPitchYaw constructor/methods that form a RollPitchYaw from a rotation matrix.
-
template
cast
¶ Instantiations:
cast[float]
,cast[AutoDiffXd]
,cast[Expression]
-
cast[float]
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
-
cast[AutoDiffXd]
(self: pydrake.math.RotationMatrix_[float]) → drake::math::RotationMatrix<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
cast[Expression]
(self: pydrake.math.RotationMatrix_[float]) → drake::math::RotationMatrix<drake::symbolic::Expression>¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
cast[float]
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
col
(self: pydrake.math.RotationMatrix_[float], index: int) → numpy.ndarray[numpy.float64[3, 1]]¶ Returns
this
rotation matrix’s iᵗʰ column (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - col(0) returns Bx_A (Bx expressed in terms of Ax, Ay, Az). - col(1) returns By_A (By expressed in terms of Ax, Ay, Az). - col(2) returns Bz_A (Bz expressed in terms of Ax, Ay, Az).- Parameter
index
: - requested column index (0 <= index <= 2).
See also
row(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s col() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Bz_A = col(2);
orVector3<T> Bz_A = col(2);
- Parameter
-
static
Identity
() → pydrake.math.RotationMatrix_[float]¶
-
inverse
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶
-
IsExactlyIdentity
(self: pydrake.math.RotationMatrix_[float]) → bool¶ Returns
True
ifthis
is exactly equal to the identity matrix.
-
IsIdentityToInternalTolerance
(self: pydrake.math.RotationMatrix_[float]) → bool¶ Returns true if
this
is equal to the identity matrix to within the threshold of get_internal_tolerance_for_orthonormality().
-
IsValid
(self: pydrake.math.RotationMatrix_[float]) → bool¶ Tests if
this
rotation matrix R is a proper orthonormal rotation matrix to within the threshold of get_internal_tolerance_for_orthonormality().Returns: True
ifthis
is a valid rotation matrix.
-
static
MakeXRotation
(theta: float) → pydrake.math.RotationMatrix_[float]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAx = Bx
.- Parameter
theta
: - radian measure of rotation angle about Ax.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitX().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAx = Bx
.⎡ 1 0 0 ⎤ R_AB = ⎢ 0 cos(theta) -sin(theta) ⎥ ⎣ 0 sin(theta) cos(theta) ⎦
- Parameter
-
static
MakeYRotation
(theta: float) → pydrake.math.RotationMatrix_[float]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAy = By
.- Parameter
theta
: - radian measure of rotation angle about Ay.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitY().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAy = By
.⎡ cos(theta) 0 sin(theta) ⎤ R_AB = ⎢ 0 1 0 ⎥ ⎣ -sin(theta) 0 cos(theta) ⎦
- Parameter
-
static
MakeZRotation
(theta: float) → pydrake.math.RotationMatrix_[float]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAz = Bz
.- Parameter
theta
: - radian measure of rotation angle about Az.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitZ().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAz = Bz
.⎡ cos(theta) -sin(theta) 0 ⎤ R_AB = ⎢ sin(theta) cos(theta) 0 ⎥ ⎣ 0 0 1 ⎦
- Parameter
-
matrix
(self: pydrake.math.RotationMatrix_[float]) → numpy.ndarray[numpy.float64[3, 3]]¶ Returns the Matrix3 underlying a RotationMatrix.
See also
col(), row()
-
multiply
(*args, **kwargs)¶ Overloaded function.
- multiply(self: pydrake.math.RotationMatrix_[float], other: pydrake.math.RotationMatrix_[float]) -> pydrake.math.RotationMatrix_[float]
Calculates
this
rotation matrixR_AB
multiplied byother
rotation matrixR_BC
, returning the compositionR_AB * R_BC
.- Parameter
other
: - RotationMatrix that post-multiplies
this
.
Returns: rotation matrix that results from this
multiplied byother
.Note
It is possible (albeit improbable) to create an invalid rotation matrix by accumulating round-off error with a large number of multiplies.
- multiply(self: pydrake.math.RotationMatrix_[float], v_B: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 1]]
Calculates
this
rotation matrixR_AB
multiplied by an arbitrary Vector3 expressed in the B frame.- Parameter
v_B
: - 3x1 vector that post-multiplies
this
.
Returns: 3x1 vector v_A = R_AB * v_B
.- multiply(self: pydrake.math.RotationMatrix_[float], v_B: numpy.ndarray[numpy.float64[3, n]]) -> numpy.ndarray[numpy.float64[3, n]]
Multiplies
this
RotationMatrixR_AB
by the n vectorsv1
, … vn, where each vector has 3 elements and is expressed in frame B.- Parameter
v_B
: 3 x n
matrix whose n columns are regarded as arbitrary vectorsv1
, … vn expressed in frame B.- Returns
v_A
: 3 x n
matrix whose n columns are vectorsv1
, … vn expressed in frame A.
const RollPitchYaw<double> rpy(0.1, 0.2, 0.3); const RotationMatrix<double> R_AB(rpy); Eigen::Matrix<double, 3, 2> v_B; v_B.col(0) = Vector3d(4, 5, 6); v_B.col(1) = Vector3d(9, 8, 7); const Eigen::Matrix<double, 3, 2> v_A = R_AB * v_B;
-
static
ProjectToRotationMatrix
(M: numpy.ndarray[numpy.float64[3, 3]]) → pydrake.math.RotationMatrix_[float]¶ Given an approximate rotation matrix M, finds the RotationMatrix R closest to M. Closeness is measured with a matrix-2 norm (or equivalently with a Frobenius norm). Hence, this method creates a RotationMatrix R from a 3x3 matrix M by minimizing
‖R - M‖₂
(the matrix-2 norm of (R-M)) subject toR * Rᵀ = I
, where I is the 3x3 identity matrix. For this problem, closeness can also be measured by forming the orthonormal matrix R whose elements minimize the double-summation∑ᵢ ∑ⱼ (R(i,j) - M(i,j))²
wherei = 1:3, j = 1:3
, subject toR * Rᵀ = I
. The square-root of this double-summation is called the Frobenius norm.- Parameter
M
: - a 3x3 matrix.
- Parameter
quality_factor
: - . The quality of M as a rotation matrix.
quality_factor
= 1 is perfect (M = R).quality_factor
= 1.25 means that when M multiplies a unit vector (magnitude 1), a vector of magnitude as large as 1.25 may result.quality_factor
= 0.8 means that when M multiplies a unit vector, a vector of magnitude as small as 0.8 may result.quality_factor
= 0 means M is singular, so at least one of the bases related by matrix M does not span 3D space (when M multiples a unit vector, a vector of magnitude as small as 0 may result).
Returns: proper orthonormal matrix R that is closest to M. Raises: RuntimeError if R fails IsValid(R). Note
William Kahan (UC Berkeley) and Hongkai Dai (Toyota Research Institute) proved that for this problem, the same R that minimizes the Frobenius norm also minimizes the matrix-2 norm (a.k.a an induced-2 norm), which is defined [Dahleh, Section 4.2] as the column matrix u which maximizes
‖(R - M) u‖ / ‖u‖
, whereu ≠ 0
. Since the matrix-2 norm of any matrix A is equal to the maximum singular value of A, minimizing the matrix-2 norm of (R - M) is equivalent to minimizing the maximum singular value of (R - M).- [Dahleh] “Lectures on Dynamic Systems and Controls: Electrical
Engineering and Computer Science, Massachusetts Institute of Technology” https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-241j-dynamic-systems-and-control-spring-2011/readings/MIT6_241JS11_chap04.pdf
- Parameter
-
row
(self: pydrake.math.RotationMatrix_[float], index: int) → numpy.ndarray[numpy.float64[1, 3]]¶ Returns
this
rotation matrix’s iᵗʰ row (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - row(0) returns Ax_B (Ax expressed in terms of Bx, By, Bz). - row(1) returns Ay_B (Ay expressed in terms of Bx, By, Bz). - row(2) returns Az_B (Az expressed in terms of Bx, By, Bz).- Parameter
index
: - requested row index (0 <= index <= 2).
See also
col(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s row() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Az_B = row(2);
orRowVector3<T> Az_B = row(2);
- Parameter
-
set
(self: pydrake.math.RotationMatrix_[float], R: numpy.ndarray[numpy.float64[3, 3]]) → None¶ Sets
this
RotationMatrix from a Matrix3.- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - Parameter
-
ToAngleAxis
(self: pydrake.math.RotationMatrix_[float]) → Eigen::AngleAxis<double>¶ Returns an AngleAxis
theta_lambda
containing an angletheta
and unit vector (axis direction)lambda
that representsthis
RotationMatrix.Note
The orientation and RotationMatrix associated with
theta * lambda
is identical to that of(-theta) * (-lambda)
. The AngleAxis returned by this method chooses to have0 <= theta <= pi
.Returns: an AngleAxis with 0 <= theta <= pi
and a unit vectorlambda
.
-
ToQuaternion
(self: pydrake.math.RotationMatrix_[float]) → Eigen::Quaternion<double, 0>¶ Returns a quaternion q that represents
this
RotationMatrix. Since the quaternionq
and-q
represent the same RotationMatrix, this method chooses to return a canonical quaternion, i.e., with q(0) >= 0.Note
There is a constructor in the RollPitchYaw class that converts a rotation matrix to roll-pitch-yaw angles.
-
transpose
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶
-
class
-
class
pydrake.math.
RotationMatrix_[AutoDiffXd]
¶ This class represents a 3x3 rotation matrix between two arbitrary frames A and B and helps ensure users create valid rotation matrices. This class relates right-handed orthogonal unit vectors Ax, Ay, Az fixed in frame A to right-handed orthogonal unit vectors Bx, By, Bz fixed in frame B. The monogram notation for the rotation matrix relating A to B is
R_AB
. An example that gives context to this rotation matrix isv_A = R_AB * v_B
, wherev_B
denotes an arbitrary vector v expressed in terms of Bx, By, Bz andv_A
denotes vector v expressed in terms of Ax, Ay, Az. See multibody_quantities for monogram notation for dynamics. See orientation_discussion “a discussion on rotation matrices”.Note
This class does not store the frames associated with a rotation matrix nor does it enforce strict proper usage of this class with vectors.
Note
When assertions are enabled, several methods in this class do a validity check and throw an exception (RuntimeError) if the rotation matrix is invalid. When assertions are disabled, many of these validity checks are skipped (which helps improve speed). In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.- Authors:
- Paul Mitiguy (2018) Original author.
- Authors:
- Drake team (see https://drake.mit.edu/credits).
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.math.RotationMatrix_[AutoDiffXd]) -> None
Constructs a 3x3 identity RotationMatrix – which corresponds to aligning two frames (so that unit vectors Ax = Bx, Ay = By, Az = Bz).
- __init__(self: pydrake.math.RotationMatrix_[AutoDiffXd], other: pydrake.math.RotationMatrix_[AutoDiffXd]) -> None
- __init__(self: pydrake.math.RotationMatrix_[AutoDiffXd], R: numpy.ndarray[object[3, 3]]) -> None
Constructs a RotationMatrix from a Matrix3.
- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - __init__(self: pydrake.math.RotationMatrix_[AutoDiffXd], quaternion: pydrake.common.eigen_geometry.Quaternion_[AutoDiffXd]) -> None
Constructs a RotationMatrix from an Eigen::Quaternion.
- Parameter
quaternion
: - a non-zero, finite quaternion which may or may not have unit
length [i.e.,
quaternion.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
quaternion
fails IsValid(R). For example, an - exception is thrown if
quaternion
is zero or contains a NaN or infinity.
Note
This method has the effect of normalizing its
quaternion
argument, without the inefficiency of the square-root associated with normalization.- __init__(self: pydrake.math.RotationMatrix_[AutoDiffXd], theta_lambda: pydrake.common.eigen_geometry.AngleAxis_[AutoDiffXd]) -> None
Constructs a RotationMatrix from an Eigen::AngleAxis.
- Parameter
theta_lambda
: - an Eigen::AngleAxis whose associated axis (vector direction herein
called
lambda
) is non-zero and finite, but which may or may not have unit length [i.e.,lambda.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
theta_lambda
fails IsValid(R). For example, an - exception is thrown if
lambda
is zero or contains a NaN or infinity.
- __init__(self: pydrake.math.RotationMatrix_[AutoDiffXd], rpy: drake::math::RollPitchYaw<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >) -> None
Constructs a RotationMatrix from an RollPitchYaw. In other words, makes the RotationMatrix for a Space-fixed (extrinsic) X-Y-Z rotation by “roll-pitch-yaw” angles
[r, p, y]
, which is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by “yaw-pitch-roll” angles[y, p, r]
.- Parameter
rpy
: - radian measures of three angles [roll, pitch, yaw].
- Parameter
rpy
: - a RollPitchYaw which is a Space-fixed (extrinsic) X-Y-Z rotation
with “roll-pitch-yaw” angles
[r, p, y]
or equivalently a Body- fixed (intrinsic) Z-Y-X rotation with “yaw-pitch-roll” angles[y, p, r]
.
Note
Denoting roll
r
, pitchp
, yawy
, this method returns a rotation matrixR_AD
equal to the matrix multiplication shown below.⎡cos(y) -sin(y) 0⎤ ⎡ cos(p) 0 sin(p)⎤ ⎡1 0 0 ⎤ R_AD = ⎢sin(y) cos(y) 0⎥ * ⎢ 0 1 0 ⎥ * ⎢0 cos(r) -sin(r)⎥ ⎣ 0 0 1⎦ ⎣-sin(p) 0 cos(p)⎦ ⎣0 sin(r) cos(r)⎦ = R_AB * R_BC * R_CD
Note
In this discussion, A is the Space frame and D is the Body frame. One way to visualize this rotation sequence is by introducing intermediate frames B and C (useful constructs to understand this rotation sequence). Initially, the frames are aligned so
Di = Ci = Bi = Ai (i = x, y, z)
. Then D is subjected to successive right-handed rotations relative to A.- 1st rotation R_CD: Frame D rotates relative to frames C, B, A by a
roll angle
r
aboutDx = Cx
. Note: D and C are no longer aligned.- 2nd rotation R_BC: Frames D, C (collectively – as if welded together)
rotate relative to frame B, A by a pitch angle
p
aboutCy = By
. Note: C and B are no longer aligned.- 3rd rotation R_AB: Frames D, C, B (collectively – as if welded)
rotate relative to frame A by a roll angle
y
aboutBz = Az
. Note: B and A are no longer aligned.Note
This method constructs a RotationMatrix from a RollPitchYaw. Vice-versa, there are high-accuracy RollPitchYaw constructor/methods that form a RollPitchYaw from a rotation matrix.
-
template
cast
¶ Instantiations:
cast[AutoDiffXd]
-
cast[AutoDiffXd]
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
-
cast[AutoDiffXd]
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
col
(self: pydrake.math.RotationMatrix_[AutoDiffXd], index: int) → numpy.ndarray[object[3, 1]]¶ Returns
this
rotation matrix’s iᵗʰ column (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - col(0) returns Bx_A (Bx expressed in terms of Ax, Ay, Az). - col(1) returns By_A (By expressed in terms of Ax, Ay, Az). - col(2) returns Bz_A (Bz expressed in terms of Ax, Ay, Az).- Parameter
index
: - requested column index (0 <= index <= 2).
See also
row(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s col() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Bz_A = col(2);
orVector3<T> Bz_A = col(2);
- Parameter
-
static
Identity
() → pydrake.math.RotationMatrix_[AutoDiffXd]¶
-
inverse
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]¶
-
IsExactlyIdentity
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → bool¶ Returns
True
ifthis
is exactly equal to the identity matrix.
-
IsIdentityToInternalTolerance
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → bool¶ Returns true if
this
is equal to the identity matrix to within the threshold of get_internal_tolerance_for_orthonormality().
-
IsValid
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → bool¶ Tests if
this
rotation matrix R is a proper orthonormal rotation matrix to within the threshold of get_internal_tolerance_for_orthonormality().Returns: True
ifthis
is a valid rotation matrix.
-
static
MakeXRotation
(theta: pydrake.autodiffutils.AutoDiffXd) → pydrake.math.RotationMatrix_[AutoDiffXd]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAx = Bx
.- Parameter
theta
: - radian measure of rotation angle about Ax.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitX().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAx = Bx
.⎡ 1 0 0 ⎤ R_AB = ⎢ 0 cos(theta) -sin(theta) ⎥ ⎣ 0 sin(theta) cos(theta) ⎦
- Parameter
-
static
MakeYRotation
(theta: pydrake.autodiffutils.AutoDiffXd) → pydrake.math.RotationMatrix_[AutoDiffXd]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAy = By
.- Parameter
theta
: - radian measure of rotation angle about Ay.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitY().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAy = By
.⎡ cos(theta) 0 sin(theta) ⎤ R_AB = ⎢ 0 1 0 ⎥ ⎣ -sin(theta) 0 cos(theta) ⎦
- Parameter
-
static
MakeZRotation
(theta: pydrake.autodiffutils.AutoDiffXd) → pydrake.math.RotationMatrix_[AutoDiffXd]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAz = Bz
.- Parameter
theta
: - radian measure of rotation angle about Az.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitZ().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAz = Bz
.⎡ cos(theta) -sin(theta) 0 ⎤ R_AB = ⎢ sin(theta) cos(theta) 0 ⎥ ⎣ 0 0 1 ⎦
- Parameter
-
matrix
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → numpy.ndarray[object[3, 3]]¶ Returns the Matrix3 underlying a RotationMatrix.
See also
col(), row()
-
multiply
(*args, **kwargs)¶ Overloaded function.
- multiply(self: pydrake.math.RotationMatrix_[AutoDiffXd], other: pydrake.math.RotationMatrix_[AutoDiffXd]) -> pydrake.math.RotationMatrix_[AutoDiffXd]
Calculates
this
rotation matrixR_AB
multiplied byother
rotation matrixR_BC
, returning the compositionR_AB * R_BC
.- Parameter
other
: - RotationMatrix that post-multiplies
this
.
Returns: rotation matrix that results from this
multiplied byother
.Note
It is possible (albeit improbable) to create an invalid rotation matrix by accumulating round-off error with a large number of multiplies.
- multiply(self: pydrake.math.RotationMatrix_[AutoDiffXd], v_B: numpy.ndarray[object[3, 1]]) -> numpy.ndarray[object[3, 1]]
Calculates
this
rotation matrixR_AB
multiplied by an arbitrary Vector3 expressed in the B frame.- Parameter
v_B
: - 3x1 vector that post-multiplies
this
.
Returns: 3x1 vector v_A = R_AB * v_B
.- multiply(self: pydrake.math.RotationMatrix_[AutoDiffXd], v_B: numpy.ndarray[object[3, n]]) -> numpy.ndarray[object[3, n]]
Multiplies
this
RotationMatrixR_AB
by the n vectorsv1
, … vn, where each vector has 3 elements and is expressed in frame B.- Parameter
v_B
: 3 x n
matrix whose n columns are regarded as arbitrary vectorsv1
, … vn expressed in frame B.- Returns
v_A
: 3 x n
matrix whose n columns are vectorsv1
, … vn expressed in frame A.
const RollPitchYaw<double> rpy(0.1, 0.2, 0.3); const RotationMatrix<double> R_AB(rpy); Eigen::Matrix<double, 3, 2> v_B; v_B.col(0) = Vector3d(4, 5, 6); v_B.col(1) = Vector3d(9, 8, 7); const Eigen::Matrix<double, 3, 2> v_A = R_AB * v_B;
-
static
ProjectToRotationMatrix
(M: numpy.ndarray[object[3, 3]]) → pydrake.math.RotationMatrix_[AutoDiffXd]¶ Given an approximate rotation matrix M, finds the RotationMatrix R closest to M. Closeness is measured with a matrix-2 norm (or equivalently with a Frobenius norm). Hence, this method creates a RotationMatrix R from a 3x3 matrix M by minimizing
‖R - M‖₂
(the matrix-2 norm of (R-M)) subject toR * Rᵀ = I
, where I is the 3x3 identity matrix. For this problem, closeness can also be measured by forming the orthonormal matrix R whose elements minimize the double-summation∑ᵢ ∑ⱼ (R(i,j) - M(i,j))²
wherei = 1:3, j = 1:3
, subject toR * Rᵀ = I
. The square-root of this double-summation is called the Frobenius norm.- Parameter
M
: - a 3x3 matrix.
- Parameter
quality_factor
: - . The quality of M as a rotation matrix.
quality_factor
= 1 is perfect (M = R).quality_factor
= 1.25 means that when M multiplies a unit vector (magnitude 1), a vector of magnitude as large as 1.25 may result.quality_factor
= 0.8 means that when M multiplies a unit vector, a vector of magnitude as small as 0.8 may result.quality_factor
= 0 means M is singular, so at least one of the bases related by matrix M does not span 3D space (when M multiples a unit vector, a vector of magnitude as small as 0 may result).
Returns: proper orthonormal matrix R that is closest to M. Raises: RuntimeError if R fails IsValid(R). Note
William Kahan (UC Berkeley) and Hongkai Dai (Toyota Research Institute) proved that for this problem, the same R that minimizes the Frobenius norm also minimizes the matrix-2 norm (a.k.a an induced-2 norm), which is defined [Dahleh, Section 4.2] as the column matrix u which maximizes
‖(R - M) u‖ / ‖u‖
, whereu ≠ 0
. Since the matrix-2 norm of any matrix A is equal to the maximum singular value of A, minimizing the matrix-2 norm of (R - M) is equivalent to minimizing the maximum singular value of (R - M).- [Dahleh] “Lectures on Dynamic Systems and Controls: Electrical
Engineering and Computer Science, Massachusetts Institute of Technology” https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-241j-dynamic-systems-and-control-spring-2011/readings/MIT6_241JS11_chap04.pdf
- Parameter
-
row
(self: pydrake.math.RotationMatrix_[AutoDiffXd], index: int) → numpy.ndarray[object[1, 3]]¶ Returns
this
rotation matrix’s iᵗʰ row (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - row(0) returns Ax_B (Ax expressed in terms of Bx, By, Bz). - row(1) returns Ay_B (Ay expressed in terms of Bx, By, Bz). - row(2) returns Az_B (Az expressed in terms of Bx, By, Bz).- Parameter
index
: - requested row index (0 <= index <= 2).
See also
col(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s row() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Az_B = row(2);
orRowVector3<T> Az_B = row(2);
- Parameter
-
set
(self: pydrake.math.RotationMatrix_[AutoDiffXd], R: numpy.ndarray[object[3, 3]]) → None¶ Sets
this
RotationMatrix from a Matrix3.- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - Parameter
-
ToAngleAxis
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.common.eigen_geometry.AngleAxis_[AutoDiffXd]¶ Returns an AngleAxis
theta_lambda
containing an angletheta
and unit vector (axis direction)lambda
that representsthis
RotationMatrix.Note
The orientation and RotationMatrix associated with
theta * lambda
is identical to that of(-theta) * (-lambda)
. The AngleAxis returned by this method chooses to have0 <= theta <= pi
.Returns: an AngleAxis with 0 <= theta <= pi
and a unit vectorlambda
.
-
ToQuaternion
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.common.eigen_geometry.Quaternion_[AutoDiffXd]¶ Returns a quaternion q that represents
this
RotationMatrix. Since the quaternionq
and-q
represent the same RotationMatrix, this method chooses to return a canonical quaternion, i.e., with q(0) >= 0.Note
There is a constructor in the RollPitchYaw class that converts a rotation matrix to roll-pitch-yaw angles.
-
transpose
(self: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]¶
-
class
pydrake.math.
RotationMatrix_[Expression]
¶ This class represents a 3x3 rotation matrix between two arbitrary frames A and B and helps ensure users create valid rotation matrices. This class relates right-handed orthogonal unit vectors Ax, Ay, Az fixed in frame A to right-handed orthogonal unit vectors Bx, By, Bz fixed in frame B. The monogram notation for the rotation matrix relating A to B is
R_AB
. An example that gives context to this rotation matrix isv_A = R_AB * v_B
, wherev_B
denotes an arbitrary vector v expressed in terms of Bx, By, Bz andv_A
denotes vector v expressed in terms of Ax, Ay, Az. See multibody_quantities for monogram notation for dynamics. See orientation_discussion “a discussion on rotation matrices”.Note
This class does not store the frames associated with a rotation matrix nor does it enforce strict proper usage of this class with vectors.
Note
When assertions are enabled, several methods in this class do a validity check and throw an exception (RuntimeError) if the rotation matrix is invalid. When assertions are disabled, many of these validity checks are skipped (which helps improve speed). In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.- Authors:
- Paul Mitiguy (2018) Original author.
- Authors:
- Drake team (see https://drake.mit.edu/credits).
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.math.RotationMatrix_[Expression]) -> None
Constructs a 3x3 identity RotationMatrix – which corresponds to aligning two frames (so that unit vectors Ax = Bx, Ay = By, Az = Bz).
- __init__(self: pydrake.math.RotationMatrix_[Expression], other: pydrake.math.RotationMatrix_[Expression]) -> None
- __init__(self: pydrake.math.RotationMatrix_[Expression], R: numpy.ndarray[object[3, 3]]) -> None
Constructs a RotationMatrix from a Matrix3.
- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - __init__(self: pydrake.math.RotationMatrix_[Expression], quaternion: pydrake.common.eigen_geometry.Quaternion_[Expression]) -> None
Constructs a RotationMatrix from an Eigen::Quaternion.
- Parameter
quaternion
: - a non-zero, finite quaternion which may or may not have unit
length [i.e.,
quaternion.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
quaternion
fails IsValid(R). For example, an - exception is thrown if
quaternion
is zero or contains a NaN or infinity.
Note
This method has the effect of normalizing its
quaternion
argument, without the inefficiency of the square-root associated with normalization.- __init__(self: pydrake.math.RotationMatrix_[Expression], theta_lambda: pydrake.common.eigen_geometry.AngleAxis_[Expression]) -> None
Constructs a RotationMatrix from an Eigen::AngleAxis.
- Parameter
theta_lambda
: - an Eigen::AngleAxis whose associated axis (vector direction herein
called
lambda
) is non-zero and finite, but which may or may not have unit length [i.e.,lambda.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
theta_lambda
fails IsValid(R). For example, an - exception is thrown if
lambda
is zero or contains a NaN or infinity.
- __init__(self: pydrake.math.RotationMatrix_[Expression], rpy: drake::math::RollPitchYaw<drake::symbolic::Expression>) -> None
Constructs a RotationMatrix from an RollPitchYaw. In other words, makes the RotationMatrix for a Space-fixed (extrinsic) X-Y-Z rotation by “roll-pitch-yaw” angles
[r, p, y]
, which is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by “yaw-pitch-roll” angles[y, p, r]
.- Parameter
rpy
: - radian measures of three angles [roll, pitch, yaw].
- Parameter
rpy
: - a RollPitchYaw which is a Space-fixed (extrinsic) X-Y-Z rotation
with “roll-pitch-yaw” angles
[r, p, y]
or equivalently a Body- fixed (intrinsic) Z-Y-X rotation with “yaw-pitch-roll” angles[y, p, r]
.
Note
Denoting roll
r
, pitchp
, yawy
, this method returns a rotation matrixR_AD
equal to the matrix multiplication shown below.⎡cos(y) -sin(y) 0⎤ ⎡ cos(p) 0 sin(p)⎤ ⎡1 0 0 ⎤ R_AD = ⎢sin(y) cos(y) 0⎥ * ⎢ 0 1 0 ⎥ * ⎢0 cos(r) -sin(r)⎥ ⎣ 0 0 1⎦ ⎣-sin(p) 0 cos(p)⎦ ⎣0 sin(r) cos(r)⎦ = R_AB * R_BC * R_CD
Note
In this discussion, A is the Space frame and D is the Body frame. One way to visualize this rotation sequence is by introducing intermediate frames B and C (useful constructs to understand this rotation sequence). Initially, the frames are aligned so
Di = Ci = Bi = Ai (i = x, y, z)
. Then D is subjected to successive right-handed rotations relative to A.- 1st rotation R_CD: Frame D rotates relative to frames C, B, A by a
roll angle
r
aboutDx = Cx
. Note: D and C are no longer aligned.- 2nd rotation R_BC: Frames D, C (collectively – as if welded together)
rotate relative to frame B, A by a pitch angle
p
aboutCy = By
. Note: C and B are no longer aligned.- 3rd rotation R_AB: Frames D, C, B (collectively – as if welded)
rotate relative to frame A by a roll angle
y
aboutBz = Az
. Note: B and A are no longer aligned.Note
This method constructs a RotationMatrix from a RollPitchYaw. Vice-versa, there are high-accuracy RollPitchYaw constructor/methods that form a RollPitchYaw from a rotation matrix.
-
template
cast
¶ Instantiations:
cast[Expression]
-
cast[Expression]
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.math.RotationMatrix_[Expression]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
-
cast[Expression]
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.math.RotationMatrix_[Expression]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
col
(self: pydrake.math.RotationMatrix_[Expression], index: int) → numpy.ndarray[object[3, 1]]¶ Returns
this
rotation matrix’s iᵗʰ column (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - col(0) returns Bx_A (Bx expressed in terms of Ax, Ay, Az). - col(1) returns By_A (By expressed in terms of Ax, Ay, Az). - col(2) returns Bz_A (Bz expressed in terms of Ax, Ay, Az).- Parameter
index
: - requested column index (0 <= index <= 2).
See also
row(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s col() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Bz_A = col(2);
orVector3<T> Bz_A = col(2);
- Parameter
-
static
Identity
() → pydrake.math.RotationMatrix_[Expression]¶
-
inverse
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.math.RotationMatrix_[Expression]¶
-
IsExactlyIdentity
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.symbolic.Formula¶ Returns
True
ifthis
is exactly equal to the identity matrix.
-
IsIdentityToInternalTolerance
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.symbolic.Formula¶ Returns true if
this
is equal to the identity matrix to within the threshold of get_internal_tolerance_for_orthonormality().
-
IsValid
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.symbolic.Formula¶ Tests if
this
rotation matrix R is a proper orthonormal rotation matrix to within the threshold of get_internal_tolerance_for_orthonormality().Returns: True
ifthis
is a valid rotation matrix.
-
static
MakeXRotation
(theta: pydrake.symbolic.Expression) → pydrake.math.RotationMatrix_[Expression]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAx = Bx
.- Parameter
theta
: - radian measure of rotation angle about Ax.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitX().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAx = Bx
.⎡ 1 0 0 ⎤ R_AB = ⎢ 0 cos(theta) -sin(theta) ⎥ ⎣ 0 sin(theta) cos(theta) ⎦
- Parameter
-
static
MakeYRotation
(theta: pydrake.symbolic.Expression) → pydrake.math.RotationMatrix_[Expression]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAy = By
.- Parameter
theta
: - radian measure of rotation angle about Ay.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitY().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAy = By
.⎡ cos(theta) 0 sin(theta) ⎤ R_AB = ⎢ 0 1 0 ⎥ ⎣ -sin(theta) 0 cos(theta) ⎦
- Parameter
-
static
MakeZRotation
(theta: pydrake.symbolic.Expression) → pydrake.math.RotationMatrix_[Expression]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAz = Bz
.- Parameter
theta
: - radian measure of rotation angle about Az.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitZ().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAz = Bz
.⎡ cos(theta) -sin(theta) 0 ⎤ R_AB = ⎢ sin(theta) cos(theta) 0 ⎥ ⎣ 0 0 1 ⎦
- Parameter
-
matrix
(self: pydrake.math.RotationMatrix_[Expression]) → numpy.ndarray[object[3, 3]]¶ Returns the Matrix3 underlying a RotationMatrix.
See also
col(), row()
-
multiply
(*args, **kwargs)¶ Overloaded function.
- multiply(self: pydrake.math.RotationMatrix_[Expression], other: pydrake.math.RotationMatrix_[Expression]) -> pydrake.math.RotationMatrix_[Expression]
Calculates
this
rotation matrixR_AB
multiplied byother
rotation matrixR_BC
, returning the compositionR_AB * R_BC
.- Parameter
other
: - RotationMatrix that post-multiplies
this
.
Returns: rotation matrix that results from this
multiplied byother
.Note
It is possible (albeit improbable) to create an invalid rotation matrix by accumulating round-off error with a large number of multiplies.
- multiply(self: pydrake.math.RotationMatrix_[Expression], v_B: numpy.ndarray[object[3, 1]]) -> numpy.ndarray[object[3, 1]]
Calculates
this
rotation matrixR_AB
multiplied by an arbitrary Vector3 expressed in the B frame.- Parameter
v_B
: - 3x1 vector that post-multiplies
this
.
Returns: 3x1 vector v_A = R_AB * v_B
.- multiply(self: pydrake.math.RotationMatrix_[Expression], v_B: numpy.ndarray[object[3, n]]) -> numpy.ndarray[object[3, n]]
Multiplies
this
RotationMatrixR_AB
by the n vectorsv1
, … vn, where each vector has 3 elements and is expressed in frame B.- Parameter
v_B
: 3 x n
matrix whose n columns are regarded as arbitrary vectorsv1
, … vn expressed in frame B.- Returns
v_A
: 3 x n
matrix whose n columns are vectorsv1
, … vn expressed in frame A.
const RollPitchYaw<double> rpy(0.1, 0.2, 0.3); const RotationMatrix<double> R_AB(rpy); Eigen::Matrix<double, 3, 2> v_B; v_B.col(0) = Vector3d(4, 5, 6); v_B.col(1) = Vector3d(9, 8, 7); const Eigen::Matrix<double, 3, 2> v_A = R_AB * v_B;
-
static
ProjectToRotationMatrix
(M: numpy.ndarray[object[3, 3]]) → pydrake.math.RotationMatrix_[Expression]¶ Given an approximate rotation matrix M, finds the RotationMatrix R closest to M. Closeness is measured with a matrix-2 norm (or equivalently with a Frobenius norm). Hence, this method creates a RotationMatrix R from a 3x3 matrix M by minimizing
‖R - M‖₂
(the matrix-2 norm of (R-M)) subject toR * Rᵀ = I
, where I is the 3x3 identity matrix. For this problem, closeness can also be measured by forming the orthonormal matrix R whose elements minimize the double-summation∑ᵢ ∑ⱼ (R(i,j) - M(i,j))²
wherei = 1:3, j = 1:3
, subject toR * Rᵀ = I
. The square-root of this double-summation is called the Frobenius norm.- Parameter
M
: - a 3x3 matrix.
- Parameter
quality_factor
: - . The quality of M as a rotation matrix.
quality_factor
= 1 is perfect (M = R).quality_factor
= 1.25 means that when M multiplies a unit vector (magnitude 1), a vector of magnitude as large as 1.25 may result.quality_factor
= 0.8 means that when M multiplies a unit vector, a vector of magnitude as small as 0.8 may result.quality_factor
= 0 means M is singular, so at least one of the bases related by matrix M does not span 3D space (when M multiples a unit vector, a vector of magnitude as small as 0 may result).
Returns: proper orthonormal matrix R that is closest to M. Raises: RuntimeError if R fails IsValid(R). Note
William Kahan (UC Berkeley) and Hongkai Dai (Toyota Research Institute) proved that for this problem, the same R that minimizes the Frobenius norm also minimizes the matrix-2 norm (a.k.a an induced-2 norm), which is defined [Dahleh, Section 4.2] as the column matrix u which maximizes
‖(R - M) u‖ / ‖u‖
, whereu ≠ 0
. Since the matrix-2 norm of any matrix A is equal to the maximum singular value of A, minimizing the matrix-2 norm of (R - M) is equivalent to minimizing the maximum singular value of (R - M).- [Dahleh] “Lectures on Dynamic Systems and Controls: Electrical
Engineering and Computer Science, Massachusetts Institute of Technology” https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-241j-dynamic-systems-and-control-spring-2011/readings/MIT6_241JS11_chap04.pdf
- Parameter
-
row
(self: pydrake.math.RotationMatrix_[Expression], index: int) → numpy.ndarray[object[1, 3]]¶ Returns
this
rotation matrix’s iᵗʰ row (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - row(0) returns Ax_B (Ax expressed in terms of Bx, By, Bz). - row(1) returns Ay_B (Ay expressed in terms of Bx, By, Bz). - row(2) returns Az_B (Az expressed in terms of Bx, By, Bz).- Parameter
index
: - requested row index (0 <= index <= 2).
See also
col(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s row() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Az_B = row(2);
orRowVector3<T> Az_B = row(2);
- Parameter
-
set
(self: pydrake.math.RotationMatrix_[Expression], R: numpy.ndarray[object[3, 3]]) → None¶ Sets
this
RotationMatrix from a Matrix3.- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - Parameter
-
ToAngleAxis
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.common.eigen_geometry.AngleAxis_[Expression]¶ Returns an AngleAxis
theta_lambda
containing an angletheta
and unit vector (axis direction)lambda
that representsthis
RotationMatrix.Note
The orientation and RotationMatrix associated with
theta * lambda
is identical to that of(-theta) * (-lambda)
. The AngleAxis returned by this method chooses to have0 <= theta <= pi
.Returns: an AngleAxis with 0 <= theta <= pi
and a unit vectorlambda
.
-
ToQuaternion
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.common.eigen_geometry.Quaternion_[Expression]¶ Returns a quaternion q that represents
this
RotationMatrix. Since the quaternionq
and-q
represent the same RotationMatrix, this method chooses to return a canonical quaternion, i.e., with q(0) >= 0.Note
There is a constructor in the RollPitchYaw class that converts a rotation matrix to roll-pitch-yaw angles.
-
transpose
(self: pydrake.math.RotationMatrix_[Expression]) → pydrake.math.RotationMatrix_[Expression]¶
-
class
pydrake.math.
RotationMatrix_[float]
¶ This class represents a 3x3 rotation matrix between two arbitrary frames A and B and helps ensure users create valid rotation matrices. This class relates right-handed orthogonal unit vectors Ax, Ay, Az fixed in frame A to right-handed orthogonal unit vectors Bx, By, Bz fixed in frame B. The monogram notation for the rotation matrix relating A to B is
R_AB
. An example that gives context to this rotation matrix isv_A = R_AB * v_B
, wherev_B
denotes an arbitrary vector v expressed in terms of Bx, By, Bz andv_A
denotes vector v expressed in terms of Ax, Ay, Az. See multibody_quantities for monogram notation for dynamics. See orientation_discussion “a discussion on rotation matrices”.Note
This class does not store the frames associated with a rotation matrix nor does it enforce strict proper usage of this class with vectors.
Note
When assertions are enabled, several methods in this class do a validity check and throw an exception (RuntimeError) if the rotation matrix is invalid. When assertions are disabled, many of these validity checks are skipped (which helps improve speed). In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.- Authors:
- Paul Mitiguy (2018) Original author.
- Authors:
- Drake team (see https://drake.mit.edu/credits).
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.math.RotationMatrix_[float]) -> None
Constructs a 3x3 identity RotationMatrix – which corresponds to aligning two frames (so that unit vectors Ax = Bx, Ay = By, Az = Bz).
- __init__(self: pydrake.math.RotationMatrix_[float], other: pydrake.math.RotationMatrix_[float]) -> None
- __init__(self: pydrake.math.RotationMatrix_[float], R: numpy.ndarray[numpy.float64[3, 3]]) -> None
Constructs a RotationMatrix from a Matrix3.
- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - __init__(self: pydrake.math.RotationMatrix_[float], quaternion: Eigen::Quaternion<double, 0>) -> None
Constructs a RotationMatrix from an Eigen::Quaternion.
- Parameter
quaternion
: - a non-zero, finite quaternion which may or may not have unit
length [i.e.,
quaternion.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
quaternion
fails IsValid(R). For example, an - exception is thrown if
quaternion
is zero or contains a NaN or infinity.
Note
This method has the effect of normalizing its
quaternion
argument, without the inefficiency of the square-root associated with normalization.- __init__(self: pydrake.math.RotationMatrix_[float], theta_lambda: Eigen::AngleAxis<double>) -> None
Constructs a RotationMatrix from an Eigen::AngleAxis.
- Parameter
theta_lambda
: - an Eigen::AngleAxis whose associated axis (vector direction herein
called
lambda
) is non-zero and finite, but which may or may not have unit length [i.e.,lambda.norm()
does not have to be 1].
Raises: - RuntimeError in debug builds if the rotation matrix R that is
- built from
theta_lambda
fails IsValid(R). For example, an - exception is thrown if
lambda
is zero or contains a NaN or infinity.
- __init__(self: pydrake.math.RotationMatrix_[float], rpy: drake::math::RollPitchYaw<double>) -> None
Constructs a RotationMatrix from an RollPitchYaw. In other words, makes the RotationMatrix for a Space-fixed (extrinsic) X-Y-Z rotation by “roll-pitch-yaw” angles
[r, p, y]
, which is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by “yaw-pitch-roll” angles[y, p, r]
.- Parameter
rpy
: - radian measures of three angles [roll, pitch, yaw].
- Parameter
rpy
: - a RollPitchYaw which is a Space-fixed (extrinsic) X-Y-Z rotation
with “roll-pitch-yaw” angles
[r, p, y]
or equivalently a Body- fixed (intrinsic) Z-Y-X rotation with “yaw-pitch-roll” angles[y, p, r]
.
Note
Denoting roll
r
, pitchp
, yawy
, this method returns a rotation matrixR_AD
equal to the matrix multiplication shown below.⎡cos(y) -sin(y) 0⎤ ⎡ cos(p) 0 sin(p)⎤ ⎡1 0 0 ⎤ R_AD = ⎢sin(y) cos(y) 0⎥ * ⎢ 0 1 0 ⎥ * ⎢0 cos(r) -sin(r)⎥ ⎣ 0 0 1⎦ ⎣-sin(p) 0 cos(p)⎦ ⎣0 sin(r) cos(r)⎦ = R_AB * R_BC * R_CD
Note
In this discussion, A is the Space frame and D is the Body frame. One way to visualize this rotation sequence is by introducing intermediate frames B and C (useful constructs to understand this rotation sequence). Initially, the frames are aligned so
Di = Ci = Bi = Ai (i = x, y, z)
. Then D is subjected to successive right-handed rotations relative to A.- 1st rotation R_CD: Frame D rotates relative to frames C, B, A by a
roll angle
r
aboutDx = Cx
. Note: D and C are no longer aligned.- 2nd rotation R_BC: Frames D, C (collectively – as if welded together)
rotate relative to frame B, A by a pitch angle
p
aboutCy = By
. Note: C and B are no longer aligned.- 3rd rotation R_AB: Frames D, C, B (collectively – as if welded)
rotate relative to frame A by a roll angle
y
aboutBz = Az
. Note: B and A are no longer aligned.Note
This method constructs a RotationMatrix from a RollPitchYaw. Vice-versa, there are high-accuracy RollPitchYaw constructor/methods that form a RollPitchYaw from a rotation matrix.
-
template
cast
¶ Instantiations:
cast[float]
,cast[AutoDiffXd]
,cast[Expression]
-
cast[float]
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
-
cast[AutoDiffXd]
(self: pydrake.math.RotationMatrix_[float]) → drake::math::RotationMatrix<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
cast[Expression]
(self: pydrake.math.RotationMatrix_[float]) → drake::math::RotationMatrix<drake::symbolic::Expression>¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
cast[float]
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶ Creates a RotationMatrix templatized on a scalar type U from a RotationMatrix templatized on scalar type T. For example,
RotationMatrix<double> source = RotationMatrix<double>::Identity(); RotationMatrix<AutoDiffXd> foo = source.cast<AutoDiffXd>();
- Template parameter
U
: - Scalar type on which the returned RotationMatrix is templated.
Note
RotationMatrix<From>::cast<To>()
creates a newRotationMatrix<To>
from aRotationMatrix<From>
but only if typeTo
is constructible from typeFrom
. This cast method works in accordance with Eigen’s cast method for Eigen’s Matrix3 that underlies this RotationMatrix. For example, Eigen currently allows cast from type double to AutoDiffXd, but not vice-versa.- Template parameter
-
col
(self: pydrake.math.RotationMatrix_[float], index: int) → numpy.ndarray[numpy.float64[3, 1]]¶ Returns
this
rotation matrix’s iᵗʰ column (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - col(0) returns Bx_A (Bx expressed in terms of Ax, Ay, Az). - col(1) returns By_A (By expressed in terms of Ax, Ay, Az). - col(2) returns Bz_A (Bz expressed in terms of Ax, Ay, Az).- Parameter
index
: - requested column index (0 <= index <= 2).
See also
row(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s col() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Bz_A = col(2);
orVector3<T> Bz_A = col(2);
- Parameter
-
static
Identity
() → pydrake.math.RotationMatrix_[float]¶
-
inverse
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶
-
IsExactlyIdentity
(self: pydrake.math.RotationMatrix_[float]) → bool¶ Returns
True
ifthis
is exactly equal to the identity matrix.
-
IsIdentityToInternalTolerance
(self: pydrake.math.RotationMatrix_[float]) → bool¶ Returns true if
this
is equal to the identity matrix to within the threshold of get_internal_tolerance_for_orthonormality().
-
IsValid
(self: pydrake.math.RotationMatrix_[float]) → bool¶ Tests if
this
rotation matrix R is a proper orthonormal rotation matrix to within the threshold of get_internal_tolerance_for_orthonormality().Returns: True
ifthis
is a valid rotation matrix.
-
static
MakeXRotation
(theta: float) → pydrake.math.RotationMatrix_[float]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAx = Bx
.- Parameter
theta
: - radian measure of rotation angle about Ax.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitX().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAx = Bx
.⎡ 1 0 0 ⎤ R_AB = ⎢ 0 cos(theta) -sin(theta) ⎥ ⎣ 0 sin(theta) cos(theta) ⎦
- Parameter
-
static
MakeYRotation
(theta: float) → pydrake.math.RotationMatrix_[float]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAy = By
.- Parameter
theta
: - radian measure of rotation angle about Ay.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitY().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAy = By
.⎡ cos(theta) 0 sin(theta) ⎤ R_AB = ⎢ 0 1 0 ⎥ ⎣ -sin(theta) 0 cos(theta) ⎦
- Parameter
-
static
MakeZRotation
(theta: float) → pydrake.math.RotationMatrix_[float]¶ Makes the RotationMatrix
R_AB
associated with rotating a frame B relative to a frame A by an angletheta
about unit vectorAz = Bz
.- Parameter
theta
: - radian measure of rotation angle about Az.
Note
Orientation is same as Eigen::AngleAxis<T>(theta, Vector3d::UnitZ().
Note
R_AB
relates two frames A and B having unit vectors Ax, Ay, Az and Bx, By, Bz. Initially,Bx = Ax
, By = Ay,Bz = Az
, then B undergoes a right-handed rotation relative to A by an angletheta
aboutAz = Bz
.⎡ cos(theta) -sin(theta) 0 ⎤ R_AB = ⎢ sin(theta) cos(theta) 0 ⎥ ⎣ 0 0 1 ⎦
- Parameter
-
matrix
(self: pydrake.math.RotationMatrix_[float]) → numpy.ndarray[numpy.float64[3, 3]]¶ Returns the Matrix3 underlying a RotationMatrix.
See also
col(), row()
-
multiply
(*args, **kwargs)¶ Overloaded function.
- multiply(self: pydrake.math.RotationMatrix_[float], other: pydrake.math.RotationMatrix_[float]) -> pydrake.math.RotationMatrix_[float]
Calculates
this
rotation matrixR_AB
multiplied byother
rotation matrixR_BC
, returning the compositionR_AB * R_BC
.- Parameter
other
: - RotationMatrix that post-multiplies
this
.
Returns: rotation matrix that results from this
multiplied byother
.Note
It is possible (albeit improbable) to create an invalid rotation matrix by accumulating round-off error with a large number of multiplies.
- multiply(self: pydrake.math.RotationMatrix_[float], v_B: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 1]]
Calculates
this
rotation matrixR_AB
multiplied by an arbitrary Vector3 expressed in the B frame.- Parameter
v_B
: - 3x1 vector that post-multiplies
this
.
Returns: 3x1 vector v_A = R_AB * v_B
.- multiply(self: pydrake.math.RotationMatrix_[float], v_B: numpy.ndarray[numpy.float64[3, n]]) -> numpy.ndarray[numpy.float64[3, n]]
Multiplies
this
RotationMatrixR_AB
by the n vectorsv1
, … vn, where each vector has 3 elements and is expressed in frame B.- Parameter
v_B
: 3 x n
matrix whose n columns are regarded as arbitrary vectorsv1
, … vn expressed in frame B.- Returns
v_A
: 3 x n
matrix whose n columns are vectorsv1
, … vn expressed in frame A.
const RollPitchYaw<double> rpy(0.1, 0.2, 0.3); const RotationMatrix<double> R_AB(rpy); Eigen::Matrix<double, 3, 2> v_B; v_B.col(0) = Vector3d(4, 5, 6); v_B.col(1) = Vector3d(9, 8, 7); const Eigen::Matrix<double, 3, 2> v_A = R_AB * v_B;
-
static
ProjectToRotationMatrix
(M: numpy.ndarray[numpy.float64[3, 3]]) → pydrake.math.RotationMatrix_[float]¶ Given an approximate rotation matrix M, finds the RotationMatrix R closest to M. Closeness is measured with a matrix-2 norm (or equivalently with a Frobenius norm). Hence, this method creates a RotationMatrix R from a 3x3 matrix M by minimizing
‖R - M‖₂
(the matrix-2 norm of (R-M)) subject toR * Rᵀ = I
, where I is the 3x3 identity matrix. For this problem, closeness can also be measured by forming the orthonormal matrix R whose elements minimize the double-summation∑ᵢ ∑ⱼ (R(i,j) - M(i,j))²
wherei = 1:3, j = 1:3
, subject toR * Rᵀ = I
. The square-root of this double-summation is called the Frobenius norm.- Parameter
M
: - a 3x3 matrix.
- Parameter
quality_factor
: - . The quality of M as a rotation matrix.
quality_factor
= 1 is perfect (M = R).quality_factor
= 1.25 means that when M multiplies a unit vector (magnitude 1), a vector of magnitude as large as 1.25 may result.quality_factor
= 0.8 means that when M multiplies a unit vector, a vector of magnitude as small as 0.8 may result.quality_factor
= 0 means M is singular, so at least one of the bases related by matrix M does not span 3D space (when M multiples a unit vector, a vector of magnitude as small as 0 may result).
Returns: proper orthonormal matrix R that is closest to M. Raises: RuntimeError if R fails IsValid(R). Note
William Kahan (UC Berkeley) and Hongkai Dai (Toyota Research Institute) proved that for this problem, the same R that minimizes the Frobenius norm also minimizes the matrix-2 norm (a.k.a an induced-2 norm), which is defined [Dahleh, Section 4.2] as the column matrix u which maximizes
‖(R - M) u‖ / ‖u‖
, whereu ≠ 0
. Since the matrix-2 norm of any matrix A is equal to the maximum singular value of A, minimizing the matrix-2 norm of (R - M) is equivalent to minimizing the maximum singular value of (R - M).- [Dahleh] “Lectures on Dynamic Systems and Controls: Electrical
Engineering and Computer Science, Massachusetts Institute of Technology” https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-241j-dynamic-systems-and-control-spring-2011/readings/MIT6_241JS11_chap04.pdf
- Parameter
-
row
(self: pydrake.math.RotationMatrix_[float], index: int) → numpy.ndarray[numpy.float64[1, 3]]¶ Returns
this
rotation matrix’s iᵗʰ row (i = 0, 1, 2). Forthis
rotation matrix R_AB (which relates right-handed sets of orthogonal unit vectors Ax, Ay, Az to Bx, By, Bz), - row(0) returns Ax_B (Ax expressed in terms of Bx, By, Bz). - row(1) returns Ay_B (Ay expressed in terms of Bx, By, Bz). - row(2) returns Az_B (Az expressed in terms of Bx, By, Bz).- Parameter
index
: - requested row index (0 <= index <= 2).
See also
col(), matrix()
Raises: In debug builds, asserts (0 <= index <= 2). Note
For efficiency and consistency with Eigen, this method returns the same quantity returned by Eigen’s row() operator. The returned quantity can be assigned in various ways, e.g., as
const auto& Az_B = row(2);
orRowVector3<T> Az_B = row(2);
- Parameter
-
set
(self: pydrake.math.RotationMatrix_[float], R: numpy.ndarray[numpy.float64[3, 3]]) → None¶ Sets
this
RotationMatrix from a Matrix3.- Parameter
R
: - an allegedly valid rotation matrix.
Raises: RuntimeError in debug builds if R fails IsValid(R). - Parameter
-
ToAngleAxis
(self: pydrake.math.RotationMatrix_[float]) → Eigen::AngleAxis<double>¶ Returns an AngleAxis
theta_lambda
containing an angletheta
and unit vector (axis direction)lambda
that representsthis
RotationMatrix.Note
The orientation and RotationMatrix associated with
theta * lambda
is identical to that of(-theta) * (-lambda)
. The AngleAxis returned by this method chooses to have0 <= theta <= pi
.Returns: an AngleAxis with 0 <= theta <= pi
and a unit vectorlambda
.
-
ToQuaternion
(self: pydrake.math.RotationMatrix_[float]) → Eigen::Quaternion<double, 0>¶ Returns a quaternion q that represents
this
RotationMatrix. Since the quaternionq
and-q
represent the same RotationMatrix, this method chooses to return a canonical quaternion, i.e., with q(0) >= 0.Note
There is a constructor in the RollPitchYaw class that converts a rotation matrix to roll-pitch-yaw angles.
-
transpose
(self: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]¶
-
pydrake.math.
sin
(*args, **kwargs)¶ Overloaded function.
- sin(arg0: float) -> float
- sin(arg0: pydrake.autodiffutils.AutoDiffXd) -> pydrake.autodiffutils.AutoDiffXd
- sin(arg0: pydrake.symbolic.Expression) -> pydrake.symbolic.Expression
-
pydrake.math.
sinh
(*args, **kwargs)¶ Overloaded function.
- sinh(arg0: float) -> float
- sinh(arg0: pydrake.autodiffutils.AutoDiffXd) -> pydrake.autodiffutils.AutoDiffXd
- sinh(arg0: pydrake.symbolic.Expression) -> pydrake.symbolic.Expression
-
pydrake.math.
sqrt
(*args, **kwargs)¶ Overloaded function.
- sqrt(arg0: float) -> float
- sqrt(arg0: pydrake.autodiffutils.AutoDiffXd) -> pydrake.autodiffutils.AutoDiffXd
- sqrt(arg0: pydrake.symbolic.Expression) -> pydrake.symbolic.Expression
-
pydrake.math.
tan
(*args, **kwargs)¶ Overloaded function.
- tan(arg0: float) -> float
- tan(arg0: pydrake.autodiffutils.AutoDiffXd) -> pydrake.autodiffutils.AutoDiffXd
- tan(arg0: pydrake.symbolic.Expression) -> pydrake.symbolic.Expression
-
pydrake.math.
tanh
(*args, **kwargs)¶ Overloaded function.
- tanh(arg0: float) -> float
- tanh(arg0: pydrake.autodiffutils.AutoDiffXd) -> pydrake.autodiffutils.AutoDiffXd
- tanh(arg0: pydrake.symbolic.Expression) -> pydrake.symbolic.Expression
-
pydrake.math.
wrap_to
(value: float, low: float, high: float) → float¶ For variables that are meant to be periodic, (e.g. over a 2π interval), wraps
value
into the interval[low, high)
. Precisely,wrap_to
returns: value + k*(high-low) for the unique integer valuek
that lands the output in the desired interval.low
andhigh
must be finite, and low < high.


Note
While every design function has access to all JavaScript objects, the table below describes appropriate usage cases. For example, you may use emit() in List functions, but getRow() is not permitted during Map functions.
| JS Function | Reasonable to use in design doc functions |
|---|---|
| emit() | Map functions |
| getRow() | List functions |
| JSON | any |
| isArray() | any |
| log() | any |
| provides() | Show functions, List functions |
| registerType() | Show functions, List functions |
| require() | any, except Reduce and rereduce functions |
| send() | List functions |
| start() | List functions |
| sum() | any |
| toJSON() | any |
Each design function executes in a special context of predefined objects, modules and functions:
Emits a key-value pair for further processing by CouchDB after the map function is done.
| Arguments: |
|
|---|
function(doc){
emit(doc._id, doc._rev);
}
Extracts the next row from a related view result.
| Returns: | View result row |
|---|---|
| Return type: | object |
function(head, req){
send('[');
row = getRow();
if (row){
send(toJSON(row));
while(row = getRow()){
send(',');
send(toJSON(row));
}
}
return ']';
}
A helper function to check if the provided value is an Array.
| Arguments: |
|
|---|---|
| Returns: | true if obj is Array-typed, false otherwise |
| Return type: | boolean |
Log a message to the CouchDB log (at the INFO level).
| Arguments: |
|
|---|
function(doc){
log('Procesing doc ' + doc['_id']);
emit(doc['_id'], null);
}
After the map function has run, the following line can be found in CouchDB logs (e.g. at /var/log/couchdb/couch.log):
[Sat, 03 Nov 2012 17:38:02 GMT] [info] [<0.7543.0>] OS Process #Port<0.3289> Log :: Processing doc 8d300b86622d67953d102165dbe99467
Registers callable handler for specified MIME key.
| Arguments: |
|
|---|
Registers list of MIME types by associated key.
| Arguments: |
|
|---|
Predefined mappings (key-array):
Loads CommonJS module by a specified path. The path should not start with a slash.
| Arguments: |
|
|---|---|
| Returns: | Exported statements |
Sends a single string chunk in response.
| Arguments: |
|
|---|
function(head, req){
send('Hello,');
send(' ');
send('Couch');
return !
}
Initiates chunked response. As an option, a custom response object may be sent at this point. For list-functions only!
Note
list functions may set the HTTP response code and headers by calling this function. This function must be called before send(), getRow() or a return statement; otherwise, the query server will implicitly call this function with the empty object ({}).
function(head, req){
start({
"code": 302,
"headers": {
"Location": "http://couchdb.apache.org"
}
});
return "Relax!";
}
Sum arr‘s items.
| Arguments: |
|
|---|---|
| Return type: | number |
Encodes obj to JSON string. This is an alias for the JSON.stringify method.
| Arguments: |
|
|---|---|
| Returns: | JSON string |
Support for CommonJS Modules (introduced in CouchDB 0.11.0) allows you to create modular design functions without the need for duplication of functionality.
Here’s a CommonJS module that checks user permissions:
function user_context(userctx, secobj) {
var is_admin = function() {
return userctx.indexOf('_admin') != -1;
}
return {'is_admin': is_admin}
}
exports['user'] = user_context
Each module has access to additional global variables:
The CommonJS module can be added to a design document, like so:
{
"views": {
"lib": {
"security": "function user_context(userctx, secobj) { ... }"
},
"validate_doc_update": "function(newdoc, olddoc, userctx, secobj) {
user = require('lib/security').user(userctx, secobj);
return user.is_admin();
}"
},
"_id": "_design/test"
}
Modules paths are relative to the design document’s views object, but modules can only be loaded from the object referenced via lib. The lib structure can still be used for view functions as well, by simply storing view functions at e.g. views.lib.map, views.lib.reduce, etc.
Warning
Unlike the JavaScript query server, the Erlang query server does not run in a sandbox. This means Erlang code has full access to your OS, filesystem and network, which may lead to security issues. While Erlang functions are faster than JavaScript ones, you need to be careful about running them, especially if they were written by someone else.
Note
Due to security restrictions, the Erlang query server is disabled by default. To enable it, you need to edit your local.ini to include a native_query_servers section:
[native_query_servers]
erlang = {couch_native_process, start_link, []}
Don’t forget to restart CouchDB after updating the configuration, and use the language: "erlang" property in your Erlang design documents.
Emits key-value pairs to view indexer process.
fun({Doc}) ->
<<K,_/binary>> = proplists:get_value(<<"_rev">>, Doc, null),
V = proplists:get_value(<<"_id">>, Doc, null),
Emit(<<K>>, V)
end.
Helper to iterate over all rows in a list function.
| Arguments: |
|
|---|
fun(Head, {Req}) ->
Fun = fun({Row}, Acc) ->
Id = couch_util:get_value(<<"id">>, Row),
Send(list_to_binary(io_lib:format("Previous doc id: ~p~n", [Acc]))),
Send(list_to_binary(io_lib:format("Current doc id: ~p~n", [Id]))),
{ok, Id}
end,
FoldRows(Fun, nil),
""
end.
Retrieves the next row from a related view result.
%% FoldRows background implementation.
%% https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=blob;f=src/couchdb/couch_native_process.erl;hb=HEAD#l368
%%
foldrows(GetRow, ProcRow, Acc) ->
case GetRow() of
nil ->
{ok, Acc};
Row ->
case (catch ProcRow(Row, Acc)) of
{ok, Acc2} ->
foldrows(GetRow, ProcRow, Acc2);
{stop, Acc2} ->
{ok, Acc2}
end
end.
| Arguments: |
|
|---|
fun({Doc}) ->
<<K,_/binary>> = proplists:get_value(<<"_rev">>, Doc, null),
V = proplists:get_value(<<"_id">>, Doc, null),
Log(lists:flatten(io_lib:format("Hello from ~s doc!", [V]))),
Emit(<<K>>, V)
end.
After the map function has run, the following line can be found in CouchDB logs (e.g. at /var/log/couchdb/couch.log):
[Sun, 04 Nov 2012 11:33:58 GMT] [info] [<0.9144.2>] Hello from 8d300b86622d67953d102165dbe99467 doc!
Sends a single string Chunk in response.
fun(Head, {Req}) ->
Send("Hello,"),
Send(" "),
Send("Couch"),
"!"
end.
The function above produces the following response:
Hello, Couch!
| Arguments: |
|
|---|
Initialize List functions response. At this point, response code and headers may be defined. For example, this function redirects to the CouchDB web site:
fun(Head, {Req}) ->
Start({[{<<"code">>, 302},
{<<"headers">>, {[
{<<"Location">>, <<"http://couchdb.apache.org">>}]
}}
]}),
"Relax!"
end.


This file contains the utilities APIs for use in OPCUA module be implemented.
More...
#include <malloc.h>
Go to the source code of this file.
|
|
#define | EXPORT __attribute__((visibility("default"))) |
| |
This file contains the utilities APIs for use in OPCUA module be implemented.
◆ EdgeCalloc()
| EXPORT void* EdgeCalloc |
( |
size_t |
num, |
|
|
size_t |
size |
|
) |
| |
Allocates a block of memory for an array of num elements, each of them size bytes long and initializes all its bits to zero.
- Parameters
-
| num | - The number of elements |
| size | - Size of the element type in bytes, where size > 0 |
- Returns
- on success, a pointer to the allocated memory block on failure, a null pointer is returned
◆ EdgeFree()
| EXPORT void EdgeFree |
( |
void * |
ptr | ) |
|
Deallocate a block of memory previously allocated by a call to OICMalloc.
NOTE: This function is intended to be used internally by the TB Stack. It is not intended to be used by applications.
- Parameters
-
| ptr | - Pointer to block of memory previously allocated by OICMalloc. If ptr is a null pointer, the function does nothing. |
◆ EdgeMalloc()
| EXPORT void* EdgeMalloc |
( |
size_t |
size | ) |
|
Allocates a block of size bytes, returning a pointer to the beginning of the allocated block.
NOTE: This function is intended to be used internally by the TB Stack. It is not intended to be used by applications.
- Parameters
-
| size | - Size of the memory block in bytes, where size > 0 |
- Returns
- on success, a pointer to the allocated memory block on failure, a null pointer is returned
◆ EdgeRealloc()
| EXPORT void* EdgeRealloc |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
Re-allocates a block of memory, pointed to by ptr to the size specified in size. The returned value contains a pointer to the new location, with all data copied into it. If the new size of the memory-object require movement, the previous space is freed. If the new size is larger, the newly allocated area has non-deterministic content. If the space cannot be allocated, the value ptr is left unchanged.
- Parameters
-
| ptr | - Pointer to a block of memory previously allocated by OICCalloc, OICMalloc, or a previous call to this function. If this value is NULL, this function will work identically to a call to OICMalloc. |
| size | - Size of the new memory block in bytes, where size > 0 |
- Returns
- on success, a pointer to the newly sized memory block on failure, a null pointer is returned, and the memory pointed to by *ptr is untouched


--- layout: paper title: Publications --- Joint Inference of Temporal Relations with Markov Logic, , Transactions of the Japanese Society for Artificial Intelligence 2009
@inproceedings{yoshikawa09joint, keywords={Markov Logic,Temporal}, year={2009}, author={Katsumasa Yoshikawa and Sebastian Riedel and Masayuki Asahara and Yuji Matsumoto}, booktitle={Transactions of the Japanese Society for Artificial Intelligence}, title={Joint Inference of Temporal Relations with Markov Logic}, }


Anti-Counterfeiting Data Collaboration
Demo
Demonstration of Anti-Counterfeiting Data Collaboration, using blockchain - through
OpenDSU technology.
The Enterprise & Patient Wallet above (which are
easily compiled to native mobile Android/iOS application) are Progressive Web Applications
compatible with modern (>2016) mobile browsers.
The Backoffice Centralized Application is a regular web application,
compatible with modern browsers (both desktop and mobile , >2016).
Below are the available Authentication Features SSIs::
|
Marketing Authorization Holder |
Wholesaler |
Pharmacy |
| Id |
|
|
|
| KeySSI |
|
|
|
To integrate an Authentication Feature into a batch DSU, during it's creation check the 'Enable Authentication Feature' checkbox
and enter the value for the Authentication Feature KeySSI (above);
When Scanning this batch with the EPI app, you will see a message in orange informing you that an action is required to verify the pack.
You can then click the 'Verify Pack' button. This will launch the authentication feature;
You will see some details of the product can click the scan button. if you scan the same code as before,
you will be sent back to the EPI app with a Sucess message. If you scan any other code, the message will be a failure.
0.7.x - release notes for TARGET DATE 2021-10-26
Add publicly-accessible demonstration instructions here! (Replace and remove this note when finish)
Must have elements:
- Picture of the data matrixes of the products to scan, along with expected authentication features and results.
- Other explanatory notes (such as ePi preferences setup requirements, and how to access the ACDC Demonstrator to view remote scan reports.
- (Internal for developers)TODO: Deployment of keySSI of the authentication features should be built into the acdc-workspace octopus (and later Dockerfile deployment). (keySSIs change on every build ? Probably yes!)
- (Internal for developers)TODO: Provisioning of the authentication features selected for each batch should use the previously defined keySSI. Update mapping engine setup with those extra fields.
0.6.1 - release notes 2021-09-08
- Added instructions for the Authentication features integration and testing
- Mobile:
- Demo page for the Native Camera API bug fixes;
0.6.0 - release notes 2021-09-06
- Integration of Authentication features in the Leaflet SSApp;
- Update of DSU fabric and the Mapping engine to handle a new Batch Property - Authentication feature SSI;
- Standardization of Native APIs (Camera in this case) for all environments, available for every SSApp launched
- Creation of Demo Authentication Feature SSApp;
- Implemented communication mechanism between Authentication feature SSApp and Parent SSApp;
- Implemented ACDC Reporting (when selected by user) for the Authentication Feature Scan Results;
- Mobile:
- Inclusion of TrueMed's Native Camera SDK and Alpvision's JS Wrapper in the project;
- Integration of AlpVision JS Wrapper into the new Standard Camera API;
- Environment Dependent Camera API deployment;
v0.5.12 - Release notes 2021-07-19
v0.5.10 - Release notes 2021-06-23
v0.5.9 - Release notes 2021-06-17
- Pré-provisioned data matrixes to scan with the Patient Wallet,
-
Important: For the scan to be caught in the ACDC Demo
it is necessary to enable the permissions in Patient Wallet Settings (menu icon in the left corner) > Setup Anti-Counterfeiting Integration option.
- Enable Anti-Counterfeit Validation? Yes
- Share de-identified marker for Anti-Counterfeiting purposes? Yes
- Share location when scanning for Anti-Counterfeiting purposes? Yes
- Cosentyx, Novartis, GTIN<PHONE_NUMBER>0011, Batch MAY1701, Expiry: 2022-Apr-30
- Keytruda, MSD, GTIN<PHONE_NUMBER>1118, Batch MAY1702, Expiry: 2022-Apr-30
- Fluarix, GSK, GTIN<PHONE_NUMBER>1137, Batch MAY1703, Expiry: 2022-Apr-30
-
- Added responsive support for smaller devices.
- Added new properties to scan events.
- Improvement of functional, visible, and clickable elements.
- Fixed session expiration issue to redirect to /login correctly.
- Fixed some issues on event map visualization.
- Added export scans option.
-
Changed the users who can log in to the application:
-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>- password: 123456
- Please use Incognito mode to run the Enterprise Wallet or Patient Wallet (to ensure that you are running the latest).
v0.3.0 - Release notes 2021-05-20
Application description / testing instructions
- To test the feedback on ACDC Demo,
- Log in with your email address as username (use lower-case), and password 123456
(there are no features to sign-up or reset your password yet.)
- Choose menu entry Scan Data > Events.
- There are events with dates between 2021-May-19 and May-20.
- WARNING: When displaying more that 500 events at one time, your browser may slow down.
(the actual limit depends on your browser and network speed,
so reharse up to what point you can increase.)
v0.2.0 - Release notes 2021-05-06
WARNING: Unstable software and environments. Use at your own risk! Data persistence at risk of un-expected reset!
Application description / testing instructions
- Enterprise Wallet App (for MAH users):
- On the first usage, you need to register a username password to open the wallet. (Re-used from ePi)
- (See ePi instructions...)
- Patient Wallet App:
- On the first usage, you need to register a username password to open the wallet. (Re-used from ePi)
- (See ePi instructions...)
- Backoffice Centralized Application (one for each MAH):
- Login with a user<EMAIL_ADDRESS>, and access the menu "Scan-Data", "Event". Filter what events are needed, and display them on the "Map".
- Backoffice Centralized REST Services (one for each MAH):
- OpenAPI description/test page.
Relevant services:
- /borest/scan upload one scan event data (public access)
- /borest/acdc/event download all event data (authenticated access - please ask pharmaledger dot team at pdmfc dot com for an account).
- DSU Explorer - debug tool to explore DSUs anchored on the blockchain (Re-used from ePi).
Wallets do not communicate yet, so nothing done on one wallet is visible on other wallets.
Milestones achieved on this release, compared to the plan ....docx:
- M1 OpenDSU Solution Concept Complete - using ePi unchanged - work in progress.
- M2 Development Environment Setup Complete - complete 100% - development environment available at https://acdc-dev.pharmaledger.pdmfc.com/.
- M3 Business Test Environment Setup Complete - complete 100% - environment available at https://acdc.pharmaledger.pdmfc.com/.
- M4 ACDC Backoffice Web Application Concet Setup - REST service to upload and download scan events available for experimentation.
PDM welcomes technical contributions at https://github.com/PharmaLedger-IMI/acdc-workspace


In this example we're using the showWhen directive to decide whether to show an icon based on the platform.
showWhen


Seisplotjs
-
Gallery
Earthquake query:
<sp-earthquake-search>
Query
Generated with
Seisplotjs version
3
.


{{ partial "foot/extensions.html" . }} {{ partial "foot/custom.html" . }} {{ partial "resources/js.html" . }} {{ partial "foot/js.html" . }}


This site is still under construction!
Hello, I’m Annette Jing, or 靖婕勛 (pronounced Jing Jie-Shiun) in Mandarin Chinese. I'm a 3rd year Statistics PhD student advised by Professor Tze Leung Lai.
Before that, I received my bachelors degree in Finance with double minors in Mathematics and Computer Science from National Taiwan University (NTU).
I am also an alumnus of LSE’s General Course program and it was an econometrics course I took there that helped me discover my interest for statistics.
In my spare time, I like going to rock and metal concerts, draw, travel, and watch TV shows and animes. For more details, you can check out my Interests page.


|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
| Interface Summary | |
| Node | All AST nodes must implement this interface. |
| ParserVisitor |
| Class Summary | |
| AbstractExecutor | Abstract class that is used to execute an arbitrary method that is in introspected. |
| ASTAddNode | |
| ASTAndNode | Please look at the Parser.jjt file which is what controls the generation of this class. |
| ASTAssignment | |
| ASTBlock | |
| ASTComment | Represents all comments... |
| ASTDirective | This class is responsible for handling the pluggable directives in VTL. |
| ASTDivNode | Handles integer division of nodes Please look at the Parser.jjt file which is what controls the generation of this class. |
| ASTElseIfStatement | This class is responsible for handling the ElseIf VTL control statement. |
| ASTElseStatement | This class is responsible for handling the Else VTL control statement. |
| ASTEQNode | Handles the equivalence operator
|
| ASTEscape | This class is responsible for handling Escapes in VTL. |
| ASTEscapedDirective | This class is responsible for handling EscapedDirectives in VTL. |
| ASTExpression | |
| ASTFalse | |
| ASTGENode | |
| ASTGTNode | |
| ASTIdentifier | ASTIdentifier.java Method support for identifiers : $foo mainly used by ASTRefrence Introspection is now moved to 'just in time' or at render / execution time. |
| ASTIfStatement | |
| ASTIncludeStatement | |
| ASTIntegerRange | |
| ASTLENode | |
| ASTLTNode | |
| ASTMethod | ASTMethod.java Method support for references : $foo.method() NOTE : introspection is now done at render time. |
| ASTModNode | |
| ASTMulNode | Handles integer multiplication Please look at the Parser.jjt file which is what controls the generation of this class. |
| ASTNENode | |
| ASTNotNode | |
| ASTNumberLiteral | |
| ASTObjectArray | |
| ASTOrNode | Please look at the Parser.jjt file which is what controls the generation of this class. |
| ASTParameters | |
| ASTprocess | |
| ASTReference | This class is responsible for handling the references in VTL ($foo). |
| ASTSetDirective | Node for the #set directive |
| ASTStringLiteral | ASTStringLiteral support. |
| ASTSubtractNode | Handles integer subtraction of nodes (in #set() ) Please look at the Parser.jjt file which is what controls the generation of this class. |
| ASTText | |
| ASTTrue | |
| ASTVariable | |
| ASTWord | |
| BooleanPropertyExecutor | Handles discovery and valuation of a
boolean object property, of the
form public boolean is |
| GetExecutor | Executor that simply tries to execute a get(key) operation. |
| NodeUtils | Utilities for dealing with the AST node structure. |
| PropertyExecutor | Returned the value of object property when executed. |
| SimpleNode |
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


{{partial "header.html" . }}
We've heard legends of this page since we were young, but no one has ever seen it; some question whether it even exists. Those who refused to give up searching fell to madness, hearing the same number over and over in their restless sleep. For years we tried to decipher the number, to unlock whatever hidden meaning lie within, but we still have nothing.