Public Member Functions | List of all members
sdf::v9::Actor Class Reference

Provides a description of an actor. More...

#include <Actor.hh>

Public Member Functions

 Actor ()
 Default constructor. More...
 
 Actor (Actor &&_actor) noexcept
 Move constructor. More...
 
 Actor (const Actor &_actor)
 Copy constructor. More...
 
 ~Actor ()
 Destructor. More...
 
void AddAnimation (const Animation &_anim)
 Add a new animation. More...
 
void AddTrajectory (const Trajectory &_traj)
 Add a new trajectory. More...
 
const AnimationAnimationByIndex (uint64_t _index) const
 Get an animation based on an index. More...
 
uint64_t AnimationCount () const
 Get the number of animations. More...
 
bool AnimationNameExists (const std::string &_name) const
 Get whether an animation name exists. More...
 
void CopyFrom (const Actor &_actor)
 Copy dataPtr from an actor instance. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
const std::string & FilePath () const
 The path to the file where this element was loaded from. More...
 
const JointJointByIndex (uint64_t _index) const
 Get a joint based on an index. More...
 
uint64_t JointCount () const
 Get the number of joints. More...
 
bool JointNameExists (const std::string &_name) const
 Get whether a joint name exists. More...
 
const LinkLinkByIndex (uint64_t _index) const
 Get a link based on an index. More...
 
uint64_t LinkCount () const
 Get the number of links. More...
 
bool LinkNameExists (const std::string &_name) const
 Get whether a link name exists. More...
 
Errors Load (ElementPtr _sdf)
 Load the actor based on a element pointer. More...
 
std::string & Name () const
 Get the name of the actor. More...
 
Actoroperator= (Actor &&_actor)
 Move assignment operator. More...
 
Actoroperator= (const Actor &_actor)
 Assignment operator. More...
 
const gz::math::Pose3d & Pose () const SDF_DEPRECATED(9.0)
 Get the pose of the actor. More...
 
const std::string & PoseFrame () const SDF_DEPRECATED(9.0)
 Get the name of the coordinate frame in which this actor's pose is expressed. 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 actor. More...
 
bool ScriptAutoStart () const
 Get whether the animation plays when simulation starts. More...
 
double ScriptDelayStart () const
 Get the time (in seconds) of delay to start. More...
 
bool ScriptLoop () const
 Get whether the animation plays in loop. More...
 
void SetFilePath (const std::string &_filePath)
 Set the path to the file where this element was loaded from. More...
 
void SetName (const std::string &_name)
 Set the name of the actor. More...
 
void SetPose (const gz::math::Pose3d &_pose) SDF_DEPRECATED(9.0)
 Set the pose of the actor. More...
 
void SetPoseFrame (const std::string &_frame) SDF_DEPRECATED(9.0)
 Set the name of the coordinate frame in which this actor's pose is expressed. 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 actor. More...
 
void SetScriptAutoStart (bool _scriptAutoStart)
 Set whether the animation plays when simulation starts. More...
 
void SetScriptDelayStart (double _scriptDelayStart)
 Set the delay time to start. More...
 
void SetScriptLoop (bool _scriptLoop)
 Set whether the animation plays in loop. More...
 
void SetSkinFilename (std::string _skinFilename)
 Set the skin filename. More...
 
void SetSkinScale (double _skinScale)
 Set the skin scale. More...
 
const std::string & SkinFilename () const
 Get the skin filename. More...
 
double SkinScale () const
 Get the skin scale. More...
 
const TrajectoryTrajectoryByIndex (uint64_t _index) const
 Get a trajectory based on an index. More...
 
uint64_t TrajectoryCount () const
 Get the number of trajectories. More...
 
bool TrajectoryIdExists (uint64_t _id) const
 Get whether a trajectory id exists. More...
 

Detailed Description

Provides a description of an actor.

Constructor & Destructor Documentation

◆ Actor() [1/3]

