Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::Model Class Reference

#include <Model.hh>

Public Member Functions

 Model ()
 Default constructor. More...
 
bool AddFrame (const Frame &_frame)
 Add a frame to the model. More...
 
bool AddJoint (const Joint &_joint)
 Add a joint to the model. More...
 
bool AddLink (const Link &_link)
 Add a link to the model. More...
 
bool AddModel (const Model &_model)
 Add a model to the model. More...
 
void AddPlugin (const Plugin &_plugin)
 Add a plugin to this object. More...
 
bool AllowAutoDisable () const
 Check if this model should be allowed to auto-disable. More...
 
const LinkCanonicalLink () const
 Get the model's canonical link. More...
 
std::pair< const Link *, std::string > CanonicalLinkAndRelativeName () const
 Get the model's canonical link and the nested name of the link relative to the current model, delimited by "::". More...
 
const std::string & CanonicalLinkName () const
 Get the name of the model's canonical link. More...
 
void ClearFrames ()
 Remove all frames. More...
 
void ClearJoints ()
 Remove all joints. More...
 
void ClearLinks ()
 Remove all links. More...
 
void ClearModels ()
 Remove all models. More...
 
void ClearPlugins ()
 Remove all plugins. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
bool EnableWind () const
 Check if this model should be subject to wind. More...
 
const FrameFrameByIndex (const uint64_t _index) const
 Get an immediate (not nested) child explicit frame based on an index. More...
 
FrameFrameByIndex (uint64_t _index)
 Get a mutable immediate (not nested) child explicit frame based on an index. More...
 
FrameFrameByName (const std::string &_name)
 Get a mutable explicit frame based on a name. More...
 
const FrameFrameByName (const std::string &_name) const
 Get an explicit frame based on a name. More...
 
uint64_t FrameCount () const
 Get the number of explicit frames that are immediate (not nested) children of this Model object. More...
 
bool FrameNameExists (const std::string &_name) const
 Get whether an explicit frame name exists. More...
 
std::shared_ptr< const InterfaceModelInterfaceModelByIndex (const uint64_t _index) const
 Get an immediate (not recursively nested) child interface model based on an index. More...
 
uint64_t InterfaceModelCount () const
 Get the number of nested interface models that are immediate (not recursively nested) children of this Model object. More...
 
const NestedIncludeInterfaceModelNestedIncludeByIndex (const uint64_t _index) const
 Get the nested include information of an immediate (not recursively nested) child interface model based on an index. More...
 
const JointJointByIndex (const uint64_t _index) const
 Get an immediate (not nested) child joint based on an index. More...
 
JointJointByIndex (uint64_t _index)
 Get an immediate (not nested) mutable child joint based on an index. More...
 
JointJointByName (const std::string &_name)
 Get a mubtable joint based on a name. More...
 
const JointJointByName (const std::string &_name) const
 Get a joint based on a name. More...
 
uint64_t JointCount () const
 Get the number of joints that are immediate (not nested) children of this Model object. More...
 
bool JointNameExists (const std::string &_name) const
 Get whether a joint name exists. More...
 
const LinkLinkByIndex (const uint64_t _index) const
 Get an immediate (not nested) child link based on an index. More...
 
LinkLinkByIndex (uint64_t _index)
 Get an immediate (not nested) mutable child link based on an index. More...
 
LinkLinkByName (const std::string &_name)
 Get a mutable link based on a name. More...
 
const LinkLinkByName (const std::string &_name) const
 Get a link based on a name. More...
 
uint64_t LinkCount () const
 Get the number of links that are immediate (not nested) children of this Model object. More...
 
bool LinkNameExists (const std::string &_name) const
 Get whether a link name exists. More...
 
Errors Load (ElementPtr _sdf)
 Load the model based on a element pointer. More...
 
Errors Load (sdf::ElementPtr _sdf, const ParserConfig &_config)
 Load the model based on a element pointer. More...
 
const ModelModelByIndex (const uint64_t _index) const
 Get an immediate (not recursively nested) child model based on an index. More...
 
