rbd::Joint Class Reference

#include <RBDyn/RBDyn/Joint.h>

Public Types

enum  Type {
  Rev, Prism, Spherical, Planar,
  Cylindrical, Free, Fixed
}
 Joint type. More...
 
enum  OldType {
  RevX, RevY, RevZ, PrismX,
  PrismY, PrismZ
}
 Old joint type for Api compatibility. More...
 

Public Member Functions

 Joint ()
 
 Joint (OldType type, bool forward, std::string name)
 
 Joint (Type type, const Eigen::Vector3d &axis, bool forward, std::string name)
 
 Joint (Type type, bool forward, std::string name)
 
 Joint (std::string name)
 
void makeMimic (const std::string &name, double multiplier, double offset)
 
Type type () const
 
double direction () const
 
bool forward () const
 
void forward (bool forward)
 
int params () const
 
int dof () const
 
const std::string & name () const
 
bool isMimic () const
 
const std::string & mimicName () const
 
double mimicMultiplier () const
 
double mimicOffset () const
 
const Eigen::Matrix< double, 6, Eigen::Dynamic > & motionSubspace () const
 
template<typename T >
sva::PTransform< T > pose (const std::vector< T > &q) const
 
sva::MotionVecd motion (const std::vector< double > &alpha) const
 
sva::MotionVecd tanAccel (const std::vector< double > &alphaD) const
 
std::vector< double > zeroParam () const
 
std::vector< double > zeroDof () const
 
sva::PTransformd sPose (const std::vector< double > &q) const
 
sva::MotionVecd sMotion (const std::vector< double > &alpha) const
 
sva::MotionVecd sTanAccel (const std::vector< double > &alphaD) const
 
bool operator== (const Joint &b) const
 
bool operator!= (const Joint &b) const
 

Static Public Member Functions

static std::vector< double > ZeroParam (Type type)
 
static std::vector< double > ZeroDof (Type type)
 

Detailed Description

Joint representation. Hold joint name (used as identifier) and compute transformation, speed and motion subspace. WARNING : Free joint translation parameters are in FP coordinate (Example 4.5 p81).

Member Enumeration Documentation

◆ OldType

Old joint type for Api compatibility.

Enumerator
RevX 

Revolute joint about X axis.

RevY 

Revolute joint about Y axis.

RevZ 

Revolute joint about Z axis.

PrismX 

Prismatique joint about X axis.

PrismY 

Prismatique joint about Y axis.

PrismZ 

Prismatique joint about Z axis.

◆ Type

Joint type.

Enumerator
Rev 

Revolute joint about an user specified axis.

Prism 

Prismatic joint about an user specified axis.

Spherical 

Spherical joint, represented by a quaternion.

Planar 

Planar joint (2 prismatic(X, Y) and 1 revolute(Z)).

Cylindrical 

Cylindrical joint (Z prismatic, Z revolute).

Free 

Free joint, represented by a quaternion.

Fixed 

Fixed joint.

Constructor & Destructor Documentation

◆ Joint() [1/5]

rbd::Joint::Joint ( )
inline

◆ Joint() [2/5]

rbd::Joint::Joint ( OldType  type,
bool  forward,
std::string  name 
)
inline

Compatibility constructor

Parameters
typeJoint type.
forwardJoint is in forward direction if true.
nameJoint name, must be unique in a multibody.

◆ Joint() [3/5]

rbd::Joint::Joint ( Type  type,
const Eigen::Vector3d &  axis,
bool  forward,
std::string  name 
)
inline
Parameters
typeJoint type.
axisUser specified.
forwardJoint is in forward direction if true.
nameJoint name must be unique in a multibody.

◆ Joint() [4/5]

rbd::Joint::Joint ( Type  type,
bool  forward,
std::string  name 
)
inline
Parameters
typeJoint type.
forwardJoint is in forward direction if true.
nameJoint name, must be unique in a multibody.

◆ Joint() [5/5]

rbd::Joint::Joint ( std::string  name)
inline

Creates a fixed joint

Parameters
nameJoint name, must be unique in a multibody.

Member Function Documentation

◆ direction()

double rbd::Joint::direction ( ) const
inline
Returns
Joint direction.

