Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
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>

Collaboration diagram for tesseract_visualization::TrajectoryPlayer:
Collaboration graph
[legend]

Public Member Functions

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

Private Attributes

TrajectoryInterpolator::UPtr trajectory_ { nullptr }
 
double trajectory_duration_ { 0 }
 
double current_duration_ { 0 }
 
double scale_ { 1 }
 
bool loop_ { false }
 
bool finished_ { false }
 
std::chrono::time_point< std::chrono::high_resolution_clock > start_time_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ TrajectoryPlayer()

tesseract_visualization::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

◆ enableLoop()

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

Enable looping playback of the trajectory.

Parameters
loopTrue to enable looping play, otherwise single playback.

◆ 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

◆ 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

◆ 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.

◆ isLoopEnabled()

bool tesseract_visualization::TrajectoryPlayer::isLoopEnabled ( ) const

Get if looping playback is enabled.

Returns
True if looping playback is enabled otherwise false.

◆ reset()

void tesseract_visualization::TrajectoryPlayer::reset ( )

Reset the state of the trajectory player.

◆ 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

◆ 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

◆ 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

◆ setTrajectory()

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

Set the the trajectory for the trajectory player.

Parameters
programThe trajectory to play

◆ size()

long tesseract_visualization::TrajectoryPlayer::size ( ) const

The size of the tajectory.

◆ trajectoryDuration()

double tesseract_visualization::TrajectoryPlayer::trajectoryDuration ( ) const

Get the trajectory duration.

Returns
The trajectory duration

Member Data Documentation

◆ current_duration_

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

◆ finished_

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

◆ loop_

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

◆ scale_

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

◆ start_time_

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

◆ trajectory_

TrajectoryInterpolator::UPtr tesseract_visualization::TrajectoryPlayer::trajectory_ { nullptr }
private

◆ trajectory_duration_

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

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