ModelModelByIndex (uint64_t _index)
 Get an immediate (not recursively nested) mutable child model. More...
 
ModelModelByName (const std::string &_name)
 Get a mutable nested model based on a name. More...
 
const ModelModelByName (const std::string &_name) const
 Get a nested model based on a name. More...
 
uint64_t ModelCount () const
 Get the number of nested models that are immediate (not recursively nested) children of this Model object. More...
 
bool ModelNameExists (const std::string &_name) const
 Get whether a nested model name exists. More...
 
std::string Name () const
 Get the name of the model. More...
 
bool NameExistsInFrameAttachedToGraph (const std::string &_name) const
 Check if a given name exists in the FrameAttachedTo graph at the scope of the model. More...
 
const std::string & PlacementFrameName () const
 Get the name of the placement frame of the model. More...
 
sdf::PluginsPlugins ()
 Get a mutable vector of plugins attached to this object. More...
 
const sdf::PluginsPlugins () const
 Get the plugins attached to this object. More...
 
const std::string & PoseRelativeTo () const
 Get the name of the coordinate frame relative to which this object's pose is expressed. More...
 
const gz::math::Pose3d & RawPose () const
 Get the pose of the model. More...
 
void ResolveAutoInertials (sdf::Errors &_errors, const ParserConfig &_config)
 Calculate and set the inertials for all the links belonging to the model object. More...
 
bool SelfCollide () const
 Check if this model should self-collide. More...
 
sdf::SemanticPose SemanticPose () const
 Get SemanticPose object of this object to aid in resolving poses. More...
 
void SetAllowAutoDisable (bool _allowAutoDisable)
 Set this model to allow auto-disabling. More...
 
void SetCanonicalLinkName (const std::string &_canonicalLink)
 Set the name of the model's canonical link. More...
 
void SetEnableWind (bool _enableWind)
 Set whether this model should be subject to wind. More...
 
void SetName (const std::string &_name)
 Set the name of the model. More...
 
void SetPlacementFrameName (const std::string &_name)
 Set the name of the placement frame of the model. More...
 
void SetPoseRelativeTo (const std::string &_frame)
 Set the name of the coordinate frame relative to which this object's pose is expressed. More...
 
void SetRawPose (const gz::math::Pose3d &_pose)
 Set the pose of the model. More...
 
void SetSelfCollide (bool _selfCollide)
 Set this model to self-collide or not self-collide. More...
 
void SetStatic (bool _static)
 Set this model to be static or not static. More...
 
void SetUri (const std::string &_uri)
 Set the URI associated with this model. More...
 
bool Static () const
 Check if this model should be static. More...
 
sdf::ElementPtr ToElement (const OutputConfig &_config=OutputConfig::GlobalConfig()) const
 Create and return an SDF element filled with data from this model. More...
 
std::string Uri () const
 Get the URI associated with this model. More...
 
Errors ValidateGraphs () const
 Check that the FrameAttachedToGraph and PoseRelativeToGraph are valid. More...
 

Constructor & Destructor Documentation

◆ Model()

sdf::SDF_VERSION_NAMESPACE::Model::Model ( )

Default constructor.

Member Function Documentation

◆ AddFrame()

bool sdf::SDF_VERSION_NAMESPACE::Model::AddFrame ( const Frame _frame)

Add a frame to the model.

Parameters
[in]_frameFrame to add.
Returns
True if successful, false if a frame with the name already exists.

◆ AddJoint()

bool sdf::SDF_VERSION_NAMESPACE::Model::AddJoint ( const Joint _joint)

Add a joint to the model.

Parameters
[in]_linkJoint to add.
Returns
True if successful, false if a joint with the name already exists.

◆ AddLink()

bool sdf::SDF_VERSION_NAMESPACE::Model::AddLink ( const Link _link)

Add a link to the model.

Parameters
[in]_linkLink to add.
Returns
True if successful, false if a link with the name already exists.

◆ AddModel()

bool sdf::SDF_VERSION_NAMESPACE::Model::AddModel ( const Model _model)

Add a model to the model.

Parameters
[in]_modelModel to add.
Returns
True if successful, false if a model with the name already exists.

