- 3.0.2 rigid body dynamics module.
RobCoGen commons

Macros

#define DScalar   typename Derived::Scalar
 

Functions

template<typename Derived >
Force< DScalariit::rbd::vxIv (const Velocity< DScalar > &v, const MatrixBase< Derived > &I)
 
template<typename Derived >
Force< DScalariit::rbd::vxIv (const DScalar &omegaz, const MatrixBase< Derived > &I)
 
template<typename S = double>
void iit::rbd::motionCrossProductMx (const Velocity< S > &v, Mat66< S > &vx)
 
template<typename S = double>
void iit::rbd::forceCrossProductMx (const Velocity< S > &v, Mat66< S > &vx)
 
template<typename S = double>
void iit::rbd::fillInertia (S mass, const Vec3< S > &com, const internal::SymmMat3x3Coefficients< S > &I3x3, InertiaMat< S > &I)
 
template<typename Scalar = double>
void iit::rbd::transformInertia (const InertiaMat< Scalar > &I_A, const Mat66< Scalar > &XF, InertiaMat< Scalar > &I_B)
 

Articulated inertia - Coordinate transform

These functions perform the coordinate transform of a spatial articulated inertia, in the special case of a mass-less handle (see chapter 7 of the RBDA book, §7.2.2, equation 7.23)

Two specialized functions are available for the two cases of revolute and prismatic joint (which connects the subtree with the mass-less handle), since the inertia exhibits two different sparsity patterns.

Parameters
Ia_Athe articulated inertia in A coordinates
XMa spatial coordinate transform for motion vectors, in the form A_XM_B (that is, mapping forces from A to B coordinates)
[out]Ia_B_constthe same articulated inertia, but expressed in B coordinates. Note that the constness is casted away (trick required with Eigen)
template<typename D1 , typename D2 , typename D3 >
void iit::rbd::ctransform_Ia_revolute (const MatrixBase< D1 > &Ia_A, const MatrixBase< D2 > &XM, const MatrixBase< D3 > &Ia_B_const)
 
template<typename D1 , typename D2 , typename D3 >
void iit::rbd::ctransform_Ia_prismatic (const MatrixBase< D1 > &Ia_A, const MatrixBase< D2 > &XM, const MatrixBase< D3 > &Ia_B_const)
 

Articulated inertia - Computation

These functions calculate the spatial articulated inertia of a subtree, in the special case of a mass-less handle (see chapter 7 of the RBDA book, §7.2.2, equation 7.23)

Two specialized functions are available for the two cases of revolute and prismatic joint (which connects the subtree with the mass-less handle), since the inertia exhibits two different sparsity patterns.

Parameters
IAthe regular articulated inertia of some subtree
Uthe U term for the current joint (cfr. eq. 7.43 of RBDA)
Dthe D term for the current joint (cfr. eq. 7.44 of RBDA)
[out]Ia_constthe articulated inertia for the same subtree, but propagated across the current joint. The matrix is assumed to be already initialized with zeros, at least in the row and column which is known to be zero. In other words, those elements are not computed nor assigned in this function. Note that the constness of the argument is casted away (trick required with Eigen), as this is an output argument.
template<typename D1 , typename D2 >
void iit::rbd::compute_Ia_revolute (const MatrixBase< D1 > &IA, const Vec6< typename D1::Scalar > &U, const typename D1::Scalar &D, const MatrixBase< D2 > &Ia_const)
 
template<typename D1 , typename D2 >
void iit::rbd::compute_Ia_prismatic (const MatrixBase< D1 > &IA, const Vec6< typename D1::Scalar > &U, const typename D1::Scalar &D, const MatrixBase< D2 > &Ia_const)
 

Detailed Description

Functions implementing some algebraic expressions recurring in the code generated by RobCoGen.

This implementation is usually a bit more efficient than the straightforward way of doing the same thing, with matrix algebra.

These functions were written specifically to be used within the code generated by RobCoGen; they expect parameters which have to satisfy maybe more constraints than one would expect from a public API. Similarly, no consistency checks are performed (e.g. verify that the matrix is 6x6).

Macro Definition Documentation

◆ DScalar

#define DScalar   typename Derived::Scalar

Referenced by iit::rbd::vxIv().

Function Documentation

◆ vxIv() [1/2]

template<typename Derived >
Force<DScalar> iit::rbd::vxIv ( const Velocity< DScalar > &  v,
const MatrixBase< Derived > &  I 
)

Calculates the bias force acting on a rigid body with the given velocity and inertial properties.

This function provides a hopefully efficient implementation of the term

\[ v \times^{*} I v \]

as described in Featherstone's book about rigid body dynamics algorithms.

Parameters
vthe spatial velocity of the body
Ithe spatial inertia tensor of the body
Returns
the spatial force acting on the body due to its own velocity; from another point of view, the force required not to produce any acceleration.

References iit::rbd::AX, iit::rbd::AY, iit::rbd::AZ, DScalar, iit::rbd::LX, iit::rbd::LY, iit::rbd::LZ, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::XX, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::XY, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::XZ, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::YY, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::YZ, and iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::ZZ.

