spatial-dyn
Public Member Functions | Public Attributes | List of all members
spatial_dyn::RigidBody Class Reference

#include <rigid_body.h>

Public Member Functions

 RigidBody ()=default
 
 RigidBody (const std::string &name)
 
int id () const
 
void set_id (int id)
 
int id_parent () const
 
void set_id_parent (int id_parent)
 
const Eigen::Isometry3d & T_to_parent () const
 
template<typename Derived >
void set_T_to_parent (const Eigen::RotationBase< Derived, 3 > &ori_in_parent, const Eigen::Vector3d &pos_in_parent)
 
void set_T_to_parent (const Eigen::Isometry3d &T_to_parent)
 
const SpatialInertiadinertia () const
 
void set_inertia (double mass, const Eigen::Vector3d &com, const Eigen::Vector6d &I_com_flat)
 
void set_inertia (const SpatialInertiad &inertia)
 
const Jointjoint () const
 
void set_joint (const Joint &joint)
 

Public Attributes

std::string name
 
std::vector< Graphicsgraphics
 

Detailed Description

Rigid body struct for spatial_dyn.

Comprised of an articulated joint and the attached rigid body.

See also
Python: spatialdyn.RigidBody

Constructor & Destructor Documentation

◆ RigidBody() [1/2]

spatial_dyn::RigidBody::RigidBody ( )
default

Default constructor.

◆ RigidBody() [2/2]

spatial_dyn::RigidBody::RigidBody ( const std::string &  name)
inline

Constructor that sets the name of the rigid body.

Parameters
nameName of the rigid body.
See also
Python: spatialdyn.RigidBody.__init__()

Member Function Documentation

◆ id()

int spatial_dyn::RigidBody::id ( ) const
inline
Returns
ID of the rigid body as assigned by ArticulatedBody::AddRigidBody().
See also
Python: spatialdyn.RigidBody.id

◆ id_parent()

int spatial_dyn::RigidBody::id_parent ( ) const
inline
Returns
ID of the rigid body's parent as assigned by ArticulatedBody::AddRigidBody().
See also
Python: spatialdyn.RigidBody.id_parent

◆ inertia()

const SpatialInertiad& spatial_dyn::RigidBody::inertia ( ) const
inline
Returns
Spatial inertia of the rigid body. Defaults to a 1kg point mass at the origin of the rigid body's frame.
See also
Python: spatialdyn.RigidBody.inertia

◆ joint()

const Joint& spatial_dyn::RigidBody::joint ( ) const
inline
Returns
Joint attached to the rigid body.
See also
Python: spatialdyn.RigidBody.joint

◆ set_inertia() [1/2]

void spatial_dyn::RigidBody::set_inertia ( const SpatialInertiad inertia)

Set the spatial inertia of the rigid body.

Parameters
inertiaSpatial inertia of the rigid body.

◆ set_inertia() [2/2]

void spatial_dyn::RigidBody::set_inertia ( double  mass,
const Eigen::Vector3d &  com,
const Eigen::Vector6d &  I_com_flat 
)

Set the spatial inertia of the rigid body.

Parameters
massMass of the rigid body.
comCenter of mass of the rigid body.
I_com_flatInertia of the rigid body as a flat vector {I_xx, I_xy, I_xz, I_yy, I_yz, I_zz}`.

◆ set_joint()

void spatial_dyn::RigidBody::set_joint ( const Joint joint)
inline

Set the joint attached to the rigid body.

Parameters
jointJoint.

◆ set_T_to_parent() [1/2]

void spatial_dyn::RigidBody::set_T_to_parent ( const Eigen::Isometry3d &  T_to_parent)
inline

Set the fixed transform from the rigid body's frame to its parent's frame when the joint position is 0.

Parameters
T_to_parentTransform from the rigid body frame to its parent's frame.

◆ set_T_to_parent() [2/2]

template<typename Derived >
void spatial_dyn::RigidBody::set_T_to_parent ( const Eigen::RotationBase< Derived, 3 > &  ori_in_parent,
const Eigen::Vector3d &  pos_in_parent 
)
inline

Set the fixed transform from the rigid body's frame to its parent's frame when the joint position is 0.

Parameters
ori_in_parentOrientation of the rigid body in its parent's frame.
pos_in_parentPosition of the rigid body in its parent's frame.

◆ T_to_parent()

const Eigen::Isometry3d& spatial_dyn::RigidBody::T_to_parent ( ) const
inline
Returns
Fixed transform from the rigid body's frame to its parent's frame when the joint position is 0. Defaults to identity.
See also
Python: spatialdyn.RigidBody.T_to_parent

Member Data Documentation

◆ graphics

std::vector<Graphics> spatial_dyn::RigidBody::graphics
mutable

Graphics for the rigid body.

See also
Python: spatialdyn.RigidBody.graphics

◆ name

std::string spatial_dyn::RigidBody::name
mutable

Name of the rigid body for debugging purposes.

See also
Python: spatialdyn.RigidBody.name

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