◆ AddPlugin()

void sdf::SDF_VERSION_NAMESPACE::Model::AddPlugin ( const Plugin _plugin)

Add a plugin to this object.

Parameters
[in]_pluginPlugin to add.

◆ AllowAutoDisable()

bool sdf::SDF_VERSION_NAMESPACE::Model::AllowAutoDisable ( ) const

Check if this model should be allowed to auto-disable.

If auto-disable is allowed, a model that is at rest can choose to not update its dynamics.

Returns
true if auto-disable is allowed for this model

◆ CanonicalLink()

const Link* sdf::SDF_VERSION_NAMESPACE::Model::CanonicalLink ( ) const

Get the model's canonical link.

Returns
An immutable pointer to the canonical link

◆ CanonicalLinkAndRelativeName()

std::pair<const Link *, std::string> sdf::SDF_VERSION_NAMESPACE::Model::CanonicalLinkAndRelativeName ( ) const

Get the model's canonical link and the nested name of the link relative to the current model, delimited by "::".

Returns
An immutable pointer to the canonical link and the nested name of the link relative to the current model.

◆ CanonicalLinkName()

const std::string& sdf::SDF_VERSION_NAMESPACE::Model::CanonicalLinkName ( ) const

Get the name of the model's canonical link.

An empty value indicates that the first link in the model or the first link found in a depth first search of nested models is the canonical link.

Returns
The name of the canonical link.

◆ ClearFrames()

void sdf::SDF_VERSION_NAMESPACE::Model::ClearFrames ( )

Remove all frames.

◆ ClearJoints()

void sdf::SDF_VERSION_NAMESPACE::Model::ClearJoints ( )

Remove all joints.

◆ ClearLinks()

void sdf::SDF_VERSION_NAMESPACE::Model::ClearLinks ( )

Remove all links.

◆ ClearModels()

void sdf::SDF_VERSION_NAMESPACE::Model::ClearModels ( )

Remove all models.

◆ ClearPlugins()

void sdf::SDF_VERSION_NAMESPACE::Model::ClearPlugins ( )

Remove all plugins.

◆ Element()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Model::Element ( ) const

Get a pointer to the SDF element that was used during load.

Returns
SDF element pointer. The value will be nullptr if Load has not been called.

◆ EnableWind()

bool sdf::SDF_VERSION_NAMESPACE::Model::EnableWind ( ) const

Check if this model should be subject to wind.

If true, all links in the model should be affected by the wind. This can be overridden per link.

Returns
true if the model should be subject to wind, false otherwise.

◆ FrameByIndex() [1/2]

const Frame* sdf::SDF_VERSION_NAMESPACE::Model::FrameByIndex ( const uint64_t  _index) const

Get an immediate (not nested) child explicit frame based on an index.

Parameters
[in]_indexIndex of the explicit frame. The index should be in the range [0..FrameCount()).
Returns
Pointer to the explicit frame. Nullptr if the index does not exist.
See also
uint64_t FrameCount() const

◆ FrameByIndex() [2/2]

Frame* sdf::SDF_VERSION_NAMESPACE::Model::FrameByIndex ( uint64_t  _index)

Get a mutable immediate (not nested) child explicit frame based on an index.

Parameters
[in]_indexIndex of the explicit frame. The index should be in the range [0..FrameCount()).
Returns
Pointer to the explicit frame. Nullptr if the index does not exist.
See also
uint64_t FrameCount() const

◆ FrameByName() [1/2]

Frame* sdf::SDF_VERSION_NAMESPACE::Model::FrameByName ( const std::string &  _name)

Get a mutable explicit frame based on a name.

Parameters
[in]_nameName of the explicit frame. To get a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
Pointer to the explicit frame. Nullptr if the name does not exist.

◆ FrameByName() [2/2]

const Frame* sdf::SDF_VERSION_NAMESPACE::Model::FrameByName ( const std::string &  _name) const

Get an explicit frame based on a name.

Parameters
[in]_nameName of the explicit frame. To get a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
Pointer to the explicit frame. Nullptr if the name does not exist.

