Public Member Functions | Private Member Functions | Private Attributes | List of all members
gazebo::GazeboMultiVideoMonitorPlugin Class Reference

Provides a ROS interface for creating multiple videos from different cameras, all recording in the same time period. More...

#include <gazebo_multi_video_monitor_plugin.h>

Inheritance diagram for gazebo::GazeboMultiVideoMonitorPlugin:
Inheritance graph
[legend]

Public Member Functions

 GazeboMultiVideoMonitorPlugin ()
 
virtual void Load (sensors::SensorPtr _sensor, sdf::ElementPtr _sdf) override
 
virtual void Reset () override
 
virtual ~GazeboMultiVideoMonitorPlugin () override
 
- Public Member Functions inherited from gazebo::GazeboMonitorBasePlugin
 GazeboMonitorBasePlugin (const std::string &name)
 
virtual void Init () override
 
virtual ~GazeboMonitorBasePlugin () override
 

Private Member Functions

virtual void initRos () override
 
virtual void onNewImages (const ImageDataPtrVector &images) override
 
bool startRecordingServiceCallback (std_srvs::EmptyRequest &req, std_srvs::EmptyResponse &res)
 
bool stopRecording (bool discard, boost::filesystem::path group_directory="")
 
bool stopRecordingServiceCallback (gazebo_video_monitor_msgs::StopRecordingRequest &req, gazebo_video_monitor_msgs::StopRecordingResponse &res)
 

Private Attributes

bool add_timestamp_in_filename_
 
std::string file_timestamp_
 
std::unordered_map< std::string, GazeboVideoRecorderPtrrecorders_
 
std::mutex recorders_mutex_
 

Additional Inherited Members

- Public Types inherited from gazebo::GazeboMonitorBasePlugin
using ImageDataPtrVector = std::vector< sensors::GvmMulticameraSensor::ImageDataPtr >
 
- Protected Member Functions inherited from gazebo::GazeboMonitorBasePlugin
RefModelConfigConstPtr getCameraRefConfig (const std::string &name) const
 
void initialize ()
 
- Protected Attributes inherited from gazebo::GazeboMonitorBasePlugin
const std::string logger_prefix_
 
ros::NodeHandlePtr nh_
 
boost::filesystem::path save_path_
 
sdf::ElementPtr sdf_
 
sensors::GvmMulticameraSensorPtr sensor_
 
ros::ServiceServer start_recording_service_
 
ros::ServiceServer stop_recording_service_
 
physics::WorldPtr world_
 

Detailed Description

Provides a ROS interface for creating multiple videos from different cameras, all recording in the same time period.

Reads the n cameras managed by the parent sensor, records n videos, and saves the videos under a group directory. Metadata can be shown in the videos, like real time, sim time, and elapsed real time since the start of the recording.

Note
The parent sensor can hold an arbitrary number of cameras. The pose of the cameras in their configuration can be wrt the sensor parent, or any other model in the world. In the latter case, these models need to be specified in the plugin configuration.
Expects the following configuration (extends the configuration of GazeboMonitorBasePlugin):
  • startRecordingService: name of the service for starting a recording
  • stopRecordingService: name of the service for stopping and saving a recording
  • recorder: configuration of the video recorder (see GazeboVideoRecorder)
  • cameraReference ([1-n] times): reference model configuration with a name attribute pointing to one of the sensor cameras (see parseRefModelConfig)

Definition at line 58 of file gazebo_multi_video_monitor_plugin.h.

Constructor & Destructor Documentation

◆ GazeboMultiVideoMonitorPlugin()

gazebo::GazeboMultiVideoMonitorPlugin::GazeboMultiVideoMonitorPlugin ( )

Definition at line 25 of file gazebo_multi_video_monitor_plugin.cpp.

◆ ~GazeboMultiVideoMonitorPlugin()

gazebo::GazeboMultiVideoMonitorPlugin::~GazeboMultiVideoMonitorPlugin ( )
overridevirtual

Definition at line 29 of file gazebo_multi_video_monitor_plugin.cpp.

Member Function Documentation

◆ initRos()

void gazebo::GazeboMultiVideoMonitorPlugin::initRos ( )
overrideprivatevirtual

Reimplemented from gazebo::GazeboMonitorBasePlugin.

Definition at line 68 of file gazebo_multi_video_monitor_plugin.cpp.

◆ Load()

void gazebo::GazeboMultiVideoMonitorPlugin::Load ( sensors::SensorPtr  _sensor,
sdf::ElementPtr  _sdf 
)
overridevirtual

Reimplemented from gazebo::GazeboMonitorBasePlugin.

Definition at line 33 of file gazebo_multi_video_monitor_plugin.cpp.

◆ onNewImages()

void gazebo::GazeboMultiVideoMonitorPlugin::onNewImages ( const ImageDataPtrVector images)
overrideprivatevirtual

◆ Reset()

void gazebo::GazeboMultiVideoMonitorPlugin::Reset ( )
overridevirtual

Definition at line 63 of file gazebo_multi_video_monitor_plugin.cpp.

◆ startRecordingServiceCallback()

bool gazebo::GazeboMultiVideoMonitorPlugin::startRecordingServiceCallback ( std_srvs::EmptyRequest &  req,
std_srvs::EmptyResponse &  res 
)
private

Definition at line 112 of file gazebo_multi_video_monitor_plugin.cpp.

◆ stopRecording()

bool gazebo::GazeboMultiVideoMonitorPlugin::stopRecording ( bool  discard,
boost::filesystem::path  group_directory = "" 
)
private

Definition at line 98 of file gazebo_multi_video_monitor_plugin.cpp.

◆ stopRecordingServiceCallback()

bool gazebo::GazeboMultiVideoMonitorPlugin::stopRecordingServiceCallback ( gazebo_video_monitor_msgs::StopRecordingRequest &  req,
gazebo_video_monitor_msgs::StopRecordingResponse &  res 
)
private

Definition at line 135 of file gazebo_multi_video_monitor_plugin.cpp.

Member Data Documentation

◆ add_timestamp_in_filename_

bool gazebo::GazeboMultiVideoMonitorPlugin::add_timestamp_in_filename_
private

Definition at line 79 of file gazebo_multi_video_monitor_plugin.h.

◆ file_timestamp_

std::string gazebo::GazeboMultiVideoMonitorPlugin::file_timestamp_
private

Definition at line 80 of file gazebo_multi_video_monitor_plugin.h.

◆ recorders_

std::unordered_map<std::string, GazeboVideoRecorderPtr> gazebo::GazeboMultiVideoMonitorPlugin::recorders_
private

Definition at line 76 of file gazebo_multi_video_monitor_plugin.h.

◆ recorders_mutex_

std::mutex gazebo::GazeboMultiVideoMonitorPlugin::recorders_mutex_
private

Definition at line 77 of file gazebo_multi_video_monitor_plugin.h.


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


gazebo_video_monitor_plugins
Author(s): Nick Lamprianidis
autogenerated on Tue Oct 24 2023 02:12:50