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

#include <Joint.hh>

Public Member Functions

 Joint ()
 Default constructor. More...
 
bool AddSensor (const Sensor &_sensor)
 Add a sensors to the joint. More...
 
const JointAxisAxis (const unsigned int _index=0) const
 Get a joint axis. More...
 
const std::string & ChildLinkName () const
 Get the name of this joint's child link. More...
 
void ClearSensors ()
 Remove all sensors. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
Errors Load (ElementPtr _sdf)
 Load the joint based on a element pointer. More...
 
const std::string & Name () const
 Get the name of the joint. More...
 
const std::string & ParentLinkName () const
 Get the name of this joint's parent link. 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 joint. More...
 
Errors ResolveChildLink (std::string &_link) const
 Resolve the name of the child link from the FrameAttachedToGraph. More...
 
Errors ResolveParentLink (std::string &_link) const
 Resolve the name of the parent link from the FrameAttachedToGraph. More...
 
sdf::SemanticPose SemanticPose () const
 Get SemanticPose object of this object to aid in resolving poses. More...
 
const SensorSensorByIndex (const uint64_t _index) const
 Get a sensor based on an index. More...
 
SensorSensorByIndex (uint64_t _index)
 Get a mutable sensor based on an index. More...
 
SensorSensorByName (const std::string &_name)
 Get a mutable sensor based on a name. More...
 
const SensorSensorByName (const std::string &_name) const
 Get a sensor based on a name. More...
 
uint64_t SensorCount () const
 Get the number of sensors. More...
 
bool SensorNameExists (const std::string &_name) const
 Get whether a sensor name exists. More...
 
void SetAxis (const unsigned int _index, const JointAxis &_axis)
 Set a joint axis. More...
 
void SetChildLinkName (const std::string &_name)
 Set the name of the child link. More...
 
void SetName (const std::string &_name)
 Set the name of the joint. More...
 
void SetParentLinkName (const std::string &_name)
 Set the name of the parent link. 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 joint. More...
 
void SetThreadPitch (double _threadPitch)
 Set the thread pitch (only valid for screw joints) More...
 
void SetType (const JointType _jointType)
 Set the joint type. More...
 
double ThreadPitch () const
 Get the thread pitch (only valid for screw joints) More...
 
sdf::ElementPtr ToElement () const
 Create and return an SDF element filled with data from this joint. More...
 
JointType Type () const
 Get the joint type. More...
 

Constructor & Destructor Documentation

◆ Joint()

sdf::SDF_VERSION_NAMESPACE::Joint::Joint ( )

Default constructor.

Member Function Documentation

◆ AddSensor()

bool sdf::SDF_VERSION_NAMESPACE::Joint::AddSensor ( const Sensor _sensor)

Add a sensors to the joint.

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

◆ Axis()

const JointAxis* sdf::SDF_VERSION_NAMESPACE::Joint::Axis ( const unsigned int  _index = 0) const

Get a joint axis.

Parameters
[in]_indexThis value specifies which axis to get. A value of zero corresponds to the first axis, which is the <axis> SDF element. Any other value will return the second axis, which is the <axis2> SDF element.
Returns
A JointAxis for either the first or second joint axis. A return value of nullptr indicates that the axis is not specified.

◆ ChildLinkName()

const std::string& sdf::SDF_VERSION_NAMESPACE::Joint::ChildLinkName ( ) const

Get the name of this joint's child link.

Returns
The name of the child link.

◆ ClearSensors()

void sdf::SDF_VERSION_NAMESPACE::Joint::ClearSensors ( )

Remove all sensors.

◆ Element()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Joint::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::Joint::Load ( ElementPtr  _sdf)

Load the joint 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::Joint::Name ( ) const

Get the name of the joint.

The name of the joint must be unique within the scope of a Model.

Returns
Name of the joint.

◆ ParentLinkName()

const std::string& sdf::SDF_VERSION_NAMESPACE::Joint::ParentLinkName ( ) const

Get the name of this joint's parent link.

Returns
The name of the parent link.

◆ PoseRelativeTo()

const std::string& sdf::SDF_VERSION_NAMESPACE::Joint::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 child link frame.

Returns
The name of the pose relative-to frame.

◆ RawPose()

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

Get the pose of the joint.

This is the pose of the joint as specified in SDF (<joint> <pose> ... </pose></joint>). Transformations have not been applied to the return value.

Returns
The pose of the joint. This is the raw pose value, as set in the SDF file.

