KDL
1.4.0
|
represents rotations in 3 dimensional space. More...
#include <src/frames.hpp>
Public Member Functions | |
Rotation () | |
Rotation (double Xx, double Yx, double Zx, double Xy, double Yy, double Zy, double Xz, double Yz, double Zz) | |
Rotation (const Vector &x, const Vector &y, const Vector &z) | |
Rotation & | operator= (const Rotation &arg) |
Vector | operator* (const Vector &v) const |
Defines a multiplication R*V between a Rotation R and a Vector V. More... | |
double & | operator() (int i, int j) |
Access to elements 0..2,0..2, bounds are checked when NDEBUG is not set. More... | |
double | operator() (int i, int j) const |
Access to elements 0..2,0..2, bounds are checked when NDEBUG is not set. More... | |
void | SetInverse () |
Sets the value of *this to its inverse. More... | |
Rotation | Inverse () const |
Gives back the inverse rotation matrix of *this. More... | |
Vector | Inverse (const Vector &v) const |
The same as R.Inverse()*v but more efficient. More... | |
Wrench | Inverse (const Wrench &arg) const |
The same as R.Inverse()*arg but more efficient. More... | |
Twist | Inverse (const Twist &arg) const |
The same as R.Inverse()*arg but more efficient. More... | |
void | DoRotX (double angle) |
The DoRot... More... | |
void | DoRotY (double angle) |
The DoRot... More... | |
void | DoRotZ (double angle) |
The DoRot... More... | |
Vector | GetRot () const |
Returns a vector with the direction of the equiv. More... | |
double | GetRotAngle (Vector &axis, double eps=epsilon) const |
Returns the rotation angle around the equiv. More... | |
void | GetEulerZYZ (double &alpha, double &beta, double &gamma) const |
Gives back the EulerZYZ convention description of the rotation matrix : First rotate around Z with alpha, then around the new Y with beta, then around new Z with gamma. More... | |
void | GetQuaternion (double &x, double &y, double &z, double &w) const |
Get the quaternion of this matrix. More... | |
void | GetRPY (double &roll, double &pitch, double &yaw) const |
Gives back a vector in RPY coordinates, variables are bound by. More... | |
void | GetEulerZYX (double &Alfa, double &Beta, double &Gamma) const |
GetEulerZYX gets the euler ZYX parameters of a rotation : First rotate around Z with alfa, then around the new Y with beta, then around new X with gamma. More... | |
Twist | operator* (const Twist &arg) const |
Transformation of the base to which the twist is expressed. More... | |
Wrench | operator* (const Wrench &arg) const |
Transformation of the base to which the wrench is expressed. More... | |
Vector | UnitX () const |
Access to the underlying unitvectors of the rotation matrix. More... | |
void | UnitX (const Vector &X) |
Access to the underlying unitvectors of the rotation matrix. More... | |
Vector | UnitY () const |
Access to the underlying unitvectors of the rotation matrix. More... | |
void | UnitY (const Vector &X) |
Access to the underlying unitvectors of the rotation matrix. More... | |
Vector | UnitZ () const |
Access to the underlying unitvectors of the rotation matrix. More... | |
void | UnitZ (const Vector &X) |
Access to the underlying unitvectors of the rotation matrix. More... | |
Static Public Member Functions | |
static Rotation | Identity () |
Gives back an identity rotaton matrix. More... | |
static Rotation | RotX (double angle) |
The Rot... static functions give the value of the appropriate rotation matrix back. More... | |
static Rotation | RotY (double angle) |
The Rot... static functions give the value of the appropriate rotation matrix back. More... | |
static Rotation | RotZ (double angle) |
The Rot... static functions give the value of the appropriate rotation matrix back. More... | |
static Rotation | Rot (const Vector &rotvec, double angle) |
Along an arbitrary axes. More... | |
static Rotation | Rot2 (const Vector &rotvec, double angle) |
Along an arbitrary axes. rotvec should be normalized. More... | |
static Rotation | EulerZYZ (double Alfa, double Beta, double Gamma) |
Gives back a rotation matrix specified with EulerZYZ convention : More... | |
static Rotation | Quaternion (double x, double y, double z, double w) |
Gives back a rotation matrix specified with Quaternion convention the norm of (x,y,z,w) should be equal to 1. More... | |
static Rotation | RPY (double roll, double pitch, double yaw) |
Gives back a rotation matrix specified with RPY convention: first rotate around X with roll, then around the old Y with pitch, then around old Z with yaw. More... | |
static Rotation | EulerZYX (double Alfa, double Beta, double Gamma) |
EulerZYX constructs a Rotation from the Euler ZYX parameters: More... | |
Public Attributes | |
double | data [9] |
Friends | |
class | Frame |
Rotation | operator* (const Rotation &lhs, const Rotation &rhs) |
bool | Equal (const Rotation &a, const Rotation &b, double eps) |
do not use operator == because the definition of Equal(.,.) is slightly different. More... | |
bool | operator== (const Rotation &a, const Rotation &b) |
The literal equality operator==(), also identical. More... | |
bool | operator!= (const Rotation &a, const Rotation &b) |
The literal inequality operator!=() More... | |
represents rotations in 3 dimensional space.
This class represents a rotation matrix with the following conventions :
Suppose V2 = R*V, (1) V is expressed in frame B V2 is expressed in frame A This matrix R consists of 3 columns [ X,Y,Z ], X,Y, and Z contain the axes of frame B, expressed in frame A Because of linearity expr(1) is valid.
This class only represents rotational_interpolation, not translation Two interpretations are possible for rotation angles. if you rotate with angle around X frame A to have frame B, then the result of SetRotX is equal to frame B expressed wrt A. In code:
Rotation R; F_A_B = R.SetRotX(angle);
Secondly, if you take the following code :
Vector p,p2; Rotation R; R.SetRotX(angle); p2 = R*p;
then the frame p2 is rotated around X axis with (-angle). Analogue reasonings can be applyd to SetRotY,SetRotZ,SetRot
|
inline |
References Identity(), KDL::Vector::Rotation, KDL::Vector::x(), KDL::Vector::y(), and KDL::Vector::z().
|
inline |
|
inline |
The DoRot...
functions apply a rotation R to *this,such that *this = *this * Rot.. DoRot... functions are only defined when they can be executed more efficiently
|
inline |
The DoRot...
functions apply a rotation R to *this,such that *this = *this * Rot.. DoRot... functions are only defined when they can be executed more efficiently
|
inline |
The DoRot...
functions apply a rotation R to *this,such that *this = *this * Rot.. DoRot... functions are only defined when they can be executed more efficiently
|
inlinestatic |
EulerZYX constructs a Rotation from the Euler ZYX parameters:
Closely related to RPY-convention.
Invariants:
Referenced by KDL::operator>>().
|
static |
Gives back a rotation matrix specified with EulerZYZ convention :
EulerZYX(alpha,beta,gamma) == EulerZYX(alpha +/- PHI, -beta, gamma +/- PI)
Referenced by KDL::operator>>().
|
inline |
GetEulerZYX gets the euler ZYX parameters of a rotation : First rotate around Z with alfa, then around the new Y with beta, then around new X with gamma.
Range of the results of GetEulerZYX :
if beta == PI/2 or beta == -PI/2, multiple solutions for gamma and alpha exist. The solution where gamma==0 is chosen.
Invariants:
Closely related to RPY-convention.
Referenced by KDL::operator<<().
void KDL::Rotation::GetEulerZYZ | ( | double & | alpha, |
double & | beta, | ||
double & | gamma | ||
) | const |
Gives back the EulerZYZ convention description of the rotation matrix : First rotate around Z with alpha, then around the new Y with beta, then around new Z with gamma.
Variables are bound by:
if beta==0 or beta==PI, then alpha and gamma are not unique, in this case gamma is chosen to be zero. Invariants:
void KDL::Rotation::GetQuaternion | ( | double & | x, |
double & | y, | ||
double & | z, | ||
double & | w | ||
) | const |
Get the quaternion of this matrix.
Vector KDL::Rotation::GetRot | ( | ) | const |
Returns a vector with the direction of the equiv.
axis and its norm is angle
References GetRotAngle().
double KDL::Rotation::GetRotAngle | ( | Vector & | axis, |
double | eps = epsilon |
||
) | const |
Returns the rotation angle around the equiv.
axis
axis | the rotation axis is returned in this variable |
eps | : in the case of angle == 0 : rot axis is undefined and chosen to be +/- Z-axis in the case of angle == PI : 2 solutions, positive Z-component of the axis is chosen. |
axis
axis | the rotation axis is returned in this variable |
eps | : in the case of angle == 0 : rot axis is undefined and chosen to be the Z-axis in the case of angle == PI : 2 solutions, positive Z-component of the axis is chosen. |
References KDL::Vector::Normalize().
Referenced by GetRot(), and KDL::RotationalInterpolation_SingleAxis::SetStartEnd().
void KDL::Rotation::GetRPY | ( | double & | roll, |
double & | pitch, | ||
double & | yaw | ||
) | const |
Gives back a vector in RPY coordinates, variables are bound by.
-PI/2 <= PITCH <= PI/2
convention :
if pitch == PI/2 or pitch == -PI/2, multiple solutions for gamma and alpha exist. The solution where roll==0 is chosen.
Invariants:
Referenced by KDL::operator<<().
|
inlinestatic |
Gives back an identity rotaton matrix.
Referenced by KDL::operator>>(), and Rotation().
|
inline |
Gives back the inverse rotation matrix of *this.
Referenced by KDL::ChainIdSolver_Vereshchagin::downwards_sweep(), KDL::ChainIdSolver_Vereshchagin::initial_upwards_sweep(), KDL::ChainJntToJacDotSolver::JntToJacDot(), and KDL::RotationalInterpolation_SingleAxis::SetStartEnd().
The same as R.Inverse()*v but more efficient.
The same as R.Inverse()*arg but more efficient.
The same as R.Inverse()*arg but more efficient.
|
inline |
Access to elements 0..2,0..2, bounds are checked when NDEBUG is not set.
|
inline |
Access to elements 0..2,0..2, bounds are checked when NDEBUG is not set.
Transformation of the base to which the twist is expressed.
Complexity : 18M+12A
Transformation of the base to which the wrench is expressed.
Complexity : 18M+12A
|
static |
Gives back a rotation matrix specified with Quaternion convention the norm of (x,y,z,w) should be equal to 1.
Along an arbitrary axes.
It is not necessary to normalize rotvec. returns identity rotation matrix in the case that the norm of rotvec is to small to be used.
References KDL::Vector::Normalize(), and Rot2().
Referenced by KDL::operator>>(), and KDL::Path_Line::Path_Line().
Along an arbitrary axes. rotvec should be normalized.
Referenced by KDL::Joint::Joint(), KDL::RotationalInterpolation_SingleAxis::Pos(), KDL::Joint::pose(), and Rot().
|
inlinestatic |
The Rot... static functions give the value of the appropriate rotation matrix back.
Referenced by KDL::Joint::pose().
|
inlinestatic |
The Rot... static functions give the value of the appropriate rotation matrix back.
Referenced by KDL::Joint::pose().
|
inlinestatic |
The Rot... static functions give the value of the appropriate rotation matrix back.
Referenced by KDL::Joint::pose().
|
static |
Gives back a rotation matrix specified with RPY convention: first rotate around X with roll, then around the old Y with pitch, then around old Z with yaw.
Invariants:
Referenced by KDL::operator>>().
|
inline |
Sets the value of *this to its inverse.
|
inline |
Access to the underlying unitvectors of the rotation matrix.
References KDL::Vector::Vector().
|
inline |
Access to the underlying unitvectors of the rotation matrix.
|
inline |
Access to the underlying unitvectors of the rotation matrix.
References KDL::Vector::Vector().
Referenced by KDL::Path_Circle::Clone(), and KDL::Path_Circle::Write().
|
inline |
Access to the underlying unitvectors of the rotation matrix.
|
inline |
Access to the underlying unitvectors of the rotation matrix.
References KDL::Vector::Vector().
|
inline |
Access to the underlying unitvectors of the rotation matrix.
do not use operator == because the definition of Equal(.,.) is slightly different.
It compares whether the 2 arguments are equal in an eps-interval
|
friend |
The literal inequality operator!=()
The literal equality operator==(), also identical.
double KDL::Rotation::data[9] |
Referenced by KDL::Equal(), KDL::operator*(), and KDL::operator==().