24#include <gz/math/Pose3.hh>
25#include <gz/utils/ImplPtr.hh>
38 inline namespace SDF_VERSION_NAMESPACE {
48 struct PoseRelativeToGraph;
49 struct FrameAttachedToGraph;
50 template <
typename T>
class ScopedGraph;
85 public: std::string
Name()
const;
90 public:
void SetName(
const std::string &_name);
331 public:
const gz::math::Pose3d &
RawPose()
const;
409 const uint64_t _index)
const;
419 const uint64_t _index)
const;
448 const std::string &_name)
const;
488 public: std::string
Uri()
const;
492 public:
void SetUri(
const std::string &_uri);
524 private:
void SetPoseRelativeToGraph(
532 private:
void SetFrameAttachedToGraph(
537 private:
const std::vector<std::pair<std::optional<sdf::NestedInclude>,
543 private:
bool IsMerged()
const;
556 const std::string &_parentOfProxyFrame);
565 friend struct ModelWrapper;
568 GZ_UTILS_IMPL_PTR(dataPtr)
A Frame element descibes the properties associated with an explicit frame defined in a Model or World...
Definition: Frame.hh:43
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
bool AddModel(const Model &_model)
Add a model to the model.
bool AddJoint(const Joint &_joint)
Add a joint to the model.
void SetStatic(bool _static)
Set this model to be static or not static.
sdf::Plugins & Plugins()
Get a mutable vector of plugins attached to this object.
void ClearLinks()
Remove all links.
Joint * JointByName(const std::string &_name)
Get a mubtable joint based on a name.
const Link * LinkByIndex(const uint64_t _index) const
Get an immediate (not nested) child link based on an index.
uint64_t ModelCount() const
Get the number of nested models that are immediate (not recursively nested) children of this Model ob...
const std::string & CanonicalLinkName() const
Get the name of the model's canonical link.
uint64_t LinkCount() const
Get the number of links that are immediate (not nested) children of this Model object.
void SetUri(const std::string &_uri)
Set the URI associated with this model.
const gz::math::Pose3d & RawPose() const
Get the pose of the model.
bool JointNameExists(const std::string &_name) const
Get whether a joint name exists.
bool AddLink(const Link &_link)
Add a link to the model.
void SetCanonicalLinkName(const std::string &_canonicalLink)
Set the name of the model's canonical link.
std::string Name() const
Get the name of the model.
void SetAllowAutoDisable(bool _allowAutoDisable)
Set this model to allow auto-disabling.
bool FrameNameExists(const std::string &_name) const
Get whether an explicit frame name exists.
Joint * JointByIndex(uint64_t _index)
Get an immediate (not nested) mutable child joint based on an index.
void AddPlugin(const Plugin &_plugin)
Add a plugin to this object.
std::string Uri() const
Get the URI associated with this model.
const Link * LinkByName(const std::string &_name) const
Get a link based on a name.
void ClearPlugins()
Remove all plugins.
const Frame * FrameByIndex(const uint64_t _index) const
Get an immediate (not nested) child explicit frame based on an index.
bool LinkNameExists(const std::string &_name) const
Get whether a link name exists.
Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config)
Load the model based on a element pointer.
void ResolveAutoInertials(sdf::Errors &_errors, const ParserConfig &_config)
Calculate and set the inertials for all the links belonging to the model object.
void ClearJoints()
Remove all joints.
Link * LinkByName(const std::string &_name)
Get a mutable link based on a name.
std::shared_ptr< const InterfaceModel > InterfaceModelByIndex(const uint64_t _index) const
Get an immediate (not recursively nested) child interface model based on an index.
bool Static() const
Check if this model should be static.
void SetPoseRelativeTo(const std::string &_frame)
Set the name of the coordinate frame relative to which this object's pose is expressed.
uint64_t InterfaceModelCount() const
Get the number of nested interface models that are immediate (not recursively nested) children of thi...
void SetSelfCollide(bool _selfCollide)
Set this model to self-collide or not self-collide.
const std::string & PlacementFrameName() const
Get the name of the placement frame of the model.
sdf::SemanticPose SemanticPose() const
Get SemanticPose object of this object to aid in resolving poses.
const sdf::Plugins & Plugins() const
Get the plugins attached to this object.
uint64_t FrameCount() const
Get the number of explicit frames that are immediate (not nested) children of this Model object.
Errors Load(ElementPtr _sdf)
Load the model based on a element pointer.
void ClearModels()
Remove all models.
bool SelfCollide() const
Check if this model should self-collide.
void ClearFrames()
Remove all frames.
void SetEnableWind(bool _enableWind)
Set whether this model should be subject to wind.
const Link * CanonicalLink() const
Get the model's canonical link.
bool EnableWind() const
Check if this model should be subject to wind.
uint64_t JointCount() const
Get the number of joints that are immediate (not nested) children of this Model object.
Model * ModelByName(const std::string &_name)
Get a mutable nested model based on a name.
const Frame * FrameByName(const std::string &_name) const
Get an explicit frame based on a name.
const Joint * JointByName(const std::string &_name) const
Get a joint based on a name.
bool NameExistsInFrameAttachedToGraph(const std::string &_name) const
Check if a given name exists in the FrameAttachedTo graph at the scope of the model.
bool AllowAutoDisable() const
Check if this model should be allowed to auto-disable.
const Model * ModelByName(const std::string &_name) const
Get a nested model based on a name.
bool ModelNameExists(const std::string &_name) const
Get whether a nested model name exists.
Frame * FrameByIndex(uint64_t _index)
Get a mutable immediate (not nested) child explicit frame based on an index.
void SetRawPose(const gz::math::Pose3d &_pose)
Set the pose of the model.
Model()
Default constructor.
void SetPlacementFrameName(const std::string &_name)
Set the name of the placement frame of the model.
Frame * FrameByName(const std::string &_name)
Get a mutable explicit frame based on a name.
Link * LinkByIndex(uint64_t _index)
Get an immediate (not nested) mutable child link based on an index.
const Joint * JointByIndex(const uint64_t _index) const
Get an immediate (not nested) child joint based on an index.
const Model * ModelByIndex(const uint64_t _index) const
Get an immediate (not recursively nested) child model based on an index.
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,...
sdf::ElementPtr ToElement(const OutputConfig &_config=OutputConfig::GlobalConfig()) const
Create and return an SDF element filled with data from this model.
void SetName(const std::string &_name)
Set the name of the model.
Model * ModelByIndex(uint64_t _index)
Get an immediate (not recursively nested) mutable child model.
const NestedInclude * InterfaceModelNestedIncludeByIndex(const uint64_t _index) const
Get the nested include information of an immediate (not recursively nested) child interface model bas...
bool AddFrame(const Frame &_frame)
Add a frame to the model.
Errors ValidateGraphs() const
Check that the FrameAttachedToGraph and PoseRelativeToGraph are valid.
const std::string & PoseRelativeTo() const
Get the name of the coordinate frame relative to which this object's pose is expressed.
Contains the necessary information about an included model file for custom model parsers to be able t...
Definition: InterfaceElements.hh:46
This class contains configuration options for SDF output.
Definition: OutputConfig.hh:59
static OutputConfig & GlobalConfig()
Mutable access to a singleton OutputConfig that serves as the global OutputConfig object for all pars...
This class contains configuration options for the libsdformat parser.
Definition: ParserConfig.hh:100
Root class that acts as an entry point to the SDF document model.
Definition: Root.hh:58
Definition: Collision.hh:43
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:55
std::shared_ptr< const InterfaceModel > InterfaceModelConstPtr
Definition: InterfaceModel.hh:50
std::vector< Plugin > Plugins
A vector of Plugin.
Definition: Plugin.hh:245
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
namespace for Simulation Description Format parser
Definition: Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:25