Gazebo Common

API Reference

6.0.0
TrajectoryInfo Class Reference

Information about a trajectory for an animation (e.g., Actor) This contains the keyframe information. More...

#include <Animation.hh>

Public Member Functions

 TrajectoryInfo ()
 Constructor.
 
unsigned int AnimIndex () const
 Return the animation index.
 
double DistanceSoFar (const std::chrono::steady_clock::duration &_time) const
 Get the distance covered by the trajectory by a given time.
 
std::chrono::steady_clock::duration Duration () const
 Return the duration of the trajectory.
 
std::chrono::steady_clock::time_point EndTime () const
 Return the end time of the trajectory.
 
unsigned int Id () const
 Return the id of the trajectory.
 
void SetAnimIndex (unsigned int _index)
 Set the animation index.
 
void SetEndTime (const std::chrono::steady_clock::time_point &_endTime)
 Set the end time of the trajectory.
 
void SetId (unsigned int _id)
 Set the id of the trajectory.
 
void SetStartTime (const std::chrono::steady_clock::time_point &_startTime)
 Set the start time of the trajectory.
 
void SetTranslated (bool _translated)
 Set whether the trajectory is translated.
 
void SetWaypoints (std::map< std::chrono::steady_clock::time_point, math::Pose3d > _waypoints, double _tension=0.0)
 Load all waypoints in the trajectory.
 
std::chrono::steady_clock::time_point StartTime () const
 Return the start time of the trajectory.
 
bool Translated () const
 Return whether the trajectory is translated.
 
common::PoseAnimationWaypoints () const
 Return the waypoints in the trajectory.
 

Detailed Description

Information about a trajectory for an animation (e.g., Actor) This contains the keyframe information.

Constructor & Destructor Documentation

◆ TrajectoryInfo()

Constructor.

Member Function Documentation

◆ AnimIndex()

unsigned int AnimIndex ( ) const

Return the animation index.

Returns
Index of the associated animation

◆ DistanceSoFar()

double DistanceSoFar ( const std::chrono::steady_clock::duration &  _time) const

Get the distance covered by the trajectory by a given time.

Parameters
[in]_timeTime from trajectory start to check the distance.
Returns
Distance in meters covered by the trajectory.

◆ Duration()

std::chrono::steady_clock::duration Duration ( ) const

Return the duration of the trajectory.

Returns
Duration of the animation.

◆ EndTime()

std::chrono::steady_clock::time_point EndTime ( ) const

Return the end time of the trajectory.

Returns
End time of the trajectory in seconds

◆ Id()

unsigned int Id ( ) const

Return the id of the trajectory.

Returns
Id of the trajectory

◆ SetAnimIndex()

void SetAnimIndex ( unsigned int  _index)

Set the animation index.

Parameters
[in]_indexAnimation index (auto-generated according to the type)

◆ SetEndTime()

void SetEndTime ( const std::chrono::steady_clock::time_point &  _endTime)

Set the end time of the trajectory.

Parameters
[in]_endTimeTrajectory end time.

◆ SetId()

void SetId ( unsigned int  _id)

Set the id of the trajectory.

Parameters
[in]_idId for the trajectory

◆ SetStartTime()

void SetStartTime ( const std::chrono::steady_clock::time_point &  _startTime)

Set the start time of the trajectory.

Parameters
[in]_startTimeTrajectory start time.

◆ SetTranslated()

void SetTranslated ( bool  _translated)

Set whether the trajectory is translated.

Parameters
[in]_translatedTrue if the trajectory is translated

◆ SetWaypoints()

void SetWaypoints ( std::map< std::chrono::steady_clock::time_point, math::Pose3d _waypoints,
double  _tension = 0.0 
)

Load all waypoints in the trajectory.

Parameters
[in]_waypointsMap of waypoints, where the key is the absolute time of the waypoint and the value is the pose.
[in]_tensionThe tension of the trajectory spline. The default value of zero equates to a Catmull-Rom spline, which may also cause the animation to overshoot keyframes. A value of one will cause the animation to stick to the keyframes. This value should be in the range 0..1.

◆ StartTime()

std::chrono::steady_clock::time_point StartTime ( ) const

Return the start time of the trajectory.

Returns
Start time of the trajectory.

◆ Translated()

bool Translated ( ) const

Return whether the trajectory is translated.

Returns
True if the trajectory is translated

◆ Waypoints()

common::PoseAnimation * Waypoints ( ) const

Return the waypoints in the trajectory.

Returns
Waypoints represented in pose animation format

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