sdf::v9::Actor::Actor ( )

Default constructor.

◆ Actor() [2/3]

sdf::v9::Actor::Actor ( const Actor _actor)

Copy constructor.

Parameters
[in]_actorActor to copy.

◆ Actor() [3/3]

sdf::v9::Actor::Actor ( Actor &&  _actor)
noexcept

Move constructor.

Parameters
[in]_actorActor to move.

◆ ~Actor()

sdf::v9::Actor::~Actor ( )

Destructor.

Member Function Documentation

◆ AddAnimation()

void sdf::v9::Actor::AddAnimation ( const Animation _anim)

Add a new animation.

Parameters
[in]_animAnimation to be added.

◆ AddTrajectory()

void sdf::v9::Actor::AddTrajectory ( const Trajectory _traj)

Add a new trajectory.

Parameters
[in]_trajTrajectory to be added.

◆ AnimationByIndex()

const Animation* sdf::v9::Actor::AnimationByIndex ( uint64_t  _index) const

Get an animation based on an index.

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

◆ AnimationCount()

uint64_t sdf::v9::Actor::AnimationCount ( ) const

Get the number of animations.

Returns
Number of animations.

◆ AnimationNameExists()

bool sdf::v9::Actor::AnimationNameExists ( const std::string &  _name) const

Get whether an animation name exists.

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

◆ CopyFrom()

void sdf::v9::Actor::CopyFrom ( const Actor _actor)

Copy dataPtr from an actor instance.

Parameters
[in]_actorThe actor to set values from.

◆ Element()

sdf::ElementPtr sdf::v9::Actor::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.

◆ FilePath()

const std::string& sdf::v9::Actor::FilePath ( ) const

The path to the file where this element was loaded from.

Returns
Full path to the file on disk.

◆ JointByIndex()

const Joint* sdf::v9::Actor::JointByIndex ( uint64_t  _index) const

Get a 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

◆ JointCount()

uint64_t sdf::v9::Actor::JointCount ( ) const

Get the number of joints.

Returns
Number of joints.

◆ JointNameExists()

bool sdf::v9::Actor::JointNameExists ( const std::string &  _name) const

Get whether a joint name exists.

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

◆ LinkByIndex()

const Link* sdf::v9::Actor::LinkByIndex ( uint64_t  _index) const

Get a 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

◆ LinkCount()

uint64_t sdf::v9::Actor::LinkCount ( ) const

Get the number of links.

Returns
Number of links.

◆ LinkNameExists()

bool sdf::v9::Actor::LinkNameExists ( const std::string &  _name) const

Get whether a link name exists.

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

◆ Load()

Errors sdf::v9::Actor::Load ( ElementPtr  _sdf)

Load the actor 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()

std::string& sdf::v9::Actor::Name ( ) const

Get the name of the actor.

Returns
Name of the actor.

◆ operator=() [1/2]

Actor& sdf::v9::Actor::operator= ( Actor &&  _actor)

Move assignment operator.

Parameters
[in]_actorActor to move.
Returns
Reference to this.

◆ operator=() [2/2]

Actor& sdf::v9::Actor::operator= ( const Actor _actor)

Assignment operator.

Parameters
[in]_actorThe actor to set values from.
Returns
*this

◆ Pose()

const gz::math::Pose3d& sdf::v9::Actor::Pose ( ) const

Get the pose of the actor.

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

Returns
The pose of the actor.
Deprecated:
See RawPose.

◆ PoseFrame()

const std::string& sdf::v9::Actor::PoseFrame ( ) const

Get the name of the coordinate frame in which this actor's pose is expressed.

A empty value indicates that the frame is the global/world coordinate frame.

Returns
The name of the pose frame.
Deprecated:
See PoseRelativeTo.

◆ PoseRelativeTo()

const std::string& sdf::v9::Actor::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 world frame.

Returns
The name of the pose relative-to frame.

