MovieReader preconfigured from ROS parameters. More...
#include <movie_reader_ros.h>
Public Member Functions | |
void | addTimestampOffsetVar (const std::string &var, double val) |
Add a variable that will be resolved when parsing timestamp_offset. More... | |
cras::expected< MovieOpenConfig, std::string > | createDefaultConfig () const override |
Create a default config for opening movie files. More... | |
MovieReaderRos (const cras::LogHelperPtr &log, const cras::BoundParamHelperPtr ¶ms) | |
cras::expected< MoviePtr, std::string > | open (const std::string &filename, const MovieOpenConfig &config) override |
Open a movie in the referenced file. More... | |
![]() | |
MovieReader (const cras::LogHelperPtr &log, const cras::BoundParamHelperPtr ¶ms) | |
Create the movie reader instance. More... | |
virtual | ~MovieReader () |
![]() | |
::cras::LogHelperConstPtr | getCrasLogger () const |
HasLogger (const ::cras::LogHelperPtr &log) | |
void | setCrasLogger (const ::cras::LogHelperPtr &log) |
Protected Attributes | |
cras::BoundParamHelperPtr | params |
std::unordered_map< std::string, double > | timestampOffsetVars |
Extra variables to resolve in the timestamp_offset expression. More... | |
![]() | |
::cras::LogHelperPtr | log |
MovieReader preconfigured from ROS parameters.
Parameters ~start
, ~end
and ~duration
can be expressed in seconds (15.35)
, in (min, sec)
, in (hour, min, sec)
, or as a string: ‘'01:03:05.35’`.
~start
(float|tuple|string, optional): If set, the movie will be read from the specified time. Cannot be set together with ~end
and ~duration
.~end
(float|tuple|string, optional): If set, the movie will be read up to the specified time (not affected by start). Cannot be set together with ~start
and ~duration
.~duration
(float|tuple|string, optional): If set, playback will have this duration. If end is also set, the duration is counted from the end of the clip, otherwise, it is the duration from the start of the clip. Cannot be set together with ~start
and ~end
.~timestamp_offset
(int|float|string, default 0.0): Adjustment of timestamps determined by ~timestamp_source
. If given as string, it can be a simple mathematical expression that can also resolve several variables: ros_time
(current ROS time), wall_time
(current wall time), metadata_start
(start time from metadata).~timestamp_source
(str, default metadata
): How to determine timestamps of the movie frames. Options are:metadata
: Extract absolute time when the movie was recorded and use that time as timestamps.all_zeros
: Use zero timestamps. Please note that time 0.0 cannot be stored in bag files. Use ~timestamp_offset
to make the time valid.absolute_timecode
: Use the absolute timecode as timestamps (i.e. time since start of movie file).relative_timecode
: Use the relative timecode as timestamps (i.e. time since ~start
).ros_time
: Timestamp the frames with current ROS time. Note that this mode is not very useful for movie_to_bag.~frame_id
(string, default ""): The frame_id used in the geometrical messages' headers.~optical_frame_id
(string, default ${frame_id}_optical_frame
): The frame_id used in the image messages' headers.~allow_yuv_fallback
(bool, default False): Set whether YUV***
formats should be decoded to YUV422, or whether the default encoding should be used.~default_encoding
(string, optional): Set the default encoding which should be used for output frames if there is no direct match between the libav pixel format and ROS image encodings.~encoding
(string, optional): Set the encoding which should be used for output frames regardless of their source encoding (one of sensor_msgs::image_encodings constants). Definition at line 63 of file movie_reader_ros.h.
movie_publisher::MovieReaderRos::MovieReaderRos | ( | const cras::LogHelperPtr & | log, |
const cras::BoundParamHelperPtr & | params | ||
) |
void movie_publisher::MovieReaderRos::addTimestampOffsetVar | ( | const std::string & | var, |
double | val | ||
) |
Add a variable that will be resolved when parsing timestamp_offset.
[in] | var | Name of the variable. |
[in] | val | The value of the variable. |
|
overridevirtual |
Create a default config for opening movie files.
Reimplemented from movie_publisher::MovieReader.
|
overridevirtual |
Open a movie in the referenced file.
[in] | filename | Path to the file with the movie. |
[in] | config | Extra configuration for the movie opening. |
Reimplemented from movie_publisher::MovieReader.
|
protected |
ROS parameters configuring the movie reader.
Definition at line 80 of file movie_reader_ros.h.
|
protected |
Extra variables to resolve in the timestamp_offset expression.
Definition at line 82 of file movie_reader_ros.h.