◆ FrameCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::Model::FrameCount ( ) const

Get the number of explicit frames that are immediate (not nested) children of this Model object.

Remarks
FrameByName() can find explicit frames that are not immediate children of this Model object.
Returns
Number of explicit frames contained in this Model object.

◆ FrameNameExists()

bool sdf::SDF_VERSION_NAMESPACE::Model::FrameNameExists ( const std::string &  _name) const

Get whether an explicit frame name exists.

Parameters
[in]_nameName of the explicit frame to check. To check for a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
True if there exists an explicit frame with the given name.

◆ InterfaceModelByIndex()

std::shared_ptr<const InterfaceModel> sdf::SDF_VERSION_NAMESPACE::Model::InterfaceModelByIndex ( const uint64_t  _index) const

Get an immediate (not recursively nested) child interface model based on an index.

Parameters
[in]_indexIndex of the nested interface model. The index should be in the range [0..InterfaceModelCount()).
Returns
Pointer to the model. Nullptr if the index does not exist.
See also
uint64_t InterfaceModelCount() const

◆ InterfaceModelCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::Model::InterfaceModelCount ( ) const

Get the number of nested interface models that are immediate (not recursively nested) children of this Model object.

Returns
Number of nested interface models contained in this Model object.

◆ InterfaceModelNestedIncludeByIndex()

const NestedInclude* sdf::SDF_VERSION_NAMESPACE::Model::InterfaceModelNestedIncludeByIndex ( const uint64_t  _index) const

Get the nested include information of an immediate (not recursively nested) child interface model based on an index.

Parameters
[in]_indexIndex of the nested interface model. The index should be in the range [0..InterfaceModelCount()).
Returns
Pointer to the nested include information. Nullptr if the index does not exist.
See also
uint64_t InterfaceModelCount() const

◆ JointByIndex() [1/2]

const Joint* sdf::SDF_VERSION_NAMESPACE::Model::JointByIndex ( const uint64_t  _index) const

Get an immediate (not nested) child joint based on an index.

Parameters
[in]_indexIndex of the joint. The index should be in the range [0..JointCount()).
Returns
Pointer to the joint. Nullptr if the index does not exist.
See also
uint64_t JointCount() const

◆ JointByIndex() [2/2]

Joint* sdf::SDF_VERSION_NAMESPACE::Model::JointByIndex ( uint64_t  _index)

Get an immediate (not nested) mutable child joint based on an index.

Parameters
[in]_indexIndex of the joint. The index should be in the range [0..JointCount()).
Returns
Pointer to the joint. Nullptr if the index does not exist.
See also
uint64_t JointCount() const

◆ JointByName() [1/2]

Joint* sdf::SDF_VERSION_NAMESPACE::Model::JointByName ( const std::string &  _name)

Get a mubtable joint based on a name.

Parameters
[in]_nameName of the joint. To get a joint in a nested model, prefix the joint name with the sequence of nested models containing this joint, delimited by "::".
Returns
Pointer to the joint. Nullptr if a joint with the given name does not exist.
See also
bool JointNameExists(const std::string &_name) const

◆ JointByName() [2/2]

const Joint* sdf::SDF_VERSION_NAMESPACE::Model::JointByName ( const std::string &  _name) const

Get a joint based on a name.

Parameters
[in]_nameName of the joint. To get a joint in a nested model, prefix the joint name with the sequence of nested models containing this joint, delimited by "::".
Returns
Pointer to the joint. Nullptr if a joint with the given name does not exist.
See also
bool JointNameExists(const std::string &_name) const

◆ JointCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::Model::JointCount ( ) const

Get the number of joints that are immediate (not nested) children of this Model object.

Remarks
JointByName() can find joints that are not immediate children of this Model object.
Returns
Number of joints contained in this Model object.

◆ JointNameExists()

bool sdf::SDF_VERSION_NAMESPACE::Model::JointNameExists ( const std::string &  _name) const

Get whether a joint name exists.

Parameters
[in]_nameName of the joint to check. To check for a joint in a nested model, prefix the joint name with the sequence of nested models containing this joint, delimited by "::".
Returns
True if there exists a joint with the given name.

