![]() |
RobWorkProject
23.9.11-
|
This is the core functionality of the playback plugin. The controls in PlayBack is forwarded to this utility. More...
#include <Player.hpp>
Inherits QObject.
Public Types | |
typedef rw::core::Ptr< Player > | Ptr |
Smart pointer type for Player. | |
Signals | |
void | relativePositionChanged (double val) |
Emitted during playback. More... | |
Public Member Functions | |
Player (rw::trajectory::TimedStatePath statePath, rw::core::Ptr< StateDraw > drawer, double tickInterval, rws::RobWorkStudio *rwstudio) | |
Construct a new player. More... | |
Player (rw::trajectory::TimedStatePath::Ptr statePath, rw::core::Ptr< StateDraw > drawer, double tickInterval, rws::RobWorkStudio *rwstudio) | |
Construct a new player. More... | |
Player (double tickInterval, rws::RobWorkStudio *rwstudio) | |
Construct a new player that can be used only for recording. More... | |
void | forward () |
Start the playback in forward direction. | |
void | backward () |
Start the playback in backward direction. | |
void | pauseOrResume () |
Pause or resume the playback. | |
void | toStart () |
Move to start of path. | |
void | toEnd () |
Move to end of path. | |
void | step (bool forward) |
Take a single step. More... | |
void | setRelativePosition (double relative) |
Move to a relative position. More... | |
void | setRelativeSpeed (double speed) |
Scale the speed. More... | |
std::string | getInfoLabel () const |
Get the current status of the player. More... | |
void | setLoopPlayback (bool loop) |
Whether to loop the playback or not. More... | |
void | setTickInterval (double interval) |
Set up the interval between ticks. More... | |
void | startRecording () |
Starts recording. | |
void | setupRecording (const QString filename, const QString &type) |
Sets up recording to save files as filename of type type. More... | |
void | stopRecording () |
Stops recording. | |
void | setInterpolate (bool interpolate) |
Enable/disable interpolation for a more smooth playback. More... | |
int | getPlayDirection () |
get the current play direction More... | |
Static Public Member Functions | |
static Player::Ptr | makeEmptyPlayer () |
Construct an empty player. More... | |
static Player::Ptr | makePlayer (const rw::trajectory::TimedStatePath &statePath, rw::core::Ptr< StateDraw > drawer, double tickInterval, rws::RobWorkStudio *rwstudio) |
Construct a new player. More... | |
static Player::Ptr | makePlayer (const rw::trajectory::TimedStatePath::Ptr statePath, rw::core::Ptr< StateDraw > drawer, double tickInterval, rws::RobWorkStudio *rwstudio) |
Construct a new player. More... | |
Public Attributes | |
rw::trajectory::StateTrajectory::Ptr | _trajectory |
The interpolated trajectory. | |
rw::trajectory::TimedStatePath::Ptr | _path |
The original trajectory. | |
bool | _recordingOnly |
Indicates whether a trajectory is loaded, or the Player is in recording-only mode. | |
This is the core functionality of the playback plugin. The controls in PlayBack is forwarded to this utility.
Player | ( | rw::trajectory::TimedStatePath | statePath, |
rw::core::Ptr< StateDraw > | drawer, | ||
double | tickInterval, | ||
rws::RobWorkStudio * | rwstudio | ||
) |
Construct a new player.
statePath | [in] the path of timed states. |
drawer | [in] the drawer to invoke for displaying a new state in the path. |
tickInterval | [in] the rendering rate. |
rwstudio | [in] the RobWorkStudio instance (used for saving to file during recordings). |
Player | ( | rw::trajectory::TimedStatePath::Ptr | statePath, |
rw::core::Ptr< StateDraw > | drawer, | ||
double | tickInterval, | ||
rws::RobWorkStudio * | rwstudio | ||
) |
Construct a new player.
statePath | [in] the path of timed states. |
drawer | [in] the drawer to invoke for displaying a new state in the path. |
tickInterval | [in] the rendering rate. |
rwstudio | [in] the RobWorkStudio instance (used for saving to file during recordings). |
Player | ( | double | tickInterval, |
rws::RobWorkStudio * | rwstudio | ||
) |
Construct a new player that can be used only for recording.
Notice that the state in RobWorkStudio must be updated through other means, for instance by the user.
tickInterval | [in] the recording rate. |
rwstudio | [in] the RobWorkStudio instance (used for saving to file during recordings). |
std::string getInfoLabel | ( | ) | const |
Get the current status of the player.
int getPlayDirection | ( | ) |
get the current play direction
|
static |
Construct an empty player.
|
static |
Construct a new player.
statePath | [in] the path of timed states. |
drawer | [in] the drawer to invoke for displaying a new state in the path. |
tickInterval | [in] the rendering rate. |
rwstudio | [in] the RobWorkStudio instance (used for saving to file during recordings). |
|
static |
Construct a new player.
statePath | [in] the path of timed states. |
drawer | [in] the drawer to invoke for displaying a new state in the path. |
tickInterval | [in] the rendering rate. |
rwstudio | [in] the RobWorkStudio instance (used for saving to file during recordings). |
|
signal |
Emitted during playback.
val | [in] the current playback position as a value between 0 and 1. |
|
inline |
Enable/disable interpolation for a more smooth playback.
interpolate | [in] true to do interpolation. |
void setLoopPlayback | ( | bool | loop | ) |
Whether to loop the playback or not.
loop | [in] true will loop the playback. |
void setRelativePosition | ( | double | relative | ) |
Move to a relative position.
relative | [in] a value between 0 and 1. |
void setRelativeSpeed | ( | double | speed | ) |
Scale the speed.
speed | [in] the velocity scale. |
void setTickInterval | ( | double | interval | ) |
Set up the interval between ticks.
interval | [in] the interval. |
void setupRecording | ( | const QString | filename, |
const QString & | type | ||
) |
Sets up recording to save files as filename of type type.
filename | [in] the filename to save to. |
type | [in] the filetype. |
void step | ( | bool | forward | ) |
Take a single step.
forward | [in] true to move one step forward, false to move backwards. |