Public Member Functions | Private Attributes | List of all members
tesseract_visualization::TrajectoryPlayer Class Reference

Enables the ability to play a trajectory provided by the set program. More...

#include <trajectory_player.h>

Public Member Functions

double currentDuration () const
 Get the current duration populated by the last call to getNext() More...
 
void enableLoop (bool loop)
 Enable looping playback of the trajectory. More...
 
tesseract_common::JointState getByIndex (long index) const
 Get move instruction by index. More...
 
tesseract_common::JointState getNext ()
 Get the next move instruction from the player. More...
 
bool isFinished () const
 Check if the player has the reached the end of the trajectory. More...
 
bool isLoopEnabled () const
 Get if looping playback is enabled. More...
 
TrajectoryPlayeroperator= (const TrajectoryPlayer &)=delete
 
TrajectoryPlayeroperator= (TrajectoryPlayer &&)=default
 
void reset ()
 Reset the state of the trajectory player. More...
 
tesseract_common::JointState setCurrentDuration (double duration)
 Set the current time for the player by duration. More...
 
tesseract_common::JointState setCurrentDurationByIndex (long index)
 Set the current time for the player by index of the input trajectoy. More...
 
void setScale (double scale)
 Set the scale factor for the play back of the trajectory. More...
 
void setTrajectory (const tesseract_common::JointTrajectory &trajectory)
 Set the the trajectory for the trajectory player. More...
 
long size () const
 The size of the tajectory. More...
 
double trajectoryDurationBegin () const
 Get the trajectory duration at the begin state. More...
 
double trajectoryDurationEnd () const
 Get the trajectory duration at the end state. More...
 
 TrajectoryPlayer ()
 
 TrajectoryPlayer (const TrajectoryPlayer &)=delete
 
 TrajectoryPlayer (TrajectoryPlayer &&)=default
 
 ~TrajectoryPlayer ()
 

Private Attributes

double current_duration_ { 0 }
 
bool finished_ { false }
 
bool loop_ { false }
 
double scale_ { 1 }
 
std::chrono::time_point< std::chrono::high_resolution_clock > start_time_
 
std::unique_ptr< TrajectoryInterpolatortrajectory_ { nullptr }
 
double trajectory_duration_end_ { 0 }
 
double trajectory_duration_start_ { 0 }
 

Detailed Description

Enables the ability to play a trajectory provided by the set program.

Definition at line 42 of file trajectory_player.h.

Constructor & Destructor Documentation

◆ TrajectoryPlayer() [1/3]

tesseract_visualization::TrajectoryPlayer::TrajectoryPlayer ( )
default

◆ ~TrajectoryPlayer()

tesseract_visualization::TrajectoryPlayer::~TrajectoryPlayer ( )
default

◆ TrajectoryPlayer() [2/3]

tesseract_visualization::TrajectoryPlayer::TrajectoryPlayer ( const TrajectoryPlayer )
delete

◆ TrajectoryPlayer() [3/3]

tesseract_visualization::TrajectoryPlayer::TrajectoryPlayer ( TrajectoryPlayer &&  )
default

Member Function Documentation

◆ currentDuration()

double tesseract_visualization::TrajectoryPlayer::currentDuration ( ) const

Get the current duration populated by the last call to getNext()

Returns
The current duration

Definition at line 132 of file trajectory_player.cpp.

◆ enableLoop()

void tesseract_visualization::TrajectoryPlayer::enableLoop ( bool  loop)

Enable looping playback of the trajectory.

Parameters
loopTrue to enable looping play, otherwise single playback.

Definition at line 140 of file trajectory_player.cpp.

◆ getByIndex()

tesseract_common::JointState tesseract_visualization::TrajectoryPlayer::getByIndex ( long  index) const

Get move instruction by index.

Parameters
indexThe index of the input program to extract the move instruction from
Returns
The move instruction at the input index

Definition at line 127 of file trajectory_player.cpp.

◆ getNext()

tesseract_common::JointState tesseract_visualization::TrajectoryPlayer::getNext ( )

Get the next move instruction from the player.

Returns
The move instruction at the next time interval

Definition at line 100 of file trajectory_player.cpp.

◆ isFinished()

bool tesseract_visualization::TrajectoryPlayer::isFinished ( ) const

Check if the player has the reached the end of the trajectory.

