gazebo::GstCameraPlugin
#include <gazebo_gst_camera_plugin.hh>
Inherits from SensorPlugin
Public Functions
| Name | |
|---|---|
| GstCameraPlugin() | |
| virtual | ~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() |
| void | stopGstThread() |
| void | gstCallback(GstElement * appsrc) |
| void | cbVideoStream(const boost::shared_ptr< const msgs::Int > & _msg) |
Protected Attributes
| Name | |
|---|---|
| unsigned int | width |
| unsigned int | height |
| unsigned int | depth |
| float | rate |
| std::string | format |
| std::string | udpHost |
| int | udpPort |
| bool | useRtmp |
| std::string | rtmpLocation |
| bool | useCuda |
| sensors::CameraSensorPtr | parentSensor |
| rendering::CameraPtr | camera |
Detailed Description
class gazebo::GstCameraPlugin;
A Gazebo plugin that can be attached to a camera and then streams the video data using gstreamer. It streams to a configurable UDP IP and UDP Port, defaults are respectively 127.0.0.1 and 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
Public Functions Documentation
function GstCameraPlugin
GstCameraPlugin()
function ~GstCameraPlugin
virtual ~GstCameraPlugin()
function Load
virtual void Load(
sensors::SensorPtr sensor,
sdf::ElementPtr sdf
)
function OnNewFrame
virtual void OnNewFrame(
const unsigned char * image,
unsigned int width,
unsigned int height,
unsigned int depth,
const std::string & format
)
function startGstThread
void startGstThread()
function stopGstThread
void stopGstThread()
function gstCallback
void gstCallback(
GstElement * appsrc
)
function cbVideoStream
void cbVideoStream(
const boost::shared_ptr< const msgs::Int > & _msg
)
Protected Attributes Documentation
variable width
unsigned int width;
variable height
unsigned int height;
variable depth
unsigned int depth;
variable rate
float rate;
variable format
std::string format;
variable udpHost
std::string udpHost;
variable udpPort
int udpPort;
variable useRtmp
bool useRtmp;
variable rtmpLocation
std::string rtmpLocation;
variable useCuda
bool useCuda;
variable parentSensor
sensors::CameraSensorPtr parentSensor;
variable camera
rendering::CameraPtr camera;
Updated on 2022-06-01 at 12:37:01 +0000
Last update:
June 1, 2022