Rigid Body Dynamics Library
RigidBodyDynamics::Utils Namespace Reference

Namespace that contains optional helper functions. More...

Functions

string get_dof_name (const SpatialVector &joint_dof)
 
string get_body_name (const RigidBodyDynamics::Model &model, unsigned int body_id)
 
RBDL_DLLAPI std::string GetModelDOFOverview (const Model &model)
 Creates a human readable overview of the Degrees of Freedom. More...
 
std::string print_hierarchy (const RigidBodyDynamics::Model &model, unsigned int body_index=0, int indent=0)
 
RBDL_DLLAPI std::string GetModelHierarchy (const Model &model)
 Creates a human readable overview of the model. More...
 
RBDL_DLLAPI std::string GetNamedBodyOriginsOverview (Model &model)
 Creates a human readable overview of the locations of all bodies that have names. More...
 
RBDL_DLLAPI void CalcCenterOfMass (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, double &mass, Math::Vector3d &com, Math::Vector3d *com_velocity=NULL, Math::Vector3d *angular_momentum=NULL, bool update_kinematics=true)
 Computes the Center of Mass (COM) and optionally its linear velocity. More...
 
RBDL_DLLAPI double CalcPotentialEnergy (Model &model, const Math::VectorNd &q, bool update_kinematics=true)
 Computes the potential energy of the full model. More...
 
RBDL_DLLAPI double CalcKineticEnergy (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, bool update_kinematics=true)
 Computes the kinetic energy of the full model. More...
 

Detailed Description

Namespace that contains optional helper functions.

Function Documentation

RBDL_DLLAPI void CalcCenterOfMass ( Model model,
const Math::VectorNd q,
const Math::VectorNd qdot,
double &  mass,
Math::Vector3d com,
Math::Vector3d com_velocity = NULL,
Math::Vector3d angular_momentum = NULL,
bool  update_kinematics = true 
)

Computes the Center of Mass (COM) and optionally its linear velocity.

When only interested in computing the location of the COM you can use NULL as value for com_velocity.

Parameters
modelThe model for which we want to compute the COM
qThe current joint positions
qdotThe current joint velocities
mass(output) total mass of the model
com(output) location of the Center of Mass of the model in base coordinates
com_velocity(optional output) linear velocity of the COM in base coordinates
angular_momentum(optional output) angular momentum of the model at the COM in base coordinates
update_kinematics(optional input) whether the kinematics should be updated (defaults to true)

Definition at line 153 of file rbdl_utils.cc.

References SpatialTransform::applyAdjoint(), SpatialRigidBodyInertia::h, Model::hc, Model::I, Model::Ic, Model::lambda, LOG, SpatialRigidBodyInertia::m, Model::mBodies, Vector3_t::set(), RigidBodyDynamics::UpdateKinematicsCustom(), Model::v, Model::X_lambda, and RigidBodyDynamics::Math::Xtrans().

RBDL_DLLAPI double CalcKineticEnergy ( Model model,
const Math::VectorNd q,
const Math::VectorNd qdot,
bool  update_kinematics 
)

Computes the kinetic energy of the full model.

Definition at line 212 of file rbdl_utils.cc.

References Model::I, Model::mBodies, RigidBodyDynamics::UpdateKinematicsCustom(), and Model::v.

RBDL_DLLAPI double CalcPotentialEnergy ( Model model,
const Math::VectorNd q,
bool  update_kinematics 
)

Computes the potential energy of the full model.

Definition at line 198 of file rbdl_utils.cc.

References CalcCenterOfMass(), Model::gravity, LOG, and Model::qdot_size.

string RigidBodyDynamics::Utils::get_body_name ( const RigidBodyDynamics::Model model,
unsigned int  body_id 
)

Definition at line 43 of file rbdl_utils.cc.

References Model::GetBodyName(), Model::mBodies, and Model::mu.

string RigidBodyDynamics::Utils::get_dof_name ( const SpatialVector joint_dof)

Definition at line 24 of file rbdl_utils.cc.

RBDL_DLLAPI std::string GetModelDOFOverview ( const Model model)

Creates a human readable overview of the Degrees of Freedom.

Definition at line 55 of file rbdl_utils.cc.

References get_body_name(), get_dof_name(), Model::mBodies, Model::mJoints, and Model::S.

RBDL_DLLAPI std::string GetModelHierarchy ( const Model model)

Creates a human readable overview of the model.

Definition at line 125 of file rbdl_utils.cc.

References print_hierarchy().

RBDL_DLLAPI std::string GetNamedBodyOriginsOverview ( Model model)

Creates a human readable overview of the locations of all bodies that have names.

Definition at line 133 of file rbdl_utils.cc.

References RigidBodyDynamics::CalcBodyToBaseCoordinates(), Model::dof_count, Model::GetBodyName(), Model::mBodies, and RigidBodyDynamics::UpdateKinematicsCustom().

std::string RigidBodyDynamics::Utils::print_hierarchy ( const RigidBodyDynamics::Model model,
unsigned int  body_index = 0,
int  indent = 0 
)