Returns
True if end has been reached, otherwise false.

Definition at line 138 of file trajectory_player.cpp.

◆ isLoopEnabled()

bool tesseract_visualization::TrajectoryPlayer::isLoopEnabled ( ) const

Get if looping playback is enabled.

Returns
True if looping playback is enabled otherwise false.

Definition at line 142 of file trajectory_player.cpp.

◆ operator=() [1/2]

TrajectoryPlayer& tesseract_visualization::TrajectoryPlayer::operator= ( const TrajectoryPlayer )
delete

◆ operator=() [2/2]

TrajectoryPlayer& tesseract_visualization::TrajectoryPlayer::operator= ( TrajectoryPlayer &&  )
default

◆ reset()

void tesseract_visualization::TrajectoryPlayer::reset ( )

Reset the state of the trajectory player.

Definition at line 144 of file trajectory_player.cpp.

◆ setCurrentDuration()

tesseract_common::JointState tesseract_visualization::TrajectoryPlayer::setCurrentDuration ( double  duration)

Set the current time for the player by duration.

Parameters
durationThe duration for which to set the current time from
Returns
The trajectory state at the provided duration

Definition at line 76 of file trajectory_player.cpp.

◆ setCurrentDurationByIndex()

tesseract_common::JointState tesseract_visualization::TrajectoryPlayer::setCurrentDurationByIndex ( long  index)

Set the current time for the player by index of the input trajectoy.

Parameters
indexThe input trajectory index for which to set the current time from
Returns
The trajectory state at the input trajectory index

Definition at line 55 of file trajectory_player.cpp.

◆ setScale()

void tesseract_visualization::TrajectoryPlayer::setScale ( double  scale)

Set the scale factor for the play back of the trajectory.

Parameters
scaleThe scale playback of the trajectory

Definition at line 53 of file trajectory_player.cpp.

◆ setTrajectory()

void tesseract_visualization::TrajectoryPlayer::setTrajectory ( const tesseract_common::JointTrajectory trajectory)

Set the the trajectory for the trajectory player.

Parameters
programThe trajectory to play

Definition at line 40 of file trajectory_player.cpp.

◆ size()

long tesseract_visualization::TrajectoryPlayer::size ( ) const

The size of the tajectory.

Definition at line 156 of file trajectory_player.cpp.

◆ trajectoryDurationBegin()

double tesseract_visualization::TrajectoryPlayer::trajectoryDurationBegin ( ) const

Get the trajectory duration at the begin state.

Returns
The trajectory duration

Definition at line 134 of file trajectory_player.cpp.

◆ trajectoryDurationEnd()

double tesseract_visualization::TrajectoryPlayer::trajectoryDurationEnd ( ) const

Get the trajectory duration at the end state.

Returns
The trajectory duration

Definition at line 136 of file trajectory_player.cpp.

Member Data Documentation

◆ current_duration_

double tesseract_visualization::TrajectoryPlayer::current_duration_ { 0 }
private

Definition at line 137 of file trajectory_player.h.

◆ finished_

bool tesseract_visualization::TrajectoryPlayer::finished_ { false }
private

Definition at line 140 of file trajectory_player.h.

◆ loop_

bool tesseract_visualization::TrajectoryPlayer::loop_ { false }
private

Definition at line 139 of file trajectory_player.h.

◆ scale_

double tesseract_visualization::TrajectoryPlayer::scale_ { 1 }
private

Definition at line 138 of file trajectory_player.h.

◆ start_time_

std::chrono::time_point<std::chrono::high_resolution_clock> tesseract_visualization::TrajectoryPlayer::start_time_
private

Definition at line 142 of file trajectory_player.h.

◆ trajectory_

std::unique_ptr<TrajectoryInterpolator> tesseract_visualization::TrajectoryPlayer::trajectory_ { nullptr }
private

Definition at line 134 of file trajectory_player.h.

◆ trajectory_duration_end_

double tesseract_visualization::TrajectoryPlayer::trajectory_duration_end_ { 0 }
private

Definition at line 136 of file trajectory_player.h.

◆ trajectory_duration_start_

double tesseract_visualization::TrajectoryPlayer::trajectory_duration_start_ { 0 }
private

Definition at line 135 of file trajectory_player.h.


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


tesseract_visualization
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:27