Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ROS_LOGICAL_CAMERA_PLUGIN_HH_
00019 #define _ROS_LOGICAL_CAMERA_PLUGIN_HH_
00020
00021 #include <sdf/sdf.hh>
00022
00023 #include "gazebo/common/Plugin.hh"
00024 #include "gazebo/common/UpdateInfo.hh"
00025 #include "gazebo/msgs/logical_camera_image.pb.h"
00026 #include "gazebo/physics/PhysicsTypes.hh"
00027 #include "gazebo/transport/Node.hh"
00028 #include "gazebo/transport/Subscriber.hh"
00029 #include "gazebo/transport/TransportTypes.hh"
00030
00031
00032 #include <ros/ros.h>
00033
00034 namespace gazebo
00035 {
00037 class ROSLogicalCameraPlugin : public ModelPlugin
00038 {
00040 public: ROSLogicalCameraPlugin();
00041
00043 public: virtual ~ROSLogicalCameraPlugin();
00044
00046 protected: physics::ModelPtr model;
00047
00049 protected: physics::LinkPtr cameraLink;
00050
00052 protected: sensors::SensorPtr sensor;
00053
00057 public: void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf);
00058
00060 protected: void FindLogicalCamera();
00061
00064 public: void OnImage(ConstLogicalCameraImagePtr &_msg);
00065
00067 protected: transport::NodePtr node;
00068
00070 protected: transport::SubscriberPtr imageSub;
00071
00073 protected: std::string robotNamespace;
00074
00076 protected: ros::NodeHandle *rosnode;
00077
00079 protected: ros::Publisher imagePub;
00080 };
00081 }
00082 #endif