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

#include <movie_to_bag.h>

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

Public Member Functions

virtual void addTimestampOffsetVars (MovieReaderRos &reader) const
 
void close ()
 
 MovieToBagMetadataProcessor (const cras::LogHelperPtr &log, const std::string &bagFilename, const std::string &transport, const std::function< std::string(const std::string &)> &resolveName, const cras::BoundParamHelperPtr &params)
 
cras::expected< void, std::string > processAzimuth (const compass_msgs::Azimuth &azimuthMsg) override
 Process the azimuth message. More...
 
cras::expected< void, std::string > processFaces (const vision_msgs::Detection2DArray &facesMsg) override
 Process the face detections message. More...
 
cras::expected< void, std::string > processGps (const gps_common::GPSFix &gpsMsg) override
 Process the GPSFix message. More...
 
cras::expected< void, std::string > processImage (const sensor_msgs::ImageConstPtr &image, const cras::optional< sensor_msgs::CameraInfo > &cameraInfoMsg) override
 Process the image and its camera info. More...
 
cras::expected< void, std::string > processImu (const sensor_msgs::Imu &imuMsg) override
 Process the IMU message. More...
 
cras::expected< void, std::string > processMagneticField (const sensor_msgs::MagneticField &magneticFieldMsg) override
 Process the magnetic field message. More...
 
cras::expected< void, std::string > processNavSatFix (const sensor_msgs::NavSatFix &navSatFixMsg) override
 Process the NavSatFix message. More...
 
cras::expected< void, std::string > processOpticalTf (const geometry_msgs::TransformStamped &opticalTfMsg) override
 Process the optical frame TF message. More...
 
cras::expected< void, std::string > processZeroRollPitchTf (const geometry_msgs::TransformStamped &zeroRollPitchTfMsg) override
 Process the zero roll/pitch TF message. More...
 
 ~MovieToBagMetadataProcessor () override
 
- Public Member Functions inherited from movie_publisher::MovieMetadataProcessor
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 > processCameraInfo (const sensor_msgs::CameraInfo &cameraInfoMsg)
 Process camera info. 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 ~MovieMetadataProcessor ()
 

Protected Member Functions

virtual std::string getAzimuthTopic () const
 
virtual std::string getCameraInfoTopic () const
 
virtual std::string getFacesTopic () const
 
virtual std::string getGpsTopic () const
 
virtual std::string getImageTopic () const
 
virtual std::string getImuTopic () const
 
virtual std::string getMagneticFieldTopic () const
 
virtual std::string getNavSatFixTopic () const
 
virtual std::string getPrefixedTopic (const std::string &topicName) const
 Prefix the given topic name with the base topic. More...
 
virtual std::string getStaticTfTopic () const
 
virtual std::string getTfTopic () const
 
- Protected Member Functions inherited from cras::HasLogger
::cras::LogHelperConstPtr getCrasLogger () const
 
 HasLogger (const ::cras::LogHelperPtr &log)
 
void setCrasLogger (const ::cras::LogHelperPtr &log)
 

Protected Attributes

std::unique_ptr< rosbag::Bagbag
 The bag to write to. More...
 
std::unique_ptr< image_transport_codecs::ImageTransportCodecsimageCodecs
 Image transport codec instance. More...
 
cras::optional< geometry_msgs::TransformStamped > lastOpticalTF
 Last optical transform. More...
 
std::function< std::string(const std::string &)> resolveName
 
std::string topic
 The base topic name. More...
 
std::string transport
 The transport to use. More...
 
- Protected Attributes inherited from movie_publisher::MovieMetadataProcessor
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...
 
- Protected Attributes inherited from cras::HasLogger
::cras::LogHelperPtr log
 

Detailed Description

Definition at line 34 of file movie_to_bag.h.

Constructor & Destructor Documentation

◆ MovieToBagMetadataProcessor()

movie_publisher::MovieToBagMetadataProcessor::MovieToBagMetadataProcessor ( const cras::LogHelperPtr log,
const std::string &  bagFilename,
const std::string &  transport,
const std::function< std::string(const std::string &)> &  resolveName,
const cras::BoundParamHelperPtr params 
)
explicit

◆ ~MovieToBagMetadataProcessor()

movie_publisher::MovieToBagMetadataProcessor::~MovieToBagMetadataProcessor ( )
override

Member Function Documentation

◆ addTimestampOffsetVars()

virtual void movie_publisher::MovieToBagMetadataProcessor::addTimestampOffsetVars ( MovieReaderRos reader) const
virtual

◆ close()

void movie_publisher::MovieToBagMetadataProcessor::close ( )

◆ getAzimuthTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getAzimuthTopic ( ) const
protectedvirtual

◆ getCameraInfoTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getCameraInfoTopic ( ) const
protectedvirtual

◆ getFacesTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getFacesTopic ( ) const
protectedvirtual

◆ getGpsTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getGpsTopic ( ) const
protectedvirtual

◆ getImageTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getImageTopic ( ) const
protectedvirtual

◆ getImuTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getImuTopic ( ) const
protectedvirtual

◆ getMagneticFieldTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getMagneticFieldTopic ( ) const
protectedvirtual

◆ getNavSatFixTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getNavSatFixTopic ( ) const
protectedvirtual

◆ getPrefixedTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getPrefixedTopic ( const std::string &  topicName) const
protectedvirtual

Prefix the given topic name with the base topic.

Parameters
[in]topicNameSuffix to add to the base topic name.
Returns
The prefixed topic name.

◆ getStaticTfTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getStaticTfTopic ( ) const
protectedvirtual

◆ getTfTopic()

virtual std::string movie_publisher::MovieToBagMetadataProcessor::getTfTopic ( ) const
protectedvirtual

◆ processAzimuth()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processAzimuth ( const compass_msgs::Azimuth &  azimuthMsg)
overridevirtual

Process the azimuth message.

Parameters
[in]azimuthMsgAzimuth message.

Reimplemented from movie_publisher::MovieMetadataProcessor.

◆ processFaces()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processFaces ( const vision_msgs::Detection2DArray &  facesMsg)
overridevirtual

Process the face detections message.

Parameters
[in]facesMsgMessage with face detections.

Reimplemented from movie_publisher::MovieMetadataProcessor.

◆ processGps()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processGps ( const gps_common::GPSFix &  gpsMsg)
overridevirtual

Process the GPSFix message.

Parameters
[in]gpsMsgGPSFix message.

Reimplemented from movie_publisher::MovieMetadataProcessor.

◆ processImage()

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

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 from movie_publisher::MovieMetadataProcessor.

◆ processImu()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processImu ( const sensor_msgs::Imu &  imuMsg)
overridevirtual

Process the IMU message.

Parameters
[in]imuMsgIMU message.

Reimplemented from movie_publisher::MovieMetadataProcessor.

◆ processMagneticField()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processMagneticField ( const sensor_msgs::MagneticField &  magneticFieldMsg)
overridevirtual

Process the magnetic field message.

Parameters
[in]magneticFieldMsgMagnetic field message.

Reimplemented from movie_publisher::MovieMetadataProcessor.

◆ processNavSatFix()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processNavSatFix ( const sensor_msgs::NavSatFix &  navSatFixMsg)
overridevirtual

Process the NavSatFix message.

Parameters
[in]navSatFixMsgNavSatFix message.

Reimplemented from movie_publisher::MovieMetadataProcessor.

◆ processOpticalTf()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processOpticalTf ( const geometry_msgs::TransformStamped &  opticalTfMsg)
overridevirtual

Process the optical frame TF message.

Parameters
[in]opticalTfMsgStatic TF message.

Reimplemented from movie_publisher::MovieMetadataProcessor.

◆ processZeroRollPitchTf()

cras::expected<void, std::string> movie_publisher::MovieToBagMetadataProcessor::processZeroRollPitchTf ( const geometry_msgs::TransformStamped &  zeroRollPitchTfMsg)
overridevirtual

Process the zero roll/pitch TF message.

Parameters
[in]zeroRollPitchTfMsgDynamic TF message.

Reimplemented from movie_publisher::MovieMetadataProcessor.

Member Data Documentation

◆ bag

std::unique_ptr<rosbag::Bag> movie_publisher::MovieToBagMetadataProcessor::bag
protected

The bag to write to.

Definition at line 78 of file movie_to_bag.h.

◆ imageCodecs

std::unique_ptr<image_transport_codecs::ImageTransportCodecs> movie_publisher::MovieToBagMetadataProcessor::imageCodecs
protected

Image transport codec instance.

Definition at line 77 of file movie_to_bag.h.

◆ lastOpticalTF

cras::optional<geometry_msgs::TransformStamped> movie_publisher::MovieToBagMetadataProcessor::lastOpticalTF
protected

Last optical transform.

Definition at line 82 of file movie_to_bag.h.

◆ resolveName

std::function<std::string(const std::string&)> movie_publisher::MovieToBagMetadataProcessor::resolveName
protected

Definition at line 81 of file movie_to_bag.h.

◆ topic

std::string movie_publisher::MovieToBagMetadataProcessor::topic
protected

The base topic name.

Definition at line 79 of file movie_to_bag.h.

◆ transport

std::string movie_publisher::MovieToBagMetadataProcessor::transport
protected

The transport to use.

Definition at line 80 of file movie_to_bag.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