humoto
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
humoto::rbdl::Model Class Reference

Detailed Description

Wraps RBDL model and provides additional functionality.

Definition at line 37 of file model.h.

#include <model.h>

Classes

class  JointData
 Stores precomputed data for each joint. More...
 

Public Member Functions

 Model ()
 Default constructor. It is necesary to load() model before using. More...
 
 Model (const std::string &urdf_filename)
 Construct using URDF model. More...
 
 Model (const ModelParameters &model_parameters, const std::string &urdf_filename)
 Construct using URDF model. More...
 
TagPartialCoMPtr getCoMTag (const std::vector< std::string > &link_string_ids) const
 CoM Tag for several bodies. More...
 
TagCoMPtr getCoMTag () const
 CoM tag. More...
 
std::size_t getDOFNumber () const
 Return number of DoF. More...
 
TagPointPtr getLinkCoMTag (const std::string &link_string_id) const
 Tag for the CoM of a link. More...
 
TagLinkPtr getLinkTag (const std::string &link_string_id) const
 Tag for a link. More...
 
TagPointPtr getPointTag (const std::string &link_string_id, const etools::Vector3 &position_local) const
 Tag for a point on a link. More...
 
void getTagJacobian (Eigen::MatrixXd &jacobian, const TagPartialCoMPtr tag) const
 Get CoM jacbian for a set of bodies. More...
 
template<SpatialType::Type t_jacobian_type>
void getTagJacobian (Eigen::MatrixXd &jacobian, const TagLinkPtr tag) const
 Get Jacobian for a specific tag. More...
 
template<SpatialType::Type t_jacobian_type>
void getTagJacobian (Eigen::MatrixXd &jacobian, const TagPointPtr tag) const
 Get Jacobian for a specific tag. More...
 
void getTagJacobian (Eigen::MatrixXd &jacobian, const TagCoMPtr tag) const
 Compute CoM Jacobian of the robot. More...
 
double getTagMass (const TagCoMPtr tag) const
 Get mass. More...
 
double getTagMass (const TagPartialCoMPtr tag) const
 Get mass. More...
 
double getTagMass (const TagLinkPtr tag) const
 Get mass. More...
 
etools::Matrix3 getTagOrientation (const TagLinkPtr tag) const
 Get orientation of a tag. More...
 
etools::Matrix3 getTagOrientation (const TagPointPtr tag) const
 Get orientation of a tag. More...
 
rigidbody::RigidBodyPose getTagPose (const TagLinkPtr tag) const
 Get tag pose. More...
 
rigidbody::RigidBodyPose getTagPose (const TagPointPtr tag) const
 Get tag pose. More...
 
etools::Vector3 getTagPosition (const TagPartialCoMPtr tag) const
 Get CoM of several bodies. More...
 
etools::Vector3 getTagPosition (const TagLinkPtr tag) const
 Get position of a tag. More...
 
etools::Vector3 getTagPosition (const TagPointPtr tag) const
 Get position of a tag. More...
 
etools::Vector3 getTagPosition (const TagCoMPtr tag) const
 Get CoM of the robot. More...
 
void load (const ModelParameters &model_parameters, const std::string &urdf_filename)
 Load URDF model. More...
 
void load (const std::string &urdf_filename)
 Load URDF model. More...
 
void update (const Eigen::VectorXd &joint_angles)
 Update model. More...
 

Public Attributes

ModelParameters model_parameters_
 
RigidBodyDynamics::Model rbdl_model_
 
double total_mass_
 

Private Member Functions

etools::Vector3 expressInRootFrame (const std::size_t link_id, const etools::Vector3 &point_body_coordinates) const
 Express local position in root frame. More...
 
std::size_t getLinkId (const std::string &string_id) const
 Determines id of a body based on its string id. More...
 
RigidBodyDynamics::Math::SpatialTransform getLinkTransform (const LinkId id) const
 Returns spatial transform for a link. More...
 
etools::Vector3 getPointTagPosition (const std::size_t id, const etools::Vector3 &position_local) const
 Get position of a tag. More...
 
template<SpatialType::Type t_jacobian_type>
void getTagJacobian (Eigen::MatrixXd &jacobian, const LinkId link_id, const etools::Vector3 tag_position) const
 Get Jacobian for a specific tag. More...
 
bool isLinkFixed (const std::size_t link_id) const
 True if a body is fixed to its parent. More...
 
void setDefaults ()
 Initialization. More...
 

Private Attributes

std::vector< JointDatajoint_data_
 

Constructor & Destructor Documentation

◆ Model() [1/3]

humoto::rbdl::Model::Model ( )
inline

Default constructor. It is necesary to load() model before using.

Definition at line 50 of file model.h.

◆ Model() [2/3]

humoto::rbdl::Model::Model ( const std::string &  urdf_filename)
inlineexplicit

Construct using URDF model.

Parameters
[in]urdf_filename

Definition at line 61 of file model.h.

◆ Model() [3/3]

