Gazebo Transport

API Reference

11.4.1
PlaybackHandle Class Reference

Handles the playback of ignition transport topics. This class allows you to manage a log playback once it has started. You must hang onto the PlaybackHandle or else the playback will end early. More...

#include <Playback.hh>

Public Member Functions

 ~PlaybackHandle ()
 Destructor. More...
 
std::chrono::nanoseconds CurrentTime () const
 Gets current time of the log being played. More...
 
std::chrono::nanoseconds EndTime () const
 Gets end time of the log being played. More...
 
bool Finished () const
 Check if this playback is finished. More...
 
bool IsPaused () const
 Check pause status. More...
 
void Pause ()
 Pauses the playback. More...
 
void Resume ()
 Unpauses the playback. More...
 
void Seek (const std::chrono::nanoseconds &_newElapsedTime)
 Jump current playback time to a specific elapsed time. More...
 
std::chrono::nanoseconds StartTime () const
 Gets start time of the log being played. More...
 
void Step (const std::chrono::nanoseconds &_stepDuration)
 Step the playback by a given amount of nanoseconds. More...
 
void Stop ()
 Stop playing messages. More...
 
void WaitUntilFinished ()
 Block until playback runs out of messages to publish. More...
 

Detailed Description

Handles the playback of ignition transport topics. This class allows you to manage a log playback once it has started. You must hang onto the PlaybackHandle or else the playback will end early.

Responsibilities: time keeping, multiple thread safety, publishing data to topics, and stopping playback.

Constructor & Destructor Documentation

◆ ~PlaybackHandle()

Destructor.

Member Function Documentation

◆ CurrentTime()

std::chrono::nanoseconds CurrentTime ( ) const

Gets current time of the log being played.

Returns
current time of the log playback, in nanoseconds

◆ EndTime()

std::chrono::nanoseconds EndTime ( ) const

Gets end time of the log being played.

Returns
end time of the log, in nanoseconds

◆ Finished()

bool Finished ( ) const

Check if this playback is finished.

Returns
true if all messages have finished playing; false otherwise.

◆ IsPaused()

bool IsPaused ( ) const

Check pause status.

◆ Pause()

void Pause ( )

Pauses the playback.

◆ Resume()

void Resume ( )

Unpauses the playback.

◆ Seek()

void Seek ( const std::chrono::nanoseconds _newElapsedTime)

Jump current playback time to a specific elapsed time.

Parameters
[in]_newElapsedTimeElapsed time at which playback will jump

◆ StartTime()

std::chrono::nanoseconds StartTime ( ) const

Gets start time of the log being played.

Returns
start time of the log, in nanoseconds

◆ Step()

void Step ( const std::chrono::nanoseconds _stepDuration)

Step the playback by a given amount of nanoseconds.

Precondition
Playback must be previously paused
Parameters
[in]_stepDurationLength of the step in nanoseconds

◆ Stop()

void Stop ( )

Stop playing messages.

◆ WaitUntilFinished()

void WaitUntilFinished ( )

Block until playback runs out of messages to publish.


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