Drake
SdfModel Class Reference

This class provides a representation of a <model> element within a given SDF specification. More...

#include <drake/multibody/parsing/sdf_model.h>

Public Member Functions

 SdfModel (const std::string &model_name)
 Creates a new SDF model object specification with the given model_name. More...
 
const std::string & name () const
 Returns the name of this model. More...
 
int get_num_links () const
 Returns the number of links (corresponding to <link> elements) in this model. More...
 
int get_num_joints () const
 Returns the number of joints (corresponding to <joint> elements) in this model. More...
 
const std::vector< SdfLink > & get_links () const
 Returns an std::vector of SdfLink objects containing all the links in this model. More...
 
const std::vector< SdfJoint > & get_joints () const
 Returns an std::vector of SdfJoint objects containing all the joints in this model. More...
 
bool HasLink (const std::string &link_name) const
 Returns true if this model contains a link named link_name. More...
 
bool HasJoint (const std::string &joint_name) const
 Returns true if this model contains a joint named joint_name. More...
 
const SdfLinkGetLinkByName (const std::string &link_name) const
 Returns a const reference to the SdfLink object with unique name within this model link_name. More...
 
const SdfJointGetJointByName (const std::string &joint_name) const
 Returns a const reference to the SdfJoint object with unique name within this model joint_name. More...
 
void CachePose (const std::string &measured_in_frame_name, const std::string &frame_name, const Isometry3< double > &X_MF)
 Caches the pose X_MF of a frame F named frame_name in a "measured-in" frame M named masured_in_frame_name. More...
 
Isometry3< doubleGetPose (const std::string &measured_in_frame_name, const std::string &frame_name) const
 Returns the pose X_MF of a frame F named frame_name in a "measured-in" frame M named masured_in_frame_name. More...
 
Isometry3< doubleGetPoseInModelFrame (const std::string &frame_name) const
 Returns the pose X_DF of a frame F named frame_name as measured in this model frame D. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 SdfModel (const SdfModel &)=default
 
SdfModeloperator= (const SdfModel &)=default
 
 SdfModel (SdfModel &&)=default
 
SdfModeloperator= (SdfModel &&)=default
 
Methods to add model components.
SdfLinkAddLink (const std::string &link_name)
 Adds a new link named link_name to this model and returns a reference to the newly added link. More...
 
SdfJointAddJoint (const std::string &joint_name, const std::string &parent_link_name, const std::string &child_link_name, const std::string &joint_type)
 Adds a new joint named joint_name to this model and returns a reference to the newly added joint. More...
 

Detailed Description

This class provides a representation of a <model> element within a given SDF specification.

For details on the specification of models, including conventions and default values, please refer to the documentation for the <model> element.

Constructor & Destructor Documentation

SdfModel ( const SdfModel )
default
SdfModel ( SdfModel &&  )
default
SdfModel ( const std::string &  model_name)
inlineexplicit

Creates a new SDF model object specification with the given model_name.

Per SDF specification, model_name must not match any other model name in the world (<world>).

Member Function Documentation

SdfJoint& AddJoint ( const std::string &  joint_name,
const std::string &  parent_link_name,
const std::string &  child_link_name,
const std::string &  joint_type 
)
inline

Adds a new joint named joint_name to this model and returns a reference to the newly added joint.

Please refer to the SdfJoint class's documentation for details on the arguments for this method. This method aborts if this model already contains a joint named joint_name.

Here is the call graph for this function:

SdfLink& AddLink ( const std::string &  link_name)
inline

Adds a new link named link_name to this model and returns a reference to the newly added link.

This method aborts if this model already contains a link named link_name.

Here is the call graph for this function:

void CachePose ( const std::string &  measured_in_frame_name,
const std::string &  frame_name,
const Isometry3< double > &  X_MF 
)
inline

Caches the pose X_MF of a frame F named frame_name in a "measured-in" frame M named masured_in_frame_name.

Here is the call graph for this function:

const std::vector<SdfJoint>& get_joints ( ) const
inline

Returns an std::vector of SdfJoint objects containing all the joints in this model.

const std::vector<SdfLink>& get_links ( ) const
inline

Returns an std::vector of SdfLink objects containing all the links in this model.

int get_num_joints ( ) const
inline

Returns the number of joints (corresponding to <joint> elements) in this model.

Here is the caller graph for this function:

int get_num_links ( ) const
inline

Returns the number of links (corresponding to <link> elements) in this model.

Here is the caller graph for this function:

const SdfJoint& GetJointByName ( const std::string &  joint_name) const
inline

Returns a const reference to the SdfJoint object with unique name within this model joint_name.

This method throws a std::runtime_error if the model does not contain a joint named joint_name.

Here is the call graph for this function:

const SdfLink& GetLinkByName ( const std::string &  link_name) const
inline

Returns a const reference to the SdfLink object with unique name within this model link_name.

This method throws a std::runtime_error if the model does not contain a link named link_name.

Here is the call graph for this function:

Isometry3<double> GetPose ( const std::string &  measured_in_frame_name,
const std::string &  frame_name 
) const
inline

Returns the pose X_MF of a frame F named frame_name in a "measured-in" frame M named masured_in_frame_name.

Here is the call graph for this function:

Isometry3<double> GetPoseInModelFrame ( const std::string &  frame_name) const
inline

Returns the pose X_DF of a frame F named frame_name as measured in this model frame D.

Here is the call graph for this function:

bool HasJoint ( const std::string &  joint_name) const
inline

Returns true if this model contains a joint named joint_name.

Here is the caller graph for this function:

bool HasLink ( const std::string &  link_name) const
inline

Returns true if this model contains a link named link_name.

Here is the caller graph for this function:

const std::string& name ( ) const
inline

Returns the name of this model.

Here is the caller graph for this function:

SdfModel& operator= ( const SdfModel )
default
SdfModel& operator= ( SdfModel &&  )
default

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