Referenced by iit::testirb4600::dyn::tpl::InverseDynamics< TRAIT >::C_terms(), iit::TestHyQ::dyn::tpl::InverseDynamics< TRAIT >::C_terms_fully_actuated(), iit::testirb4600::dyn::tpl::ForwardDynamics< TRAIT >::fd(), and iit::testirb4600::dyn::tpl::InverseDynamics< TRAIT >::firstPass().

◆ vxIv() [2/2]

template<typename Derived >
Force<DScalar> iit::rbd::vxIv ( const DScalar omegaz,
const MatrixBase< Derived > &  I 
)
inline

Calculates the bias force in the special case in which the velocity is a pure rotation about the z axis.

See also
vxIv(const VelocityVector&, const InertiaMatrixDense&)
Parameters
omegazthe scalar rotation velocity about the z axis
Ithe spatial inertia tensor of the rigid body
Returns
see vxIv(const VelocityVector&, const InertiaMatrixDense&)

References iit::rbd::AX, iit::rbd::AY, iit::rbd::AZ, DScalar, iit::rbd::LX, iit::rbd::LY, and iit::rbd::LZ.

◆ motionCrossProductMx()

template<typename S = double>
void iit::rbd::motionCrossProductMx ( const Velocity< S > &  v,
Mat66< S > &  vx 
)
inline

Calculates the spatial cross product matrix, for motion vectors.

Parameters
vthe spatial velocity defining the cross product
[out]vxthe 6x6 matrix whose coefficients will be set; must be initialized with zeros (that is, this function does not assign the zero elements of the cross product matrix).
Template Parameters
thescalar type

References iit::rbd::AX, iit::rbd::AY, iit::rbd::AZ, iit::rbd::LX, iit::rbd::LY, and iit::rbd::LZ.

◆ forceCrossProductMx()

template<typename S = double>
void iit::rbd::forceCrossProductMx ( const Velocity< S > &  v,
Mat66< S > &  vx 
)
inline

Calculates the spatial cross product matrix, for force vectors.

Parameters
vthe spatial velocity defining the cross product
[out]vxthe 6x6 matrix whose coefficients will be set; must be initialized with zeros (that is, this function does not assign the zero elements of the cross product matrix).

References iit::rbd::AX, iit::rbd::AY, iit::rbd::AZ, iit::rbd::LX, iit::rbd::LY, and iit::rbd::LZ.

◆ fillInertia()

◆ transformInertia()

template<typename Scalar = double>
void iit::rbd::transformInertia ( const InertiaMat< Scalar > &  I_A,
const Mat66< Scalar > &  XF,
InertiaMat< Scalar > &  I_B 
)

Roto-translate a spatial inertia tensor.

This function is basically an optimized implementation of the formula to do a coordinate transform for a spatial inertia:

\[ XF \cdot I \cdot XF^T \]

(see equation 2.66 of the RBDA book)

Parameters
I_Athe spatial inertia tensor of a rigid body, expressed in reference frame A
XFa spatial coordinate transform for force vectors, in the form B_XF_A (that is, mapping forces from A to B coordinates)
[out]I_Bthe output tensor, expressing the same inertial properties with coordinates of frame B

References iit::rbd::AX, iit::rbd::AY, iit::rbd::AZ, iit::rbd::fillInertia(), iit::rbd::tpl::InertiaMatrixDense< SCALAR >::getMass(), iit::rbd::LX, iit::rbd::LY, iit::rbd::LZ, iit::rbd::X, iit::rbd::internal::Mat3x3Coefficients< Scalar >::XX, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::XX, iit::rbd::internal::Mat3x3Coefficients< Scalar >::XY, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::XY, iit::rbd::internal::Mat3x3Coefficients< Scalar >::XZ, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::XZ, iit::rbd::Y, iit::rbd::internal::Mat3x3Coefficients< Scalar >::YX, iit::rbd::internal::Mat3x3Coefficients< Scalar >::YY, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::YY, iit::rbd::internal::Mat3x3Coefficients< Scalar >::YZ, iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::YZ, iit::rbd::Z, iit::rbd::internal::Mat3x3Coefficients< Scalar >::ZX, iit::rbd::internal::Mat3x3Coefficients< Scalar >::ZY, iit::rbd::internal::Mat3x3Coefficients< Scalar >::ZZ, and iit::rbd::internal::SymmMat3x3Coefficients< Scalar >::ZZ.

Referenced by iit::testirb4600::dyn::tpl::JSIM< TRAIT >::update().

◆ ctransform_Ia_revolute()

◆ ctransform_Ia_prismatic()

◆ compute_Ia_revolute()

template<typename D1 , typename D2 >
void iit::rbd::compute_Ia_revolute ( const MatrixBase< D1 > &  IA,
const Vec6< typename D1::Scalar > &  U,
const typename D1::Scalar D,
const MatrixBase< D2 > &  Ia_const 
)

◆ compute_Ia_prismatic()

template<typename D1 , typename D2 >
void iit::rbd::compute_Ia_prismatic ( const MatrixBase< D1 > &  IA,
const Vec6< typename D1::Scalar > &  U,
const typename D1::Scalar D,
const MatrixBase< D2 > &  Ia_const 
)