humoto::rbdl::Model::Model ( const ModelParameters model_parameters,
const std::string &  urdf_filename 
)
inline

Construct using URDF model.

Parameters
[in]model_parameters
[in]urdf_filename

Definition at line 73 of file model.h.

Member Function Documentation

◆ expressInRootFrame()

etools::Vector3 humoto::rbdl::Model::expressInRootFrame ( const std::size_t  link_id,
const etools::Vector3 &  point_body_coordinates 
) const
inlineprivate

Express local position in root frame.

Parameters
[in]link_id
[in]point_body_coordinates
Returns
3d vector
Attention
Based on CalcBodyToBaseCoordinates() function from RBDL.

Definition at line 759 of file model.h.

◆ getCoMTag() [1/2]

TagPartialCoMPtr humoto::rbdl::Model::getCoMTag ( const std::vector< std::string > &  link_string_ids) const
inline

CoM Tag for several bodies.

Parameters
[in]link_string_ids
Returns
tag

Definition at line 205 of file model.h.

◆ getCoMTag() [2/2]

TagCoMPtr humoto::rbdl::Model::getCoMTag ( ) const
inline

CoM tag.

Returns
tag

Definition at line 229 of file model.h.

◆ getDOFNumber()

std::size_t humoto::rbdl::Model::getDOFNumber ( ) const
inline

Return number of DoF.

Returns
number of DoF

Definition at line 143 of file model.h.

◆ getLinkCoMTag()

TagPointPtr humoto::rbdl::Model::getLinkCoMTag ( const std::string &  link_string_id) const
inline

Tag for the CoM of a link.

Parameters
[in]link_string_id
Returns
tag

Definition at line 189 of file model.h.

◆ getLinkId()

std::size_t humoto::rbdl::Model::getLinkId ( const std::string &  string_id) const
inlineprivate

Determines id of a body based on its string id.

Parameters
[in]string_id
Returns
id

Definition at line 742 of file model.h.

◆ getLinkTag()

TagLinkPtr humoto::rbdl::Model::getLinkTag ( const std::string &  link_string_id) const
inline

Tag for a link.

Parameters
[in]link_string_id
Returns
tag

Definition at line 158 of file model.h.

◆ getLinkTransform()

RigidBodyDynamics::Math::SpatialTransform humoto::rbdl::Model::getLinkTransform ( const LinkId  id) const
inlineprivate

Returns spatial transform for a link.

Parameters
[in]id
Returns
spatial transform

Definition at line 851 of file model.h.

◆ getPointTag()

TagPointPtr humoto::rbdl::Model::getPointTag ( const std::string &  link_string_id,
const etools::Vector3 &  position_local 
) const
inline

Tag for a point on a link.

Parameters
[in]link_string_id
[in]position_localposition of the point in the local frame
Returns
tag

Definition at line 173 of file model.h.

◆ getPointTagPosition()

etools::Vector3 humoto::rbdl::Model::getPointTagPosition ( const std::size_t  id,
const etools::Vector3 &  position_local 
) const
inlineprivate

Get position of a tag.

Parameters
[in]idparent link id
[in]position_localposition in the link frame
Returns
3d position vector

Definition at line 796 of file model.h.

◆ getTagJacobian() [1/5]

void humoto::rbdl::Model::getTagJacobian ( Eigen::MatrixXd &  jacobian,
const TagPartialCoMPtr  tag 
) const
inline

Get CoM jacbian for a set of bodies.

Parameters
[out]jacobian
[in]tag

Definition at line 440 of file model.h.

◆ getTagJacobian() [2/5]

template<SpatialType::Type t_jacobian_type>
void humoto::rbdl::Model::getTagJacobian ( Eigen::MatrixXd &  jacobian,
const TagLinkPtr  tag 
) const
inline

Get Jacobian for a specific tag.

Parameters
[out]jacobian
[in]tag
Attention
Based on CalcPointJacobian() function from RBDL.

Definition at line 476 of file model.h.

◆ getTagJacobian() [3/5]

template<SpatialType::Type t_jacobian_type>
void humoto::rbdl::Model::getTagJacobian ( Eigen::MatrixXd &  jacobian,
const TagPointPtr  tag 
) const
inline

Get Jacobian for a specific tag.

Parameters
[out]jacobian
[in]tag
Attention
Based on CalcPointJacobian() function from RBDL.

Definition at line 492 of file model.h.

◆ getTagJacobian() [4/5]

void humoto::rbdl::Model::getTagJacobian ( Eigen::MatrixXd &  jacobian,
const TagCoMPtr  tag 
) const
inline

Compute CoM Jacobian of the robot.

Parameters
[out]jacobian
[in]tag

Definition at line 506 of file model.h.

◆ getTagJacobian() [5/5]

template<SpatialType::Type t_jacobian_type>
void humoto::rbdl::Model::getTagJacobian ( Eigen::MatrixXd &  jacobian,
const LinkId  link_id,
const etools::Vector3  tag_position 
) const
inlineprivate