◆ LinkByIndex() [1/2]

const Link* sdf::SDF_VERSION_NAMESPACE::Model::LinkByIndex ( const uint64_t  _index) const

Get an immediate (not nested) child link based on an index.

Parameters
[in]_indexIndex of the link. The index should be in the range [0..LinkCount()).
Returns
Pointer to the link. Nullptr if the index does not exist.
See also
uint64_t LinkCount() const

◆ LinkByIndex() [2/2]

Link* sdf::SDF_VERSION_NAMESPACE::Model::LinkByIndex ( uint64_t  _index)

Get an immediate (not nested) mutable child link based on an index.

Parameters
[in]_indexIndex of the link. The index should be in the range [0..LinkCount()).
Returns
Pointer to the link. Nullptr if the index does not exist.
See also
uint64_t LinkCount() const

◆ LinkByName() [1/2]

Link* sdf::SDF_VERSION_NAMESPACE::Model::LinkByName ( const std::string &  _name)

Get a mutable link based on a name.

Parameters
[in]_nameName of the link. To get a link in a nested model, prefix the link name with the sequence of nested models containing this link, delimited by "::".
Returns
Pointer to the link. Nullptr if the name does not exist.

◆ LinkByName() [2/2]

const Link* sdf::SDF_VERSION_NAMESPACE::Model::LinkByName ( const std::string &  _name) const

Get a link based on a name.

Parameters
[in]_nameName of the link. To get a link in a nested model, prefix the link name with the sequence of nested models containing this link, delimited by "::".
Returns
Pointer to the link. Nullptr if the name does not exist.

◆ LinkCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::Model::LinkCount ( ) const

Get the number of links that are immediate (not nested) children of this Model object.

Remarks
LinkByName() can find links that are not immediate children of this Model object.
Returns
Number of links contained in this Model object.

◆ LinkNameExists()

bool sdf::SDF_VERSION_NAMESPACE::Model::LinkNameExists ( const std::string &  _name) const

Get whether a link name exists.

Parameters
[in]_nameName of the link to check. To check for a link in a nested model, prefix the link name with the sequence of nested models containing this link, delimited by "::".
Returns
True if there exists a link with the given name.

◆ Load() [1/2]

Errors sdf::SDF_VERSION_NAMESPACE::Model::Load ( ElementPtr  _sdf)

Load the model based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ Load() [2/2]

Errors sdf::SDF_VERSION_NAMESPACE::Model::Load ( sdf::ElementPtr  _sdf,
const ParserConfig _config 
)

Load the model based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
[in]_configParser configuration
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ ModelByIndex() [1/2]

const Model* sdf::SDF_VERSION_NAMESPACE::Model::ModelByIndex ( const uint64_t  _index) const

Get an immediate (not recursively nested) child model based on an index.

Parameters
[in]_indexIndex of the nested model. The index should be in the range [0..ModelCount()).
Returns
Pointer to the model. Nullptr if the index does not exist.
See also
uint64_t ModelCount() const

◆ ModelByIndex() [2/2]

Model* sdf::SDF_VERSION_NAMESPACE::Model::ModelByIndex ( uint64_t  _index)

Get an immediate (not recursively nested) mutable child model.

Parameters
[in]_indexIndex of the nested model. The index should be in the range [0..ModelCount()).
Returns
Pointer to the model. Nullptr if the index does not exist.
See also
uint64_t ModelCount() const

◆ ModelByName() [1/2]

Model* sdf::SDF_VERSION_NAMESPACE::Model::ModelByName ( const std::string &  _name)

Get a mutable nested model based on a name.

Parameters
[in]_nameName of the nested model. To get a model nested in other models, prefix the model name with the sequence of nested model names, delimited by "::".
Returns
Pointer to the model. Nullptr if a model with the given name does not exist.
See also
bool ModelNameExists(const std::string &_name) const

◆ ModelByName() [2/2]

const Model* sdf::SDF_VERSION_NAMESPACE::Model::ModelByName ( const std::string &  _name) const

Get a nested model based on a name.

