Advertisement
Guest User

GazeboRosRfid.h

a guest
May 8th, 2014
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.84 KB | None | 0 0
  1. /* Copyright (C) 2012
  2.  *     Jonas Mellin & Zakiruz Zaman
  3.  * Licensed under the Apache License, Version 2.0 (the "License");
  4.  * you may not use this file except in compliance with the License.
  5.  * You may obtain a copy of the License at
  6.  *
  7.  *     http://www.apache.org/licenses/LICENSE-2.0
  8.  *
  9.  * Unless required by applicable law or agreed to in writing, software
  10.  * distributed under the License is distributed on an "AS IS" BASIS,
  11.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12.  * See the License for the specific language governing permissions and
  13.  * limitations under the License.
  14.  */
  15. /* Desc: Gazebo RFID Sensor
  16.  * Author: Jonas Mellin & Zakiruz Zaman
  17.  * Date: 6th December 2011
  18.  */
  19.  
  20.  
  21. #ifndef GAZEBO_ROS_RFID_HH
  22. #define GAZEBO_ROS_RFID_HH
  23.  
  24. #include <map>
  25. #include <string>
  26. #include <gazebo/sensors/SensorTypes.hh>
  27. #include <gazebo/sensors/Sensor.hh>
  28. #include <gazebo/physics/HingeJoint.hh>
  29. #include <gazebo/physics/Contact.hh>
  30. #include <sdf/sdf.hh>
  31. #include <sdf/Param.hh>
  32. #include <gazebo/math/Pose.hh>
  33. #include <gazebo/math/Quaternion.hh>
  34. #include <tf/tf.h>
  35.  
  36.  
  37. #include <gazebo/physics/World.hh>
  38. #include <gazebo/physics/Entity.hh>
  39.  
  40. #include <gazebo/common/Exception.hh>
  41.  
  42. #include <gazebo/transport/Node.hh>
  43. #include <gazebo/transport/Publisher.hh>
  44.  
  45. #include <gazebo/msgs/msgs.hh>
  46.  
  47. #include <gazebo/math/Vector3.hh>
  48.  
  49. /*changer en rfid tag ros*/
  50. // #include <gazebo/sensors/RFIDTag.hh>
  51. /*changer en rfid tag ros*/
  52.  
  53. #include <gazebo_plugins/gazebo_ros_rfid.h>
  54. #include <ros/ros.h>
  55.  
  56. namespace gazebo
  57. {
  58.   class RFIDTag;
  59.   class GazeboRosRfidTag : public SensorPlugin
  60.   {
  61.     /// Constructor
  62.     public: GazeboRosRfid();
  63.  
  64.     /// Destructor
  65.     public: ~GazeboRosRfid();
  66.  
  67.     /// \brief Load the plugin
  68.     /// \param take in SDF root element
  69.     public: void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf);
  70.  
  71.     /// Update the controller
  72.     private: void OnScan();
  73.     private: void GazeboRosRfid::EvaluateTags();
  74.     private: bool GazeboRosRfid::CheckTagRange(const math::Pose &_pose);
  75.     private: void GazeboRosRfid::AddTag(RFIDTag *_tag);
  76.  
  77.     /// \brief pointer to ros node
  78.     private: ros::NodeHandle* rosnode_;
  79.     private: ros::Publisher contact_pub_;
  80.  
  81.     private: sensors::RfidSensorPtr parentSensor;
  82.  
  83.     /// \brief set topic name of broadcast
  84.     private: std::string scan_topic_name_;
  85.  
  86.     private: std::string frame_name_;
  87.  
  88.         /// \brief broadcast some string for now.
  89.     private: msgs::Pose scan_pose_msg_;
  90.  
  91.     /// \brief for setting ROS name space
  92.     private: std::string robot_namespace_;
  93.  
  94.     private: ros::CallbackQueue scan_queue_;
  95.     private: void ScanQueueThread();
  96.     private: boost::thread callback_queue_thread_;
  97.  
  98.     // Pointer to the update event connection
  99.     private: event::ConnectionPtr update_connection_;
  100.   };
  101. }
  102.  
  103. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement