AUTh-ARL Core Stack
0.7
|
Math related to orientation calculations. More...
Functions | |
EIGEN_DEVICE_FUNC | Quaternion (const arma::vec &arma) |
Constructor of Eigen Quaternion with armadillo vector in [w, x, y, z]. More... | |
template<class OtherDerived > | |
EIGEN_DEVICE_FUNC Matrix < Scalar, 3, 1 > | error (const QuaternionBase< OtherDerived > &desired) const |
Returns the orientation error between two quaternions. More... | |
arma::vec | arl::math::getOrientationError (const arma::vec &q, const arma::vec &qd) |
Returns the orientation error between two quaternions using Armadillo. More... | |
KDL::Vector | arl::math::getOrientationError (const std::vector< double > &quat, const std::vector< double > &quat_d) |
Calculate the orientation error between two quaternions using STL and KDL. More... | |
arma::mat | arl::math::quatToRot (const arma::vec &q) |
Transforms a quaternion to a rotation matrix. More... | |
arma::vec | arl::math::rotToQuat (const arma::mat &R) |
Transforms a rotation matrix to a quaternion. More... | |
arma::vec | arl::math::getQuatConjugate (const arma::vec &q) |
Calculates the quaternion conjugate. More... | |
arma::vec | arl::math::getQuatInverse (const arma::vec &q) |
Calculates the inverse of a given quaternion. More... | |
arma::vec | arl::math::getQuatProduct (const arma::vec &q1, const arma::vec &q2) |
Calculates the product of two quaternions. More... | |
arma::vec | arl::math::getQuatDifference (const arma::vec &q, const arma::vec &qd) |
Calculates the difference of two quaternions. More... | |
arma::vec | arl::math::rotateQuat (const arma::vec &w, const arma::vec &q) |
Integrates the orientation in quaternion. More... | |
arma::vec | arl::math::getQuatLog (const arma::vec &Q, double eps=std::numeric_limits< double >::epsilon()) |
Calculate the log of a quaternion. More... | |
arma::vec | arl::math::getQuatExp (const arma::vec &w, double eps=std::numeric_limits< double >::epsilon()) |
Calculate the exp of a quaternion. More... | |
bool | arl::math::rotationHasUnitColumns (const KDL::Rotation &rot, double eps=1e-8) |
Tests if the columns of the rotation matrix are unit vectors. More... | |
bool | arl::math::rotationHasOrthogonalColumns (const KDL::Rotation &rot, double eps=1e-8) |
Tests if the columns of the rotation matrix are orthogonal. More... | |
bool | arl::math::rotationIsRightHanded (const KDL::Rotation &rot, double eps=1e-8) |
Tests if the columns of the rotation matrix form a right handed system. More... | |
bool | arl::math::rotationIsOk (const KDL::Rotation &rot, double eps=1e-8) |
Tests if a 3x3 matrix R is a legit rotation matrix, i.e. if R belongs to SO(3). More... | |
arma::mat | arl::math::rotX (double theta) |
Provides the basic rotation around the X-axis. More... | |
arma::mat | arl::math::rotY (double theta) |
Provides the basic rotation around the Y-axis. More... | |
arma::mat | arl::math::rotZ (double theta) |
Provides the basic rotation around the Z-axis. More... | |
Math related to orientation calculations.
|
inline |
Returns the orientation error between two quaternions.
The returned quaternion error is given by Eq. 3.91 at p. 140 of book "Robotics: Modelling, Planning and Control of Siciliano", with different sequence.
desired | The desired quaternion |
,
arma::vec arl::math::getOrientationError | ( | const arma::vec & | q, |
const arma::vec & | qd | ||
) |
Returns the orientation error between two quaternions using Armadillo.
The quaternions are following the convention w, x, y, z. The returned quaternion error is given by Eq. 3.91 at p. 140 of book "Robotics: Modelling, Planning and Control of Siciliano", with different sequence.
q | The current orientation |
qd | The desired orientation |
KDL::Vector arl::math::getOrientationError | ( | const std::vector< double > & | quat, |
const std::vector< double > & | quat_d | ||
) |
Calculate the orientation error between two quaternions using STL and KDL.
The quaternions are following the convention w, x, y, z. The returned quaternion error is given by Eq. 3.91 at p. 140 of book "Robotics: Modelling, Planning and Control of Siciliano", with different sequence.
quat | The current orientation |
quat_d | The desired orientation |
arma::vec arl::math::getQuatConjugate | ( | const arma::vec & | q | ) |
Calculates the quaternion conjugate.
The quaternions as input and output follows the convention w, x, y, z
q | The given quaternion. |
arma::vec arl::math::getQuatDifference | ( | const arma::vec & | q, |
const arma::vec & | qd | ||
) |
Calculates the difference of two quaternions.
The quaternions as input and output follows the convention w, x, y, z
q | Quaternion input 1 |
qd | Quaternion input 2 |
arma::vec arl::math::getQuatExp | ( | const arma::vec & | w, |
double | eps = std::numeric_limits<double>::epsilon() |
||
) |
Calculate the exp of a quaternion.
w | The angular velocity |
arma::vec arl::math::getQuatInverse | ( | const arma::vec & | q | ) |
Calculates the inverse of a given quaternion.
The quaternions as input and output follows the convention w, x, y, z
q | The given quaternion |
arma::vec arl::math::getQuatLog | ( | const arma::vec & | Q, |
double | eps = std::numeric_limits<double>::epsilon() |
||
) |
Calculate the log of a quaternion.
arma::vec arl::math::getQuatProduct | ( | const arma::vec & | q1, |
const arma::vec & | q2 | ||
) |
Calculates the product of two quaternions.
The quaternions as input and output follows the convention w, x, y, z
q1 | Quaternion input 1 |
q1 | Quaternion input 2 |
|
inline |
Constructor of Eigen Quaternion with armadillo vector in [w, x, y, z].
arma The quaternion in the arma vector
,
arma::mat arl::math::quatToRot | ( | const arma::vec & | q | ) |
Transforms a quaternion to a rotation matrix.
The quaternion should be given following the convention: w, x, y, z
q | The quaternion to be transformed |
arma::vec arl::math::rotateQuat | ( | const arma::vec & | w, |
const arma::vec & | q | ||
) |
Integrates the orientation in quaternion.
w | The angular deviation |
q | The current quaternion in w, x, y, z |
bool arl::math::rotationHasOrthogonalColumns | ( | const KDL::Rotation & | rot, |
double | eps = 1e-8 |
||
) |
Tests if the columns of the rotation matrix are orthogonal.
rot | The rotation matrix to be tested |
eps | Parameter for the tolerances to rounding errors |
bool arl::math::rotationHasUnitColumns | ( | const KDL::Rotation & | rot, |
double | eps = 1e-8 |
||
) |
Tests if the columns of the rotation matrix are unit vectors.
rot | The rotation matrix to be tested |
eps | Parameter for the tolerances to rounding errors |
bool arl::math::rotationIsOk | ( | const KDL::Rotation & | rot, |
double | eps = 1e-8 |
||
) |
Tests if a 3x3 matrix R is a legit rotation matrix, i.e. if R belongs to SO(3).
This function tests if the columns of the rotation matrix:
rot | The rotation matrix to be tested |
eps | Parameter for the tolerances to rounding errors |
bool arl::math::rotationIsRightHanded | ( | const KDL::Rotation & | rot, |
double | eps = 1e-8 |
||
) |
Tests if the columns of the rotation matrix form a right handed system.
rot | The rotation matrix to be tested |
eps | Parameter for the tolerances to rounding errors |
arma::vec arl::math::rotToQuat | ( | const arma::mat & | R | ) |
Transforms a rotation matrix to a quaternion.
The quaternion will returned following the convention: w, x, y, z
R | A 3x3 armadillo matrix as the rotation matrix |
arma::mat arl::math::rotX | ( | double | theta | ) |
Provides the basic rotation around the X-axis.
theta | The angle for the rotation in rad |
arma::mat arl::math::rotY | ( | double | theta | ) |
Provides the basic rotation around the Y-axis.
theta | The angle for the rotation in rad |
arma::mat arl::math::rotZ | ( | double | theta | ) |
Provides the basic rotation around the Z-axis.
theta | The angle for the rotation in rad |