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

A Gazebo plugin that can be attached to a camera and then streams the video data using gstreamer. It streams to a configurable UDP port, default is 5600. More...

#include <gazebo_gst_camera_plugin.h>

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

Public Member Functions

void gstCallback (GstElement *appsrc)
 
 GstCameraPlugin ()
 
virtual void Load (sensors::SensorPtr sensor, sdf::ElementPtr sdf)
 
virtual void OnNewFrame (const unsigned char *image, unsigned int width, unsigned int height, unsigned int depth, const std::string &format)
 
void startGstThread ()
 
virtual ~GstCameraPlugin ()
 

Protected Attributes

rendering::CameraPtr camera
 
unsigned int depth
 
std::string format
 
unsigned int height
 
sensors::CameraSensorPtr parentSensor
 
float rate
 
int udpPort
 
unsigned int width
 

Private Attributes

GstBuffer * frameBuffer
 
std::mutex frameBufferMutex
 
GstClockTime gstTimestamp
 
GMainLoop * mainLoop
 
std::string namespace_
 
event::ConnectionPtr newFrameConnection
 
transport::NodePtr node_handle_
 
const std::string topicName = "gst_video"
 

Detailed Description

A Gazebo plugin that can be attached to a camera and then streams the video data using gstreamer. It streams to a configurable UDP port, default is 5600.

Connect to the stream via command line with: gst-launch-1.0 -v udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' \ ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink fps-update-interval=1000 sync=false

Definition at line 44 of file gazebo_gst_camera_plugin.h.

Constructor & Destructor Documentation

◆ GstCameraPlugin()

GstCameraPlugin::GstCameraPlugin ( )

Definition at line 161 of file gazebo_gst_camera_plugin.cpp.

◆ ~GstCameraPlugin()

GstCameraPlugin::~GstCameraPlugin ( )
virtual

Definition at line 168 of file gazebo_gst_camera_plugin.cpp.

Member Function Documentation

◆ gstCallback()

void GstCameraPlugin::gstCallback ( GstElement *  appsrc)

Definition at line 43 of file gazebo_gst_camera_plugin.cpp.

◆ Load()

void GstCameraPlugin::Load ( sensors::SensorPtr  sensor,
sdf::ElementPtr  sdf 
)
virtual

Definition at line 183 of file gazebo_gst_camera_plugin.cpp.

◆ OnNewFrame()

void GstCameraPlugin::OnNewFrame ( const unsigned char *  image,
unsigned int  width,
unsigned int  height,
unsigned int  depth,
const std::string &  format 
)
virtual

Definition at line 246 of file gazebo_gst_camera_plugin.cpp.

◆ startGstThread()

void GstCameraPlugin::startGstThread ( )

Definition at line 76 of file gazebo_gst_camera_plugin.cpp.

Member Data Documentation

◆ camera

rendering::CameraPtr gazebo::GstCameraPlugin::camera
protected

Definition at line 66 of file gazebo_gst_camera_plugin.h.

◆ depth

unsigned int gazebo::GstCameraPlugin::depth
protected

Definition at line 59 of file gazebo_gst_camera_plugin.h.

◆ format

std::string gazebo::GstCameraPlugin::format
protected

Definition at line 61 of file gazebo_gst_camera_plugin.h.

◆ frameBuffer

GstBuffer* gazebo::GstCameraPlugin::frameBuffer
private

Definition at line 74 of file gazebo_gst_camera_plugin.h.

◆ frameBufferMutex

std::mutex gazebo::GstCameraPlugin::frameBufferMutex
private

Definition at line 75 of file gazebo_gst_camera_plugin.h.

◆ gstTimestamp

GstClockTime gazebo::GstCameraPlugin::gstTimestamp
private

Definition at line 77 of file gazebo_gst_camera_plugin.h.

◆ height

unsigned int gazebo::GstCameraPlugin::height
protected

Definition at line 59 of file gazebo_gst_camera_plugin.h.

◆ mainLoop

GMainLoop* gazebo::GstCameraPlugin::mainLoop
private

Definition at line 76 of file gazebo_gst_camera_plugin.h.

◆ namespace_

std::string gazebo::GstCameraPlugin::namespace_
private

Definition at line 71 of file gazebo_gst_camera_plugin.h.

◆ newFrameConnection

event::ConnectionPtr gazebo::GstCameraPlugin::newFrameConnection
private

Definition at line 68 of file gazebo_gst_camera_plugin.h.

◆ node_handle_

transport::NodePtr gazebo::GstCameraPlugin::node_handle_
private

Definition at line 70 of file gazebo_gst_camera_plugin.h.

◆ parentSensor

sensors::CameraSensorPtr gazebo::GstCameraPlugin::parentSensor
protected

Definition at line 65 of file gazebo_gst_camera_plugin.h.

◆ rate

float gazebo::GstCameraPlugin::rate
protected

Definition at line 60 of file gazebo_gst_camera_plugin.h.

◆ topicName

const std::string gazebo::GstCameraPlugin::topicName = "gst_video"
private

Definition at line 72 of file gazebo_gst_camera_plugin.h.

◆ udpPort

int gazebo::GstCameraPlugin::udpPort
protected

Definition at line 63 of file gazebo_gst_camera_plugin.h.

◆ width

unsigned int gazebo::GstCameraPlugin::width
protected

Definition at line 59 of file gazebo_gst_camera_plugin.h.


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


rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Mon Feb 28 2022 23:39:04