#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 Link * | CanonicalLink () 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 Frame * | FrameByIndex (const uint64_t _index) const |
Get an immediate (not nested) child explicit frame based on an index. More... | |
Frame * | FrameByIndex (uint64_t _index) |
Get a mutable immediate (not nested) child explicit frame based on an index. More... | |
Frame * | FrameByName (const std::string &_name) |
Get a mutable explicit frame based on a name. More... | |
const Frame * | FrameByName (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 InterfaceModel > | InterfaceModelByIndex (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 NestedInclude * | InterfaceModelNestedIncludeByIndex (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 Joint * | JointByIndex (const uint64_t _index) const |
Get an immediate (not nested) child joint based on an index. More... | |
Joint * | JointByIndex (uint64_t _index) |
Get an immediate (not nested) mutable child joint based on an index. More... | |
Joint * | JointByName (const std::string &_name) |
Get a mubtable joint based on a name. More... | |
const Joint * | JointByName (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 Link * | LinkByIndex (const uint64_t _index) const |
Get an immediate (not nested) child link based on an index. More... | |
Link * | LinkByIndex (uint64_t _index) |
Get an immediate (not nested) mutable child link based on an index. More... | |
Link * | LinkByName (const std::string &_name) |
Get a mutable link based on a name. More... | |
const Link * | LinkByName (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 Model * | ModelByIndex (const uint64_t _index) const |
Get an immediate (not recursively nested) child model based on an index. More... | |
Model * | ModelByIndex (uint64_t _index) |
Get an immediate (not recursively nested) mutable child model. More... | |
Model * | ModelByName (const std::string &_name) |
Get a mutable nested model based on a name. More... | |
const Model * | ModelByName (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::Plugins & | Plugins () |
Get a mutable vector of plugins attached to this object. More... | |
const sdf::Plugins & | Plugins () 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... | |
sdf::SDF_VERSION_NAMESPACE::Model::Model | ( | ) |
Default constructor.
bool sdf::SDF_VERSION_NAMESPACE::Model::AddFrame | ( | const Frame & | _frame | ) |
Add a frame to the model.
[in] | _frame | Frame to add. |
bool sdf::SDF_VERSION_NAMESPACE::Model::AddJoint | ( | const Joint & | _joint | ) |
Add a joint to the model.
[in] | _link | Joint to add. |
bool sdf::SDF_VERSION_NAMESPACE::Model::AddLink | ( | const Link & | _link | ) |
Add a link to the model.
[in] | _link | Link to add. |
bool sdf::SDF_VERSION_NAMESPACE::Model::AddModel | ( | const Model & | _model | ) |
Add a model to the model.
[in] | _model | Model to add. |
void sdf::SDF_VERSION_NAMESPACE::Model::AddPlugin | ( | const Plugin & | _plugin | ) |
Add a plugin to this object.
[in] | _plugin | Plugin to add. |
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.
const Link * sdf::SDF_VERSION_NAMESPACE::Model::CanonicalLink | ( | ) | const |
Get the model's canonical link.
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 "::".
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.
void sdf::SDF_VERSION_NAMESPACE::Model::ClearFrames | ( | ) |
Remove all frames.
void sdf::SDF_VERSION_NAMESPACE::Model::ClearJoints | ( | ) |
Remove all joints.
void sdf::SDF_VERSION_NAMESPACE::Model::ClearLinks | ( | ) |
Remove all links.
void sdf::SDF_VERSION_NAMESPACE::Model::ClearModels | ( | ) |
Remove all models.
void sdf::SDF_VERSION_NAMESPACE::Model::ClearPlugins | ( | ) |
Remove all plugins.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Model::Element | ( | ) | const |
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.
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.
[in] | _index | Index of the explicit frame. The index should be in the range [0..FrameCount()). |
Frame * sdf::SDF_VERSION_NAMESPACE::Model::FrameByIndex | ( | uint64_t | _index | ) |
Get a mutable immediate (not nested) child explicit frame based on an index.
[in] | _index | Index of the explicit frame. The index should be in the range [0..FrameCount()). |
Frame * sdf::SDF_VERSION_NAMESPACE::Model::FrameByName | ( | const std::string & | _name | ) |
Get a mutable explicit frame based on a name.
[in] | _name | Name 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 "::". |
const Frame * sdf::SDF_VERSION_NAMESPACE::Model::FrameByName | ( | const std::string & | _name | ) | const |
Get an explicit frame based on a name.
[in] | _name | Name 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 "::". |
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.
bool sdf::SDF_VERSION_NAMESPACE::Model::FrameNameExists | ( | const std::string & | _name | ) | const |
Get whether an explicit frame name exists.
[in] | _name | Name 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 "::". |
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.
[in] | _index | Index of the nested interface model. The index should be in the range [0..InterfaceModelCount()). |
uint64_t sdf::SDF_VERSION_NAMESPACE::Model::InterfaceModelCount | ( | ) | const |
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.
[in] | _index | Index of the nested interface model. The index should be in the range [0..InterfaceModelCount()). |
const Joint * sdf::SDF_VERSION_NAMESPACE::Model::JointByIndex | ( | const uint64_t | _index | ) | const |
Get an immediate (not nested) child joint based on an index.
[in] | _index | Index of the joint. The index should be in the range [0..JointCount()). |
Joint * sdf::SDF_VERSION_NAMESPACE::Model::JointByIndex | ( | uint64_t | _index | ) |
Get an immediate (not nested) mutable child joint based on an index.
[in] | _index | Index of the joint. The index should be in the range [0..JointCount()). |
Joint * sdf::SDF_VERSION_NAMESPACE::Model::JointByName | ( | const std::string & | _name | ) |
Get a mubtable joint based on a name.
[in] | _name | Name 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 "::". |
const Joint * sdf::SDF_VERSION_NAMESPACE::Model::JointByName | ( | const std::string & | _name | ) | const |
Get a joint based on a name.
[in] | _name | Name 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 "::". |
uint64_t sdf::SDF_VERSION_NAMESPACE::Model::JointCount | ( | ) | const |
Get the number of joints that are immediate (not nested) children of this Model object.
bool sdf::SDF_VERSION_NAMESPACE::Model::JointNameExists | ( | const std::string & | _name | ) | const |
Get whether a joint name exists.
[in] | _name | Name 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 "::". |
const Link * sdf::SDF_VERSION_NAMESPACE::Model::LinkByIndex | ( | const uint64_t | _index | ) | const |
Get an immediate (not nested) child link based on an index.
[in] | _index | Index of the link. The index should be in the range [0..LinkCount()). |
Link * sdf::SDF_VERSION_NAMESPACE::Model::LinkByIndex | ( | uint64_t | _index | ) |
Get an immediate (not nested) mutable child link based on an index.
[in] | _index | Index of the link. The index should be in the range [0..LinkCount()). |
Link * sdf::SDF_VERSION_NAMESPACE::Model::LinkByName | ( | const std::string & | _name | ) |
Get a mutable link based on a name.
[in] | _name | Name 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 "::". |
const Link * sdf::SDF_VERSION_NAMESPACE::Model::LinkByName | ( | const std::string & | _name | ) | const |
Get a link based on a name.
[in] | _name | Name 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 "::". |
uint64_t sdf::SDF_VERSION_NAMESPACE::Model::LinkCount | ( | ) | const |
Get the number of links that are immediate (not nested) children of this Model object.
bool sdf::SDF_VERSION_NAMESPACE::Model::LinkNameExists | ( | const std::string & | _name | ) | const |
Get whether a link name exists.
[in] | _name | Name 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 "::". |
Errors sdf::SDF_VERSION_NAMESPACE::Model::Load | ( | ElementPtr | _sdf | ) |
Errors sdf::SDF_VERSION_NAMESPACE::Model::Load | ( | sdf::ElementPtr | _sdf, |
const ParserConfig & | _config | ||
) |
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.
[in] | _index | Index of the nested model. The index should be in the range [0..ModelCount()). |
Model * sdf::SDF_VERSION_NAMESPACE::Model::ModelByIndex | ( | uint64_t | _index | ) |
Get an immediate (not recursively nested) mutable child model.
[in] | _index | Index of the nested model. The index should be in the range [0..ModelCount()). |
Model * sdf::SDF_VERSION_NAMESPACE::Model::ModelByName | ( | const std::string & | _name | ) |
Get a mutable nested model based on a name.
[in] | _name | Name 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 "::". |
const Model * sdf::SDF_VERSION_NAMESPACE::Model::ModelByName | ( | const std::string & | _name | ) | const |
Get a nested model based on a name.
[in] | _name | Name 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 "::". |
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.
bool sdf::SDF_VERSION_NAMESPACE::Model::ModelNameExists | ( | const std::string & | _name | ) | const |
Get whether a nested model name exists.
[in] | _name | Name 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 "::". |
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.
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.
[in] | _name | Name 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 "::". |
const std::string & sdf::SDF_VERSION_NAMESPACE::Model::PlacementFrameName | ( | ) | const |
Get the name of the placement frame of the model.
sdf::Plugins & sdf::SDF_VERSION_NAMESPACE::Model::Plugins | ( | ) |
Get a mutable vector of plugins attached to this object.
const sdf::Plugins & sdf::SDF_VERSION_NAMESPACE::Model::Plugins | ( | ) | const |
Get the plugins attached to this object.
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.
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.
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.
[out] | _errrors | A vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors |
[in] | _config | Custom parser configuration |
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.
sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Model::SemanticPose | ( | ) | const |
Get SemanticPose object of this object to aid in resolving poses.
void sdf::SDF_VERSION_NAMESPACE::Model::SetAllowAutoDisable | ( | bool | _allowAutoDisable | ) |
Set this model to allow auto-disabling.
[in] | _allowAutoDisable | True or false depending on whether the model should be allowed to auto-disable. |
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.
[in] | _canonicalLink | The name of the canonical link. |
void sdf::SDF_VERSION_NAMESPACE::Model::SetEnableWind | ( | bool | _enableWind | ) |
Set whether this model should be subject to wind.
[in] | _enableWind | True or false depending on whether the model should be subject to wind. |
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.
[in] | _name | Name of the model. |
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.
[in] | _name | Name of the placement frame. |
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.
[in] | _frame | The name of the pose relative-to frame. |
void sdf::SDF_VERSION_NAMESPACE::Model::SetRawPose | ( | const gz::math::Pose3d & | _pose | ) |
Set the pose of the model.
[in] | _pose | The new model pose. |
void sdf::SDF_VERSION_NAMESPACE::Model::SetSelfCollide | ( | bool | _selfCollide | ) |
Set this model to self-collide or not self-collide.
[in] | _selfCollide | True or false depending on whether the model should self-collide. |
void sdf::SDF_VERSION_NAMESPACE::Model::SetStatic | ( | bool | _static | ) |
Set this model to be static or not static.
[in] | _static | True or false depending on whether the model should be static. |
void sdf::SDF_VERSION_NAMESPACE::Model::SetUri | ( | const std::string & | _uri | ) |
Set the URI associated with this model.
[in] | _uri | The model's URI. |
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).
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.
[in] | _config | Output 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. |
std::string sdf::SDF_VERSION_NAMESPACE::Model::Uri | ( | ) | const |
Get the URI associated with this model.
Errors sdf::SDF_VERSION_NAMESPACE::Model::ValidateGraphs | ( | ) | const |