◆ dof()

int rbd::Joint::dof ( ) const
inline

Number of degree of freedom of the joint.

Returns
Number of generalized speed and acceleration variable.

◆ forward() [1/2]

bool rbd::Joint::forward ( ) const
inline
Returns
true if joint is forward, else false.

◆ forward() [2/2]

void rbd::Joint::forward ( bool  forward)
inline
Parameters
forwardPut the joint in forward direction if true.

◆ isMimic()

bool rbd::Joint::isMimic ( ) const
inline
Returns
True if the joint is a mimic joint

◆ makeMimic()

void rbd::Joint::makeMimic ( const std::string &  name,
double  multiplier,
double  offset 
)
inline

Make the joint mimic and specify mimic information.

This change cannot be reversed.

Parameters
nameName of the joint that will be mimiced.
multiplierMimic multiplier
offsetMimic offset

◆ mimicMultiplier()

double rbd::Joint::mimicMultiplier ( ) const
inline
Returns
Mimic multiplier

◆ mimicName()

const std::string& rbd::Joint::mimicName ( ) const
inline
Returns
Mimiced name

◆ mimicOffset()

double rbd::Joint::mimicOffset ( ) const
inline
Returns
Mimic offset

◆ motion()

sva::MotionVecd rbd::Joint::motion ( const std::vector< double > &  alpha) const
inline

Compute the joint velocity.

Parameters
alphavector of generalized speed variable.
Returns
Spatial motion vector of the joint.

◆ motionSubspace()

const Eigen::Matrix<double, 6, Eigen::Dynamic>& rbd::Joint::motionSubspace ( ) const
inline
Returns
Joint motion subspace in successor frame coordinate.

◆ name()

const std::string& rbd::Joint::name ( ) const
inline
Returns
Joint name.

◆ operator!=()

bool rbd::Joint::operator!= ( const Joint b) const
inline

◆ operator==()

bool rbd::Joint::operator== ( const Joint b) const
inline

◆ params()

int rbd::Joint::params ( ) const
inline

Number of parameters of the joint.

Returns
Number of generalized position variable.

◆ pose()

template<typename T >
sva::PTransform< T > rbd::Joint::pose ( const std::vector< T > &  q) const
inline

Compute the joint transformation from predecessor to successor frame.

Parameters
qvector of generalized position variable.
Returns
Spatial transformation from predecessor to successor frame.

◆ sMotion()

sva::MotionVecd rbd::Joint::sMotion ( const std::vector< double > &  alpha) const
inline

Safe version of motion method.

See also
motion
Exceptions
std::domain_errorIf the number of generalized speed variable is wrong.

◆ sPose()

sva::PTransformd rbd::Joint::sPose ( const std::vector< double > &  q) const
inline

Safe version of pose method.

See also
pose
Exceptions
std::domain_errorIf the number of generalized position variable is wrong.

◆ sTanAccel()

sva::MotionVecd rbd::Joint::sTanAccel ( const std::vector< double > &  alphaD) const
inline

Safe version of tanAccel method.

See also
tanAccel
Exceptions
std::domain_errorIf the number of generalized acceleration variable is wrong.

◆ tanAccel()

sva::MotionVecd rbd::Joint::tanAccel ( const std::vector< double > &  alphaD) const
inline

Compute the tangential part of the acceleration S*alphaD.

Parameters
alphaDvector of generalized acceleration variable.
Returns
Tangential part of acceleration

◆ type()

Type rbd::Joint::type ( ) const
inline
Returns
Joint type.

◆ zeroDof()

std::vector< double > rbd::Joint::zeroDof ( ) const
inline
Returns
Joint velocity at zero.

◆ ZeroDof()

std::vector< double > rbd::Joint::ZeroDof ( Type  type)
inlinestatic
Returns
Joint velocity at zero.

◆ zeroParam()

std::vector< double > rbd::Joint::zeroParam ( ) const
inline
Returns
Joint configuation at zero.

◆ ZeroParam()

std::vector< double > rbd::Joint::ZeroParam ( Type  type)
inlinestatic
Returns
Joint configuation at zero.

The documentation for this class was generated from the following file: