Public Member Functions | Protected Attributes | List of all members
movie_publisher::MovieMetadataProcessor Class Reference

Base for consumers of movie metadata. More...

#include <movie_metadata_processor.h>

Inheritance diagram for movie_publisher::MovieMetadataProcessor:
Inheritance graph
[legend]

Public Member Functions

virtual cras::expected< void, std::string > onClose ()
 Callback telling the processor that a movie has been closed. More...
 
virtual cras::expected< void, std::string > onMetadataReady (const std::shared_ptr< TimedMetadataExtractor > &metadataExtractor)
 Callback telling the processor that static metadata have been extracted and timed metadata are ready. More...
 
virtual cras::expected< void, std::string > onOpen (const MovieInfo::ConstPtr &info, const MovieOpenConfig &config)
 Callback telling the processor that a movie has been opened for reading. More...
 
virtual cras::expected< void, std::string > onSeek (const StreamTime &time)
 Callback telling the processor that a movie has been seeked to the given time. More...
 
virtual cras::expected< void, std::string > processAzimuth (const compass_msgs::Azimuth &azimuthMsg)
 Process the azimuth message. More...
 
virtual cras::expected< void, std::string > processCameraInfo (const sensor_msgs::CameraInfo &cameraInfoMsg)
 Process camera info. More...
 
virtual cras::expected< void, std::string > processFaces (const vision_msgs::Detection2DArray &facesMsg)
 Process the face detections message. More...
 
virtual cras::expected< void, std::string > processFrame (const sensor_msgs::ImageConstPtr &image, const MoviePlaybackState &playbackState)
 Process the frame read by MovieReader::nextFrame(). More...
 
virtual cras::expected< void, std::string > processGps (const gps_common::GPSFix &gpsMsg)
 Process the GPSFix message. More...
 
virtual cras::expected< void, std::string > processImage (const sensor_msgs::ImageConstPtr &image, const cras::optional< sensor_msgs::CameraInfo > &cameraInfoMsg)
 Process the image and its camera info. More...
 
virtual cras::expected< void, std::string > processImu (const sensor_msgs::Imu &imuMsg)
 Process the IMU message. More...
 
virtual cras::expected< void, std::string > processMagneticField (const sensor_msgs::MagneticField &magneticFieldMsg)
 Process the magnetic field message. More...
 
virtual cras::expected< void, std::string > processNavSatFix (const sensor_msgs::NavSatFix &navSatFixMsg)
 Process the NavSatFix message. More...
 
virtual cras::expected< void, std::string > processOpticalTf (const geometry_msgs::TransformStamped &opticalTfMsg)
 Process the optical frame TF message. More...
 
virtual cras::expected< void, std::string > processZeroRollPitchTf (const geometry_msgs::TransformStamped &zeroRollPitchTfMsg)
 Process the zero roll/pitch TF message. More...
 
virtual ~MovieMetadataProcessor ()
 

Protected Attributes

cras::optional< MovieOpenConfigconfig
 Configuration of the last opened movie. More...
 
MovieInfo::ConstPtr info
 Information about the last opened movie. More...
 
std::shared_ptr< MetadataExtractormetadataExtractor
 Accessor to static metadata of the last opened movie. More...
 
bool verbose {false}
 Whether the processor should be verbose. More...
 

Detailed Description

Base for consumers of movie metadata.

Callbacks for each type of metadata will be called when the metadata is available and the movie advances.

Note
The difference between TimedMetadataListener and MovieMetadataProcessor is the level of abstraction on which they work. TimedMetadataListener connects Movie and TimedMetadataExtractors so that the Movie class gets info about the metadata it has. MovieMetadataProcessor is then the interface between Movie and "the outer world", i.e. users of the Movie class. Usually, TimedMetadataListener will be mostly used internally in this library, while MovieMetadataProcessor will be used publicly by other classes outside this package. Also, the timestamps in TimedMetadataListener are always stream timestamps, while in MovieMetadataProcessor they should already correspond to ROS time according to the defined conversion function.

Definition at line 44 of file movie_metadata_processor.h.

Constructor & Destructor Documentation

◆ ~MovieMetadataProcessor()

virtual movie_publisher::MovieMetadataProcessor::~MovieMetadataProcessor ( )
virtual

Member Function Documentation

◆ onClose()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::onClose ( )
virtual

Callback telling the processor that a movie has been closed.

Returns
Nothing or error.

◆ onMetadataReady()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::onMetadataReady ( const std::shared_ptr< TimedMetadataExtractor > &  metadataExtractor)
virtual

Callback telling the processor that static metadata have been extracted and timed metadata are ready.

Parameters
[in]metadataExtractorThe object via which metadata can be retrieved.
Returns
Nothing or error.

◆ onOpen()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::onOpen ( const MovieInfo::ConstPtr info,
const MovieOpenConfig config 
)
virtual

Callback telling the processor that a movie has been opened for reading.

