gazebo_ros_bumper.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef GAZEBO_ROS_BUMPER_HH
19 #define GAZEBO_ROS_BUMPER_HH
20 
21 #include <string>
22 
23 #include <ros/ros.h>
24 #include <ros/callback_queue.h>
25 #include <ros/advertise_options.h>
26 
27 #include <sys/time.h>
28 
29 #include <boost/thread.hpp>
30 #include <boost/thread/mutex.hpp>
31 
32 #include <std_msgs/String.h>
33 
34 #include <gazebo_msgs/ContactState.h>
35 #include <gazebo_msgs/ContactsState.h>
36 
37 #include <gazebo/sensors/sensors.hh>
38 #include <gazebo/msgs/msgs.hh>
39 #include <gazebo/physics/physics.hh>
40 #include <sdf/sdf.hh>
41 #include <gazebo/transport/TransportTypes.hh>
42 #include <gazebo/msgs/MessageTypes.hh>
43 #include <gazebo/common/Time.hh>
44 #include <gazebo/sensors/SensorTypes.hh>
45 #include <gazebo/sensors/ContactSensor.hh>
46 #include <gazebo/common/Plugin.hh>
47 
48 namespace gazebo
49 {
51  class GazeboRosBumper : public SensorPlugin
52  {
54  public: GazeboRosBumper();
55 
57  public: ~GazeboRosBumper();
58 
61  public: void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf);
62 
64  private: void OnContact();
65 
69 
70  private: sensors::ContactSensorPtr parentSensor;
71 
73  private: std::string bumper_topic_name_;
74 
75  private: std::string frame_name_;
76 
78  private: gazebo_msgs::ContactsState contact_state_msg_;
79 
81  private: std::string robot_namespace_;
82 
84  private: void ContactQueueThread();
85  private: boost::thread callback_queue_thread_;
86 
87  // Pointer to the update event connection
88  private: event::ConnectionPtr update_connection_;
89  };
90 }
91 
92 #endif
93 
std::string bumper_topic_name_
set topic name of broadcast
void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf)
Load the plugin.
ros::CallbackQueue contact_queue_
boost::thread callback_queue_thread_
std::string robot_namespace_
for setting ROS name space
event::ConnectionPtr update_connection_
void OnContact()
Update the controller.
A Bumper controller.
ros::NodeHandle * rosnode_
pointer to ros node
sensors::ContactSensorPtr parentSensor
gazebo_msgs::ContactsState contact_state_msg_
broadcast some string for now.


gazebo_plugins
Author(s): John Hsu
autogenerated on Tue Mar 26 2019 02:31:27