Loading...
Searching...
No Matches
Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::Frame Class Reference

A Frame element descibes the properties associated with an explicit frame defined in a Model or World. More...

#include <Frame.hh>

Public Member Functions

 Frame ()
 Default constructor.
 
const std::string & AttachedTo () const
 Get the name of the coordinate frame to which this frame is attached.
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load.
 
Errors Load (ElementPtr _sdf)
 Load the frame based on a element pointer.
 
const std::string & Name () const
 Get the name of the frame.
 
const std::string & PoseRelativeTo () const
 Get the name of the coordinate frame relative to which this frame's pose is expressed.
 
const gz::math::Pose3d & RawPose () const
 Get the pose of the frame object.
 
Errors ResolveAttachedToBody (std::string &_body) const
 Resolve the attached-to body of this frame from the FrameAttachedToGraph.
 
sdf::SemanticPose SemanticPose () const
 Get SemanticPose object of this object to aid in resolving poses.
 
void SetAttachedTo (const std::string &_frame)
 Set the name of the coordinate frame to which this frame is attached.
 
void SetName (const std::string &_name)
 Set the name of the frame.
 
void SetPoseRelativeTo (const std::string &_frame)
 Set the name of the coordinate frame relative to which this frame's pose is expressed.
 
void SetRawPose (const gz::math::Pose3d &_pose)
 Set the raw pose of the frame object.
 
sdf::ElementPtr ToElement () const
 Create and return an SDF element filled with data from this frame.
 
sdf::ElementPtr ToElement (sdf::Errors &_errors) const
 Create and return an SDF element filled with data from this frame.
 

Detailed Description

A Frame element descibes the properties associated with an explicit frame defined in a Model or World.

Constructor & Destructor Documentation

◆ Frame()

sdf::SDF_VERSION_NAMESPACE::Frame::Frame ( )

Default constructor.

Member Function Documentation

◆ AttachedTo()

const std::string & sdf::SDF_VERSION_NAMESPACE::Frame::AttachedTo ( ) const

Get the name of the coordinate frame to which this frame is attached.

The interpretation of an empty value depends on whether the frame is contained in a model or world element. For a frame that is a child of <model>, an empty value indicates that the frame is attached to the canonical link of the model. For a frame that is a child of <world> an empty value indicates that the frame is attached to the world frame.

Returns
The name of the attached-to frame.

◆ Element()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Frame::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.

◆ Load()

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

Load the frame 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.

◆ Name()

const std::string & sdf::SDF_VERSION_NAMESPACE::Frame::Name ( ) const

Get the name of the frame.

The name of the frame must be unique within the scope of its siblings.

Returns
Name of the frame.

◆ PoseRelativeTo()

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

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

An empty value indicates that the frame is expressed relative to the attached-to link.

Returns
The name of the relative-to frame.

◆ RawPose()

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

Get the pose of the frame object.

This is the pose of the frame as specified in SDF (<frame><pose> ... </pose></frame>). Use SemanticPose to compute the pose relative to a specific frame.

Returns
The pose of the frame object.

◆ ResolveAttachedToBody()

Errors sdf::SDF_VERSION_NAMESPACE::Frame::ResolveAttachedToBody ( std::string &  _body) const

Resolve the attached-to body of this frame from the FrameAttachedToGraph.

Generally, it resolves to the name of a link, but if it is in the world scope, it can resolve to "world".

Parameters
[out]_bodyName of body to which this frame is attached.
Returns
Errors.

◆ SemanticPose()

sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Frame::SemanticPose ( ) const

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

Returns
SemanticPose object for this link.

◆ SetAttachedTo()

void sdf::SDF_VERSION_NAMESPACE::Frame::SetAttachedTo ( const std::string &  _frame)

Set the name of the coordinate frame to which this frame is attached.

The interpretation of an empty value depends on whether the frame is contained in a model or world element. For a frame that is a child of <model>, an empty value indicates that the frame is attached to the canonical link of the model. For a frame that is a child of <world> an empty value indicates that the frame is attached to the world frame.

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

◆ SetName()

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

Set the name of the frame.

The name of the frame must be unique within the scope of its siblings.

Parameters
[in]_nameName of the frame.

◆ SetPoseRelativeTo()

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

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

An empty value indicates that the frame is expressed relative to the attached-to link.

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

◆ SetRawPose()

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

Set the raw pose of the frame object.

This is interpreted relative to the frame named in the //pose/@relative_to attribute.

See also
const gz::math::Pose3d &RawPose() const
Parameters
[in]_poseThe pose of the frame object.

◆ ToElement() [1/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Frame::ToElement ( ) const

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

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

Returns
SDF element pointer with updated frame values.

◆ ToElement() [2/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Frame::ToElement ( sdf::Errors _errors) const

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

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

Parameters
[out]_errorsVector of errors.
Returns
SDF element pointer with updated frame values.

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