Parameters
[in]_nameName of the nested model. To get a model nested in other models, prefix the model name with the sequence of nested model names, delimited by "::".
Returns
Pointer to the model. Nullptr if a model with the given name does not exist.
See also
bool ModelNameExists(const std::string &_name) const

◆ ModelCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::Model::ModelCount ( ) const

Get the number of nested models that are immediate (not recursively nested) children of this Model object.

Remarks
ModelByName() can find nested models that are not immediate children of this Model object.
Returns
Number of nested models contained in this Model object.

◆ ModelNameExists()

bool sdf::SDF_VERSION_NAMESPACE::Model::ModelNameExists ( const std::string &  _name) const

Get whether a nested model name exists.

Parameters
[in]_nameName of the nested model to check. To check for a model nested in other models, prefix the model name with the sequence of nested model names, delimited by "::".
Returns
True if there exists a nested model with the given name.

◆ Name()

std::string sdf::SDF_VERSION_NAMESPACE::Model::Name ( ) const

Get the name of the model.

The name of the model should be unique within the scope of a World.

Returns
Name of the model.

◆ NameExistsInFrameAttachedToGraph()

bool sdf::SDF_VERSION_NAMESPACE::Model::NameExistsInFrameAttachedToGraph ( const std::string &  _name) const

Check if a given name exists in the FrameAttachedTo graph at the scope of the model.

Parameters
[in]_nameName of the implicit or explicit frame to check. To check for a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
True if the frame name is found in the FrameAttachedTo graph. False otherwise, or if the frame graph is invalid.
Note
This function assumes the model has a valid FrameAttachedTo graph. It will return false if the graph is invalid.

◆ PlacementFrameName()

const std::string& sdf::SDF_VERSION_NAMESPACE::Model::PlacementFrameName ( ) const

Get the name of the placement frame of the model.

Returns
Name of the placement frame attribute of the model.

◆ Plugins() [1/2]

sdf::Plugins& sdf::SDF_VERSION_NAMESPACE::Model::Plugins ( )

Get a mutable vector of plugins attached to this object.

Returns
A vector of Plugin, which will be empty if there are no plugins.

◆ Plugins() [2/2]

const sdf::Plugins& sdf::SDF_VERSION_NAMESPACE::Model::Plugins ( ) const

Get the plugins attached to this object.

Returns
A vector of Plugin, which will be empty if there are no plugins.

◆ PoseRelativeTo()

const std::string& sdf::SDF_VERSION_NAMESPACE::Model::PoseRelativeTo ( ) const

Get the name of the coordinate frame relative to which this object's pose is expressed.

An empty value indicates that the frame is relative to the parent model/world coordinate frame.

Returns
The name of the pose relative-to frame.

◆ RawPose()

const gz::math::Pose3d& sdf::SDF_VERSION_NAMESPACE::Model::RawPose ( ) const

Get the pose of the model.

This is the pose of the model as specified in SDF (<model> <pose> ... </pose></model>), and is typically used to express the position and rotation of a model in a global coordinate frame.

Returns
The pose of the model.

◆ ResolveAutoInertials()

void sdf::SDF_VERSION_NAMESPACE::Model::ResolveAutoInertials ( sdf::Errors _errors,
const ParserConfig _config 
)

Calculate and set the inertials for all the links belonging to the model object.

Parameters
[out]_errrorsA vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors
[in]_configCustom parser configuration

◆ SelfCollide()

bool sdf::SDF_VERSION_NAMESPACE::Model::SelfCollide ( ) const

Check if this model should self-collide.

A self-colliding model is a model whose links will collide if they come into contact. If a model is not self-colliding, its links will pass through each other.

Returns
true if the model should self-collide, false otherwise.

◆ SemanticPose()

sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Model::SemanticPose ( ) const

Get SemanticPose object of this object to aid in resolving poses.

Returns
SemanticPose object for this link.

◆ SetAllowAutoDisable()

void sdf::SDF_VERSION_NAMESPACE::Model::SetAllowAutoDisable ( bool  _allowAutoDisable)

Set this model to allow auto-disabling.

