Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
trajectory_player.h
Go to the documentation of this file.
1
26#ifndef TESSERACT_VISUALIZATION_TRAJECTORY_PLAYER_H
27#define TESSERACT_VISUALIZATION_TRAJECTORY_PLAYER_H
28
31#include <chrono>
33
35
37{
40{
41public:
42 TrajectoryPlayer() = default;
43
49
54 void setScale(double scale);
55
62
69
75
82
87 double currentDuration() const;
88
93 double trajectoryDuration() const;
94
99 bool isFinished() const;
100
105 void enableLoop(bool loop);
106
111 bool isLoopEnabled() const;
112
114 void reset();
115
117 long size() const;
118
119private:
122 double current_duration_{ 0 };
123 double scale_{ 1 };
124 bool loop_{ false };
125 bool finished_{ false };
126
127 std::chrono::time_point<std::chrono::high_resolution_clock> start_time_;
128};
129
130} // namespace tesseract_visualization
131
132#endif // TESSERACT_VISUALIZATION_TRAJECTORY_PLAYER_H
Definition: joint_state.h:39
Represents a joint trajectory.
Definition: joint_state.h:78
std::unique_ptr< TrajectoryInterpolator > UPtr
Definition: trajectory_interpolator.h:45
Enables the ability to play a trajectory provided by the set program.
Definition: trajectory_player.h:40
void setTrajectory(const tesseract_common::JointTrajectory &trajectory)
Set the the trajectory for the trajectory player.
Definition: trajectory_player.cpp:36
void reset()
Reset the state of the trajectory player.
Definition: trajectory_player.cpp:137
long size() const
The size of the tajectory.
Definition: trajectory_player.cpp:149
void setScale(double scale)
Set the scale factor for the play back of the trajectory.
Definition: trajectory_player.cpp:48
tesseract_common::JointState getNext()
Get the next move instruction from the player.
Definition: trajectory_player.cpp:95
double currentDuration() const
Get the current duration populated by the last call to getNext()
Definition: trajectory_player.cpp:127
double current_duration_
Definition: trajectory_player.h:122
tesseract_common::JointState setCurrentDurationByIndex(long index)
Set the current time for the player by index of the input trajectoy.
Definition: trajectory_player.cpp:50
tesseract_common::JointState setCurrentDuration(double duration)
Set the current time for the player by duration.
Definition: trajectory_player.cpp:71
tesseract_common::JointState getByIndex(long index) const
Get move instruction by index.
Definition: trajectory_player.cpp:122
TrajectoryInterpolator::UPtr trajectory_
Definition: trajectory_player.h:120
bool isFinished() const
Check if the player has the reached the end of the trajectory.
Definition: trajectory_player.cpp:131
double scale_
Definition: trajectory_player.h:123
std::chrono::time_point< std::chrono::high_resolution_clock > start_time_
Definition: trajectory_player.h:127
double trajectoryDuration() const
Get the trajectory duration.
Definition: trajectory_player.cpp:129
void enableLoop(bool loop)
Enable looping playback of the trajectory.
Definition: trajectory_player.cpp:133
bool loop_
Definition: trajectory_player.h:124
bool finished_
Definition: trajectory_player.h:125
double trajectory_duration_
Definition: trajectory_player.h:121
bool isLoopEnabled() const
Get if looping playback is enabled.
Definition: trajectory_player.cpp:135
double scale
Definition: collision_margin_data_unit.cpp:133
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: conversions.h:39
JointTrajectory trajectory
Definition: tesseract_common_serialization_unit.cpp:95
Trajectory interpolator class.