Package org.robwork.sdurw
Class Transform3Dd
- java.lang.Object
-
- org.robwork.sdurw.Transform3Dd
-
public class Transform3Dd extends java.lang.Object
A 4x4 homogeneous transform matrix \mathbf{T}\in SE(3)
\mathbf{T} = \left[ \begin{array}{cc} \mathbf{R} \mathbf{d} \\ \begin{array}{ccc}0 0 0\end{array} 1 \end{array} \right]
-
-
Constructor Summary
Constructors Constructor Description Transform3Dd()
Default Constructor.
Initializes with 0 translation and Identity matrix as rotationTransform3Dd(long cPtr, boolean cMemoryOwn)
Transform3Dd(Rotation3Dd R)
A homogeneous transform with a rotation of R and a
translation of zero.Transform3Dd(Transform3Dd t3d)
Transform3Dd(Vector3Dd d)
A homogeneous transform with a rotation of zero and a
translation of d.Transform3Dd(Vector3Dd d, Rotation3Dd R)
Constructs a homogeneous transformTransform3Dd(Vector3Dd d, Rotation3DVectord r)
Constructs a homogeneous transform
Calling this constructor is equivalent to the transform
Transform3D(d, r.toRotation3D()).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Transform3Dd
craigDH(double alpha, double a, double d, double theta)
Constructs a homogeneous transform using the Craig (modified)
Denavit-Hartenberg notation
void
delete()
static Transform3Dd
DH(double alpha, double a, double d, double theta)
Constructs a homogeneous transform using the original
Denavit-Hartenberg notation
static Transform3Dd
DHHGP(double alpha, double a, double beta, double b)
Constructs a homogeneous transform using the Gordon (modified)
Denavit-Hartenberg notation
EigenMatrix4d
e()
Returns a Eigen 4x4 matrix \mathbf{M}\in SE(3) that represents this homogeneous transformation
boolean
equal(Transform3Dd t3d)
Compares the transformations with a given precision
Performs an element wise comparison.boolean
equal(Transform3Dd t3d, double precision)
Compares the transformations with a given precision
Performs an element wise comparison.boolean
equals(Transform3Dd rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
static long
getCPtr(Transform3Dd obj)
static Transform3Dd
identity()
Constructs the identity transformstatic Transform3Dd
invMult(Transform3Dd t1, Transform3Dd t2)
computes the inverse of t1 and multiplies it with t2.
The result is saved in t1.static Transform3Dd
makeLookAt(Vector3Dd eye, Vector3Dd center, Vector3Dd up)
creates a transformation that is positioned in eye and looking toward
center along -z where up indicates the upward direction along which the y-axis
is placed.Transform3Dd
multiply(Transform3Dd bTc)
Calculates \robabx{a}{c}{\mathbf{T}} = \robabx{a}{b}{\mathbf{T}} \robabx{b}{c}{\mathbf{T}}static void
multiply(Transform3Dd a, Transform3Dd b, Transform3Dd result)
Write to result the product a * b.Vector3Dd
multiply(Vector3Dd bP)
Calculates \robax{a}{\mathbf{p}} = \robabx{a}{b}{\mathbf{T}} \robax{b}{\mathbf{p}} thus transforming point \mathbf{p} from frame b
to frame aVector3Dd
P()
Gets the position part \mathbf{d} from \mathbf{T}Rotation3Dd
R()
Gets the rotation part \mathbf{R} from \mathbf{T}java.lang.String
toString()
-
-
-
Constructor Detail
-
Transform3Dd
public Transform3Dd(long cPtr, boolean cMemoryOwn)
-
Transform3Dd
public Transform3Dd()
Default Constructor.
Initializes with 0 translation and Identity matrix as rotation
-
Transform3Dd
public Transform3Dd(Transform3Dd t3d)
-
Transform3Dd
public Transform3Dd(Vector3Dd d, Rotation3Dd R)
Constructs a homogeneous transform- Parameters:
d
- [in] \mathbf{d} A 3x1 translation vectorR
- [in] \mathbf{R} A 3x3 rotation matrix
-
Transform3Dd
public Transform3Dd(Rotation3Dd R)
A homogeneous transform with a rotation of R and a
translation of zero.
-
Transform3Dd
public Transform3Dd(Vector3Dd d)
A homogeneous transform with a rotation of zero and a
translation of d.
-
Transform3Dd
public Transform3Dd(Vector3Dd d, Rotation3DVectord r)
Constructs a homogeneous transform
Calling this constructor is equivalent to the transform
Transform3D(d, r.toRotation3D()).
- Parameters:
d
- [in] A 3x1 translation vectorr
- [in] A 3x1 rotation vector
-
-
Method Detail
-
getCPtr
public static long getCPtr(Transform3Dd obj)
-
delete
public void delete()
-
DH
public static Transform3Dd DH(double alpha, double a, double d, double theta)
Constructs a homogeneous transform using the original
Denavit-Hartenberg notation
- Parameters:
alpha
- [in] \alpha_ia
- [in] a_id
- [in] d_itheta
- [in] \theta_i- Returns:
- ^{i-1}\mathbf{T}_i
\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\theta_i -s\theta_i c\alpha_i s\theta_i s\alpha_i a_i c\theta_i \\ s\theta_i c\theta_i c\alpha_i -c\theta_i s\alpha_i a_i s\theta_i \\ 0 s\alpha_i c\alpha_i d_i \\ 0 0 0 1 \end{array} \right]
-
craigDH
public static Transform3Dd craigDH(double alpha, double a, double d, double theta)
Constructs a homogeneous transform using the Craig (modified)
Denavit-Hartenberg notation
- Parameters:
alpha
- [in] \alpha_{i-1}a
- [in] a_{i-1}d
- [in] d_itheta
- [in] \theta_i- Returns:
- \robabx{i-1}{i}{\mathbf{T}}
Note: The Craig (modified) Denavit-Hartenberg notation differs from
the original Denavit-Hartenberg notation and is given as
\robabx{i-1}{i}{\mathbf{T}} = \left[ \begin{array}{cccc} c\theta_i -s\theta_i 0 a_{i-1} \\ s\theta_i c\alpha_{i-1} c\theta_i c\alpha_{i-1} -s\alpha_{i-1} -s\alpha_{i-1}d_i \\ s\theta_i s\alpha_{i-1} c\theta_i s\alpha_{i-1} c\alpha_{i-1} c\alpha_{i-1}d_i \\ 0 0 0 1 \end{array} \right]
-
DHHGP
public static Transform3Dd DHHGP(double alpha, double a, double beta, double b)
Constructs a homogeneous transform using the Gordon (modified)
Denavit-Hartenberg notation
- Parameters:
alpha
- [in] \alpha_ia
- [in] a_ibeta
- [in] \beta_ib
- [in] b_i- Returns:
- ^{i-1}\mathbf{T}_i
Note: The Gordon (modified) Denavit-Hartenberg differs from
the original Denavit-Hartenberg as it branches between parallel
and non-parallel z-axes.
z_{i-1} is close to parallel to z_i
\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\beta_i s\alpha_i s\beta_i c\alpha_i s\beta_i a_i c\beta_i \\ 0 c\alpha_i -s\alpha_i b_i \\ -s\beta_i s\alpha_i c\beta_i c\alpha_i c\beta_i -a_i s\beta \\ 0 0 0 1 \end{array} \right]
-
identity
public static Transform3Dd identity()
Constructs the identity transform- Returns:
- the identity transform
\mathbf{T} = \left[ \begin{array}{cccc} 1 0 0 0\\ 0 1 0 0\\ 0 0 1 0\\ 0 0 0 1 \end{array} \right]
-
equals
public boolean equals(Transform3Dd rhs)
Comparison operator.
The comparison operator makes a element wise comparison.
Returns true only if all elements are equal.
- Parameters:
rhs
- [in] Transform to compare with- Returns:
- True if equal.
-
equal
public boolean equal(Transform3Dd t3d, double precision)
Compares the transformations with a given precision
Performs an element wise comparison. Two elements are considered equal if the difference
are less than precision.
- Parameters:
t3d
- [in] Transform to compare withprecision
- [in] The precision to use for testing- Returns:
- True if all elements are less than precision apart.
-
equal
public boolean equal(Transform3Dd t3d)
Compares the transformations with a given precision
Performs an element wise comparison. Two elements are considered equal if the difference
are less than precision.
- Parameters:
t3d
- [in] Transform to compare with
- Returns:
- True if all elements are less than precision apart.
-
multiply
public Transform3Dd multiply(Transform3Dd bTc)
Calculates \robabx{a}{c}{\mathbf{T}} = \robabx{a}{b}{\mathbf{T}} \robabx{b}{c}{\mathbf{T}}- Parameters:
bTc
- [in] \robabx{b}{c}{\mathbf{T}}- Returns:
- \robabx{a}{c}{\mathbf{T}}
\robabx{a}{c}{\mathbf{T}} = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}}\robabx{b}{c}{\mathbf{R}} \robabx{a}{b}{\mathbf{d}} + \robabx{a}{b}{\mathbf{R}}\robabx{b}{c}{\mathbf{d}} \\ \begin{array}{ccc}0 0 0\end{array} 1 \end{array} \right]
-
multiply
public Vector3Dd multiply(Vector3Dd bP)
Calculates \robax{a}{\mathbf{p}} = \robabx{a}{b}{\mathbf{T}} \robax{b}{\mathbf{p}} thus transforming point \mathbf{p} from frame b
to frame a- Parameters:
bP
- [in] \robax{b}{\mathbf{p}}- Returns:
- \robax{a}{\mathbf{p}}
-
R
public Rotation3Dd R()
Gets the rotation part \mathbf{R} from \mathbf{T}- Returns:
- \mathbf{R}
-
P
public Vector3Dd P()
Gets the position part \mathbf{d} from \mathbf{T}- Returns:
- \mathbf{d}
-
multiply
public static void multiply(Transform3Dd a, Transform3Dd b, Transform3Dd result)
Write to result the product a * b.
-
invMult
public static Transform3Dd invMult(Transform3Dd t1, Transform3Dd t2)
computes the inverse of t1 and multiplies it with t2.
The result is saved in t1. t1 = inv(t1) * t2
-
makeLookAt
public static Transform3Dd makeLookAt(Vector3Dd eye, Vector3Dd center, Vector3Dd up)
creates a transformation that is positioned in eye and looking toward
center along -z where up indicates the upward direction along which the y-axis
is placed. Same convention as for gluLookAt
and is handy for placing a cameraview.
- Parameters:
eye
- [in] position of viewcenter
- [in] point to look towardup
- [in] the upward direction (the
- Returns:
- Transformation
-
e
public EigenMatrix4d e()
Returns a Eigen 4x4 matrix \mathbf{M}\in SE(3) that represents this homogeneous transformation
- Returns:
- \mathbf{M}\in SE(3)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-