◆ RawPose()

const gz::math::Pose3d& sdf::v9::Actor::RawPose ( ) const

Get the pose of the actor.

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

Returns
The pose of the actor.

◆ ScriptAutoStart()

bool sdf::v9::Actor::ScriptAutoStart ( ) const

Get whether the animation plays when simulation starts.

Returns
True if the animation plays when simulation starts.

◆ ScriptDelayStart()

double sdf::v9::Actor::ScriptDelayStart ( ) const

Get the time (in seconds) of delay to start.

Returns
Time of delay to start.

◆ ScriptLoop()

bool sdf::v9::Actor::ScriptLoop ( ) const

Get whether the animation plays in loop.

Returns
True if the animation plays in loop.

◆ SetFilePath()

void sdf::v9::Actor::SetFilePath ( const std::string &  _filePath)

Set the path to the file where this element was loaded from.

\paramp[in] _filePath Full path to the file on disk.

◆ SetName()

void sdf::v9::Actor::SetName ( const std::string &  _name)

Set the name of the actor.

Parameters
[in]_nameName of the actor.

◆ SetPose()

void sdf::v9::Actor::SetPose ( const gz::math::Pose3d &  _pose)

Set the pose of the actor.

See also
const gz::math::Pose3d &Pose() const
Parameters
[in]_poseThe new actor pose.
Deprecated:
See SetRawPose.

◆ SetPoseFrame()

void sdf::v9::Actor::SetPoseFrame ( const std::string &  _frame)

Set the name of the coordinate frame in which this actor's pose is expressed.

A empty value indicates that the frame is the global/world coordinate frame.

Parameters
[in]_frameThe name of the pose frame.
Deprecated:
See SetPoseRelativeTo.

◆ SetPoseRelativeTo()

void sdf::v9::Actor::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 world frame.

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

◆ SetRawPose()

void sdf::v9::Actor::SetRawPose ( const gz::math::Pose3d &  _pose)

Set the pose of the actor.

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

◆ SetScriptAutoStart()

void sdf::v9::Actor::SetScriptAutoStart ( bool  _scriptAutoStart)

Set whether the animation plays when simulation starts.

Parameters
[in]_staticAutoStartTrue to indicate that the animation plays when simulation starts.

◆ SetScriptDelayStart()

void sdf::v9::Actor::SetScriptDelayStart ( double  _scriptDelayStart)

Set the delay time to start.

Parameters
[in]_scriptDelayStartTime of delay to start.

◆ SetScriptLoop()

void sdf::v9::Actor::SetScriptLoop ( bool  _scriptLoop)

Set whether the animation plays in loop.

Parameters
[in]_scriptLoopTrue to indicate that the animation plays in loop.

◆ SetSkinFilename()

void sdf::v9::Actor::SetSkinFilename ( std::string  _skinFilename)

Set the skin filename.

Parameters
[in]_skinFilenameSkin filename.

◆ SetSkinScale()

void sdf::v9::Actor::SetSkinScale ( double  _skinScale)

Set the skin scale.

Parameters
[in]_skinScaleSkin scale.

◆ SkinFilename()

const std::string& sdf::v9::Actor::SkinFilename ( ) const

Get the skin filename.

Returns
Constant skin filename.

◆ SkinScale()

double sdf::v9::Actor::SkinScale ( ) const

Get the skin scale.

Returns
Constant skin filename.

◆ TrajectoryByIndex()

const Trajectory* sdf::v9::Actor::TrajectoryByIndex ( uint64_t  _index) const

Get a trajectory based on an index.

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

◆ TrajectoryCount()

uint64_t sdf::v9::Actor::TrajectoryCount ( ) const

Get the number of trajectories.

Returns
Number of trajectories.

◆ TrajectoryIdExists()

bool sdf::v9::Actor::TrajectoryIdExists ( uint64_t  _id) const

Get whether a trajectory id exists.

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

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