Parameters
[in]infoInformation about the open movie.
[in]configConfiguration with which the movie has been opened.
Returns
Nothing or error.

◆ onSeek()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::onSeek ( const StreamTime time)
inlinevirtual

Callback telling the processor that a movie has been seeked to the given time.

Parameters
[in]timeThe stream time the movie is seeked to.
Returns
Nothing or error.

Definition at line 76 of file movie_metadata_processor.h.

◆ processAzimuth()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processAzimuth ( const compass_msgs::Azimuth &  azimuthMsg)
inlinevirtual

Process the azimuth message.

Parameters
[in]azimuthMsgAzimuth message.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 110 of file movie_metadata_processor.h.

◆ processCameraInfo()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processCameraInfo ( const sensor_msgs::CameraInfo &  cameraInfoMsg)
inlinevirtual

Process camera info.

Parameters
[in]cameraInfoMsgThe camera info.
Returns
Nothing or error.

Definition at line 104 of file movie_metadata_processor.h.

◆ processFaces()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processFaces ( const vision_msgs::Detection2DArray &  facesMsg)
inlinevirtual

Process the face detections message.

Parameters
[in]facesMsgMessage with face detections.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 159 of file movie_metadata_processor.h.

◆ processFrame()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processFrame ( const sensor_msgs::ImageConstPtr &  image,
const MoviePlaybackState playbackState 
)
virtual

Process the frame read by MovieReader::nextFrame().

Parameters
[in]imageThe decoded movie frame.
[in]playbackStateCurrent state of movie playback.
Returns
Nothing or error.

◆ processGps()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processGps ( const gps_common::GPSFix &  gpsMsg)
inlinevirtual

Process the GPSFix message.

Parameters
[in]gpsMsgGPSFix message.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 122 of file movie_metadata_processor.h.

◆ processImage()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processImage ( const sensor_msgs::ImageConstPtr &  image,
const cras::optional< sensor_msgs::CameraInfo > &  cameraInfoMsg 
)
inlinevirtual

Process the image and its camera info.

Parameters
[in]imageThe decoded movie frame.
[in]cameraInfoMsgThe corresponding camera info (if present).
Returns
Nothing or error.
Note
This function is not called directly by the metadata manager (because it doesn't have access to the image), but is instead called from processFrame(). If you override processFrame(), make sure the call to processImage() is still propagated.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 96 of file movie_metadata_processor.h.

◆ processImu()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processImu ( const sensor_msgs::Imu &  imuMsg)
inlinevirtual

Process the IMU message.

Parameters
[in]imuMsgIMU message.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 128 of file movie_metadata_processor.h.

◆ processMagneticField()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processMagneticField ( const sensor_msgs::MagneticField &  magneticFieldMsg)
inlinevirtual

Process the magnetic field message.

Parameters
[in]magneticFieldMsgMagnetic field message.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 150 of file movie_metadata_processor.h.

◆ processNavSatFix()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processNavSatFix ( const sensor_msgs::NavSatFix &  navSatFixMsg)
inlinevirtual

Process the NavSatFix message.

Parameters
[in]navSatFixMsgNavSatFix message.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 116 of file movie_metadata_processor.h.

◆ processOpticalTf()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processOpticalTf ( const geometry_msgs::TransformStamped &  opticalTfMsg)
inlinevirtual

Process the optical frame TF message.

Parameters
[in]opticalTfMsgStatic TF message.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 141 of file movie_metadata_processor.h.

◆ processZeroRollPitchTf()

virtual cras::expected<void, std::string> movie_publisher::MovieMetadataProcessor::processZeroRollPitchTf ( const geometry_msgs::TransformStamped &  zeroRollPitchTfMsg)
inlinevirtual

Process the zero roll/pitch TF message.

Parameters
[in]zeroRollPitchTfMsgDynamic TF message.

Reimplemented in movie_publisher::MovieToBagMetadataProcessor.

Definition at line 134 of file movie_metadata_processor.h.

Member Data Documentation

◆ config

cras::optional<MovieOpenConfig> movie_publisher::MovieMetadataProcessor::config
protected

Configuration of the last opened movie.

Definition at line 163 of file movie_metadata_processor.h.

◆ info

MovieInfo::ConstPtr movie_publisher::MovieMetadataProcessor::info
protected

Information about the last opened movie.

Definition at line 162 of file movie_metadata_processor.h.

◆ metadataExtractor

std::shared_ptr<MetadataExtractor> movie_publisher::MovieMetadataProcessor::metadataExtractor
protected

Accessor to static metadata of the last opened movie.

Definition at line 164 of file movie_metadata_processor.h.

◆ verbose

bool movie_publisher::MovieMetadataProcessor::verbose {false}
protected

Whether the processor should be verbose.

Definition at line 165 of file movie_metadata_processor.h.


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


movie_publisher
Author(s): Martin Pecka
autogenerated on Wed May 28 2025 02:07:22