Parameters
[in]_allowAutoDisableTrue or false depending on whether the model should be allowed to auto-disable.
See also
AllowAutoDisable()

◆ SetCanonicalLinkName()

void sdf::SDF_VERSION_NAMESPACE::Model::SetCanonicalLinkName ( const std::string &  _canonicalLink)

Set the name of the model's canonical link.

An empty value indicates that the first link in the model or the first link found in a depth first search of nested models is the canonical link.

Parameters
[in]_canonicalLinkThe name of the canonical link.

◆ SetEnableWind()

void sdf::SDF_VERSION_NAMESPACE::Model::SetEnableWind ( bool  _enableWind)

Set whether this model should be subject to wind.

Parameters
[in]_enableWindTrue or false depending on whether the model should be subject to wind.

◆ SetName()

void sdf::SDF_VERSION_NAMESPACE::Model::SetName ( const std::string &  _name)

Set the name of the model.

The name of the model should be unique within the scope of a World.

Parameters
[in]_nameName of the model.

◆ SetPlacementFrameName()

void sdf::SDF_VERSION_NAMESPACE::Model::SetPlacementFrameName ( const std::string &  _name)

Set the name of the placement frame of the model.

The specified placement frame must exist within the model.

Parameters
[in]_nameName of the placement frame.

◆ SetPoseRelativeTo()

void sdf::SDF_VERSION_NAMESPACE::Model::SetPoseRelativeTo ( const std::string &  _frame)

Set the name of the coordinate frame relative to which this object's pose is expressed.

An empty value indicates that the frame is relative to the parent model/world coordinate frame.

Parameters
[in]_frameThe name of the pose relative-to frame.

◆ SetRawPose()

void sdf::SDF_VERSION_NAMESPACE::Model::SetRawPose ( const gz::math::Pose3d &  _pose)

Set the pose of the model.

See also
const gz::math::Pose3d &RawPose() const
Parameters
[in]_poseThe new model pose.

◆ SetSelfCollide()

void sdf::SDF_VERSION_NAMESPACE::Model::SetSelfCollide ( bool  _selfCollide)

Set this model to self-collide or not self-collide.

Parameters
[in]_selfCollideTrue or false depending on whether the model should self-collide.
See also
SelfCollide()

◆ SetStatic()

void sdf::SDF_VERSION_NAMESPACE::Model::SetStatic ( bool  _static)

Set this model to be static or not static.

Parameters
[in]_staticTrue or false depending on whether the model should be static.
See also
Static()

◆ SetUri()

void sdf::SDF_VERSION_NAMESPACE::Model::SetUri ( const std::string &  _uri)

Set the URI associated with this model.

Parameters
[in]_uriThe model's URI.

◆ Static()

bool sdf::SDF_VERSION_NAMESPACE::Model::Static ( ) const

Check if this model should be static.

A static model is one that is not subject to physical forces (in other words, it's purely kinematic instead of dynamic).

Returns
true if the model should be static, false if it is dynamic.

◆ ToElement()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Model::ToElement ( const OutputConfig _config = OutputConfig::GlobalConfig()) const

Create and return an SDF element filled with data from this model.

Note that parameter passing functionality is not captured with this function.

Parameters
[in]_configOutput configuration. When the ToElementUseIncludeTag policy is true, the model's URI is used to create an SDF <include> rather than a <model>. The model's URI must be first set using the Model::SetUri function. If the model's URI is empty, then a <model> element will be generated. The default is true so that URI values are used when ToElement is called from a World object. Make sure to use Model::SetUri even when the model is loaded from an <include> tag since the parser will automatically expand an <include> element to a <model> element.
Returns
SDF element pointer with updated model values.

◆ Uri()

std::string sdf::SDF_VERSION_NAMESPACE::Model::Uri ( ) const

Get the URI associated with this model.

Returns
The model's URI, or empty string if it has not been set.

◆ ValidateGraphs()

Errors sdf::SDF_VERSION_NAMESPACE::Model::ValidateGraphs ( ) const

Check that the FrameAttachedToGraph and PoseRelativeToGraph are valid.

Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

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