Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #pragma once
00018
00019 #include <string>
00020 #include <mutex>
00021
00022 #include "gazebo/common/Plugin.hh"
00023 #include "gazebo/sensors/CameraSensor.hh"
00024 #include "gazebo/gazebo.hh"
00025 #include "gazebo/common/common.hh"
00026 #include "gazebo/rendering/Camera.hh"
00027 #include "gazebo/util/system.hh"
00028 #include "gazebo/transport/transport.hh"
00029 #include "gazebo/msgs/msgs.hh"
00030
00031 #include <gst/gst.h>
00032
00033 namespace gazebo
00034 {
00035
00036
00044 class GAZEBO_VISIBLE GstCameraPlugin : public SensorPlugin
00045 {
00046 public: GstCameraPlugin();
00047
00048 public: virtual ~GstCameraPlugin();
00049
00050 public: virtual void Load(sensors::SensorPtr sensor, sdf::ElementPtr sdf);
00051
00052 public: virtual void OnNewFrame(const unsigned char *image,
00053 unsigned int width, unsigned int height,
00054 unsigned int depth, const std::string &format);
00055
00056 public: void startGstThread();
00057 public: void gstCallback(GstElement *appsrc);
00058
00059 protected: unsigned int width, height, depth;
00060 float rate;
00061 protected: std::string format;
00062
00063 protected: int udpPort;
00064
00065 protected: sensors::CameraSensorPtr parentSensor;
00066 protected: rendering::CameraPtr camera;
00067
00068 private: event::ConnectionPtr newFrameConnection;
00069
00070 private: transport::NodePtr node_handle_;
00071 private: std::string namespace_;
00072 private: const std::string topicName = "gst_video";
00073
00074 GstBuffer *frameBuffer;
00075 std::mutex frameBufferMutex;
00076 GMainLoop *mainLoop;
00077 GstClockTime gstTimestamp;
00078
00079 };
00080
00081 }
rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Thu Apr 18 2019 02:43:43