◆ ResolveChildLink()

Errors sdf::SDF_VERSION_NAMESPACE::Joint::ResolveChildLink ( std::string &  _link) const

Resolve the name of the child link from the FrameAttachedToGraph.

Parameters
[out]_bodyName of child link of this joint.
Returns
Errors.

◆ ResolveParentLink()

Errors sdf::SDF_VERSION_NAMESPACE::Joint::ResolveParentLink ( std::string &  _link) const

Resolve the name of the parent link from the FrameAttachedToGraph.

It will return the name of a link or "world".

Parameters
[out]_bodyName of parent link of this joint.
Returns
Errors.

◆ SemanticPose()

sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Joint::SemanticPose ( ) const

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

Returns
SemanticPose object for this link.

◆ SensorByIndex() [1/2]

const Sensor* sdf::SDF_VERSION_NAMESPACE::Joint::SensorByIndex ( const uint64_t  _index) const

Get a sensor based on an index.

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

◆ SensorByIndex() [2/2]

Sensor* sdf::SDF_VERSION_NAMESPACE::Joint::SensorByIndex ( uint64_t  _index)

Get a mutable sensor based on an index.

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

◆ SensorByName() [1/2]

Sensor* sdf::SDF_VERSION_NAMESPACE::Joint::SensorByName ( const std::string &  _name)

Get a mutable sensor based on a name.

Parameters
[in]_nameName of the sensor.
Returns
Pointer to the sensor. Nullptr if a sensor with the given name does not exist.
See also
bool SensorNameExists(const std::string &_name) const

◆ SensorByName() [2/2]

const Sensor* sdf::SDF_VERSION_NAMESPACE::Joint::SensorByName ( const std::string &  _name) const

Get a sensor based on a name.

Parameters
[in]_nameName of the sensor.
Returns
Pointer to the sensor. Nullptr if a sensor with the given name does not exist.
See also
bool SensorNameExists(const std::string &_name) const

◆ SensorCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::Joint::SensorCount ( ) const

Get the number of sensors.

Returns
Number of sensors contained in this Joint object.

◆ SensorNameExists()

bool sdf::SDF_VERSION_NAMESPACE::Joint::SensorNameExists ( const std::string &  _name) const

Get whether a sensor name exists.

Parameters
[in]_nameName of the sensor to check.
Returns
True if there exists a sensor with the given name.

◆ SetAxis()

void sdf::SDF_VERSION_NAMESPACE::Joint::SetAxis ( const unsigned int  _index,
const JointAxis _axis 
)

Set a joint axis.

Parameters
[in]_indexThis value specifies which axis to set. A value of zero corresponds to the first axis, which is the <axis> SDF element. Any other value will set the second axis, which is the <axis2> SDF element.
[in]_axisThe JointAxis of the joint

◆ SetChildLinkName()

void sdf::SDF_VERSION_NAMESPACE::Joint::SetChildLinkName ( const std::string &  _name)

Set the name of the child link.

Parameters
[in]_nameName of the child link.

◆ SetName()

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

Set the name of the joint.

The name of the joint must be unique within the scope of a Model.

Parameters
[in]_nameName of the joint.

◆ SetParentLinkName()

void sdf::SDF_VERSION_NAMESPACE::Joint::SetParentLinkName ( const std::string &  _name)

Set the name of the parent link.

Parameters
[in]_nameName of the parent link.

◆ SetPoseRelativeTo()

void sdf::SDF_VERSION_NAMESPACE::Joint::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 child link frame.

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

◆ SetRawPose()

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

Set the pose of the joint.

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

◆ SetThreadPitch()

void sdf::SDF_VERSION_NAMESPACE::Joint::SetThreadPitch ( double  _threadPitch)

Set the thread pitch (only valid for screw joints)

Parameters
[in]_threadPitchThe thread pitch of the joint

◆ SetType()

void sdf::SDF_VERSION_NAMESPACE::Joint::SetType ( const JointType  _jointType)

Set the joint type.

Parameters
[in]_jointTypeThe type of joint.

◆ ThreadPitch()

double sdf::SDF_VERSION_NAMESPACE::Joint::ThreadPitch ( ) const

Get the thread pitch (only valid for screw joints)

Returns
The thread pitch

◆ ToElement()

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

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

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

Returns
SDF element pointer with updated joint values.

◆ Type()

JointType sdf::SDF_VERSION_NAMESPACE::Joint::Type ( ) const

Get the joint type.

Returns
Type of joint.

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