ROSLogicalCameraPlugin.hh
Go to the documentation of this file.
00001 /*
00002  * Copyright 2016 Open Source Robotics Foundation
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
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 // ROS
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


osrf_gear
Author(s):
autogenerated on Mon Sep 5 2016 03:41:33