Get Jacobian for a specific tag.

Parameters
[out]jacobian
[in]link_id
[in]tag_position(local)
Attention
Based on CalcPointJacobian() function from RBDL.

Definition at line 816 of file model.h.

◆ getTagMass() [1/3]

double humoto::rbdl::Model::getTagMass ( const TagCoMPtr  tag) const
inline

Get mass.

Parameters
[in]tag
Returns
mass

Definition at line 401 of file model.h.

◆ getTagMass() [2/3]

double humoto::rbdl::Model::getTagMass ( const TagPartialCoMPtr  tag) const
inline

Get mass.

Parameters
[in]tagCoM tag
Returns
total mass of the bodies

Definition at line 414 of file model.h.

◆ getTagMass() [3/3]

double humoto::rbdl::Model::getTagMass ( const TagLinkPtr  tag) const
inline

Get mass.

Parameters
[in]tagCoM tag
Returns
total mass of the bodies

Definition at line 427 of file model.h.

◆ getTagOrientation() [1/2]

etools::Matrix3 humoto::rbdl::Model::getTagOrientation ( const TagLinkPtr  tag) const
inline

Get orientation of a tag.

Parameters
[in]tag
Returns
3x3 matrix

Definition at line 331 of file model.h.

◆ getTagOrientation() [2/2]

etools::Matrix3 humoto::rbdl::Model::getTagOrientation ( const TagPointPtr  tag) const
inline

Get orientation of a tag.

Parameters
[in]tag
Returns
3x3 matrix

Definition at line 344 of file model.h.

◆ getTagPose() [1/2]

rigidbody::RigidBodyPose humoto::rbdl::Model::getTagPose ( const TagLinkPtr  tag) const
inline

Get tag pose.

Parameters
[in]tag
Returns
3x3 matrix

Definition at line 358 of file model.h.

◆ getTagPose() [2/2]

rigidbody::RigidBodyPose humoto::rbdl::Model::getTagPose ( const TagPointPtr  tag) const
inline

Get tag pose.

Parameters
[in]tag
Returns
3x3 matrix

Definition at line 379 of file model.h.

◆ getTagPosition() [1/4]

etools::Vector3 humoto::rbdl::Model::getTagPosition ( const TagPartialCoMPtr  tag) const
inline

Get CoM of several bodies.

Parameters
[in]tagCoM tag
Returns
CoM position

Definition at line 244 of file model.h.

◆ getTagPosition() [2/4]

etools::Vector3 humoto::rbdl::Model::getTagPosition ( const TagLinkPtr  tag) const
inline

Get position of a tag.

Parameters
[in]tag
Returns
3d position vector

Definition at line 276 of file model.h.

◆ getTagPosition() [3/4]

etools::Vector3 humoto::rbdl::Model::getTagPosition ( const TagPointPtr  tag) const
inline

Get position of a tag.

Parameters
[in]tag
Returns
3d position vector

Definition at line 289 of file model.h.

◆ getTagPosition() [4/4]

etools::Vector3 humoto::rbdl::Model::getTagPosition ( const TagCoMPtr  tag) const
inline

Get CoM of the robot.

Parameters
[in]tag
Returns
total mass

Definition at line 303 of file model.h.

◆ isLinkFixed()

bool humoto::rbdl::Model::isLinkFixed ( const std::size_t  link_id) const
inlineprivate

True if a body is fixed to its parent.

Parameters
[in]link_id
Returns
true/false
Attention
Based on IsFixedLinkId() function from RBDL.

Definition at line 719 of file model.h.

◆ load() [1/2]

void humoto::rbdl::Model::load ( const ModelParameters model_parameters,
const std::string &  urdf_filename 
)
inline

Load URDF model.

Parameters
[in]model_parameters
[in]urdf_filename

Definition at line 86 of file model.h.

◆ load() [2/2]

void humoto::rbdl::Model::load ( const std::string &  urdf_filename)
inline

Load URDF model.

Parameters
[in]urdf_filename

Definition at line 99 of file model.h.

◆ setDefaults()

void humoto::rbdl::Model::setDefaults ( )
inlineprivate

Initialization.

Definition at line 704 of file model.h.

◆ update()

void humoto::rbdl::Model::update ( const Eigen::VectorXd &  joint_angles)
inline

Update model.

Parameters
[in]joint_anglesnew joint angles

Definition at line 128 of file model.h.

Member Data Documentation

◆ joint_data_

std::vector<JointData> humoto::rbdl::Model::joint_data_
private

Definition at line 697 of file model.h.

◆ model_parameters_

ModelParameters humoto::rbdl::Model::model_parameters_

Definition at line 40 of file model.h.

◆ rbdl_model_

RigidBodyDynamics::Model humoto::rbdl::Model::rbdl_model_

Definition at line 41 of file model.h.

◆ total_mass_

double humoto::rbdl::Model::total_mass_

Definition at line 42 of file model.h.


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