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

Provides a ROS interface for creating multi-camera videos. More...

#include <gazebo_multi_camera_monitor_plugin.h>

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

Public Member Functions

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

Private Member Functions

void cameraSelect (const std::vector< std::string > &names)
 
void cameraSelectCallback (const boost::shared_ptr< const ignition::msgs::StringMsg_V > &msg)
 
void cameraSelectRosCallback (const gazebo_video_monitor_msgs::StringsConstPtr &msg)
 
virtual void initRos () override
 
virtual void onNewImages (const ImageDataPtrVector &images) override
 
bool startRecordingServiceCallback (gazebo_video_monitor_msgs::StartGmcmRecordingRequest &req, gazebo_video_monitor_msgs::StartGmcmRecordingResponse &res)
 
std::string stopRecording (bool discard, std::string filename="")
 
bool stopRecordingServiceCallback (gazebo_video_monitor_msgs::StopRecordingRequest &req, gazebo_video_monitor_msgs::StopRecordingResponse &res)
 

Private Attributes

std::vector< size_t > camera_indices_
 
std::unordered_map< std::string, size_t > camera_name_to_index_map_
 
ros::Subscriber camera_select_ros_subscriber_
 
transport::SubscriberPtr camera_select_subscriber_
 
transport::NodePtr node_
 
GazeboVideoRecorderPtr recorder_
 
std::mutex recorder_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 multi-camera videos.

Records videos in which the stream can be configured from a pool of n cameras. The source camera can be changed dynamically during the recording. A second camera can be selected to be shown in picture-in-picture mode. 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
  • cameraSelectTopic: name of the topic for selecting the cameras. One or two camera names are allowed in the messages.
  • 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 62 of file gazebo_multi_camera_monitor_plugin.h.

Constructor & Destructor Documentation

◆ GazeboMultiCameraMonitorPlugin()

gazebo::GazeboMultiCameraMonitorPlugin::GazeboMultiCameraMonitorPlugin ( )

Definition at line 26 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ ~GazeboMultiCameraMonitorPlugin()

gazebo::GazeboMultiCameraMonitorPlugin::~GazeboMultiCameraMonitorPlugin ( )
overridevirtual

Definition at line 32 of file gazebo_multi_camera_monitor_plugin.cpp.

Member Function Documentation

◆ cameraSelect()

void gazebo::GazeboMultiCameraMonitorPlugin::cameraSelect ( const std::vector< std::string > &  names)
private

Definition at line 118 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ cameraSelectCallback()

void gazebo::GazeboMultiCameraMonitorPlugin::cameraSelectCallback ( const boost::shared_ptr< const ignition::msgs::StringMsg_V > &  msg)
private

Definition at line 146 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ cameraSelectRosCallback()

void gazebo::GazeboMultiCameraMonitorPlugin::cameraSelectRosCallback ( const gazebo_video_monitor_msgs::StringsConstPtr &  msg)
private

Definition at line 154 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ initRos()

void gazebo::GazeboMultiCameraMonitorPlugin::initRos ( )
overrideprivatevirtual

Reimplemented from gazebo::GazeboMonitorBasePlugin.

Definition at line 75 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ Load()

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

Reimplemented from gazebo::GazeboMonitorBasePlugin.

Definition at line 36 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ onNewImages()

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

◆ Reset()

void gazebo::GazeboMultiCameraMonitorPlugin::Reset ( )
overridevirtual

Definition at line 70 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ startRecordingServiceCallback()

bool gazebo::GazeboMultiCameraMonitorPlugin::startRecordingServiceCallback ( gazebo_video_monitor_msgs::StartGmcmRecordingRequest &  req,
gazebo_video_monitor_msgs::StartGmcmRecordingResponse &  res 
)
private

Definition at line 166 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ stopRecording()

std::string gazebo::GazeboMultiCameraMonitorPlugin::stopRecording ( bool  discard,
std::string  filename = "" 
)
private

Definition at line 160 of file gazebo_multi_camera_monitor_plugin.cpp.

◆ stopRecordingServiceCallback()

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

Definition at line 191 of file gazebo_multi_camera_monitor_plugin.cpp.

Member Data Documentation

◆ camera_indices_

std::vector<size_t> gazebo::GazeboMultiCameraMonitorPlugin::camera_indices_
private

Definition at line 90 of file gazebo_multi_camera_monitor_plugin.h.

◆ camera_name_to_index_map_

std::unordered_map<std::string, size_t> gazebo::GazeboMultiCameraMonitorPlugin::camera_name_to_index_map_
private

Definition at line 89 of file gazebo_multi_camera_monitor_plugin.h.

◆ camera_select_ros_subscriber_

ros::Subscriber gazebo::GazeboMultiCameraMonitorPlugin::camera_select_ros_subscriber_
private

Definition at line 87 of file gazebo_multi_camera_monitor_plugin.h.

◆ camera_select_subscriber_

transport::SubscriberPtr gazebo::GazeboMultiCameraMonitorPlugin::camera_select_subscriber_
private

Definition at line 86 of file gazebo_multi_camera_monitor_plugin.h.

◆ node_

transport::NodePtr gazebo::GazeboMultiCameraMonitorPlugin::node_
private

Definition at line 85 of file gazebo_multi_camera_monitor_plugin.h.

◆ recorder_

GazeboVideoRecorderPtr gazebo::GazeboMultiCameraMonitorPlugin::recorder_
private

Definition at line 92 of file gazebo_multi_camera_monitor_plugin.h.

◆ recorder_mutex_

std::mutex gazebo::GazeboMultiCameraMonitorPlugin::recorder_mutex_
private

Definition at line 93 of file gazebo_multi_camera_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