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

Provides a ROS interface for creating videos that are useful for capturing the operation of a robot. More...

#include <gazebo_video_monitor_plugin.h>

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

Public Member Functions

 GazeboVideoMonitorPlugin ()
 
virtual void Load (sensors::SensorPtr _sensor, sdf::ElementPtr _sdf) override
 
virtual void Reset () override
 
virtual ~GazeboVideoMonitorPlugin () 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 (gazebo_video_monitor_msgs::StartGvmRecordingRequest &req, gazebo_video_monitor_msgs::StartGvmRecordingResponse &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

const std::vector< std::string > camera_names_
 
bool disable_window_
 
GazeboVideoRecorderPtr recorder_
 
std::mutex recorder_mutex_
 
bool world_as_main_view_
 

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 videos that are useful for capturing the operation of a robot.

Creates videos that present two views of the gazebo world: one stationary (world) view, and one view that is attached to a (robot) model. Additional metadata are shown in the video, like real time, sim time, and elapsed real time since the start of the recording.

Note
The parent sensor should hold two cameras with the names world_camera and robot_camera. By default, world_camera is attached to the parent link of the sensor. robot_camera is user-configurable.
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: reference model configuration with a name attribute pointing to the robot camera (see parseRefModelConfig)

Definition at line 55 of file gazebo_video_monitor_plugin.h.

Constructor & Destructor Documentation

◆ GazeboVideoMonitorPlugin()

gazebo::GazeboVideoMonitorPlugin::GazeboVideoMonitorPlugin ( )

Definition at line 25 of file gazebo_video_monitor_plugin.cpp.

◆ ~GazeboVideoMonitorPlugin()

gazebo::GazeboVideoMonitorPlugin::~GazeboVideoMonitorPlugin ( )
overridevirtual

Definition at line 29 of file gazebo_video_monitor_plugin.cpp.

Member Function Documentation

◆ initRos()

void gazebo::GazeboVideoMonitorPlugin::initRos ( )
overrideprivatevirtual

Reimplemented from gazebo::GazeboMonitorBasePlugin.

Definition at line 59 of file gazebo_video_monitor_plugin.cpp.

◆ Load()

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

Reimplemented from gazebo::GazeboMonitorBasePlugin.

Definition at line 31 of file gazebo_video_monitor_plugin.cpp.

◆ onNewImages()

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

Implements gazebo::GazeboMonitorBasePlugin.

Definition at line 81 of file gazebo_video_monitor_plugin.cpp.

◆ Reset()

void gazebo::GazeboVideoMonitorPlugin::Reset ( )
overridevirtual

Definition at line 54 of file gazebo_video_monitor_plugin.cpp.

◆ startRecordingServiceCallback()

bool gazebo::GazeboVideoMonitorPlugin::startRecordingServiceCallback ( gazebo_video_monitor_msgs::StartGvmRecordingRequest &  req,
gazebo_video_monitor_msgs::StartGvmRecordingResponse &  res 
)
private

Definition at line 97 of file gazebo_video_monitor_plugin.cpp.

◆ stopRecording()

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

Definition at line 91 of file gazebo_video_monitor_plugin.cpp.

◆ stopRecordingServiceCallback()

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

Definition at line 121 of file gazebo_video_monitor_plugin.cpp.

Member Data Documentation

◆ camera_names_

const std::vector<std::string> gazebo::GazeboVideoMonitorPlugin::camera_names_
private

Definition at line 73 of file gazebo_video_monitor_plugin.h.

◆ disable_window_

bool gazebo::GazeboVideoMonitorPlugin::disable_window_
private

Definition at line 77 of file gazebo_video_monitor_plugin.h.

◆ recorder_

GazeboVideoRecorderPtr gazebo::GazeboVideoMonitorPlugin::recorder_
private

Definition at line 75 of file gazebo_video_monitor_plugin.h.

◆ recorder_mutex_

std::mutex gazebo::GazeboVideoMonitorPlugin::recorder_mutex_
private

Definition at line 76 of file gazebo_video_monitor_plugin.h.

◆ world_as_main_view_

bool gazebo::GazeboVideoMonitorPlugin::world_as_main_view_
private

Definition at line 78 of file gazebo_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