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 #ifndef _WIN32
28 #include <sys/time.h>
29 #endif
30 
31 #include <boost/thread.hpp>
32 #include <boost/thread/mutex.hpp>
33 
34 #include <std_msgs/String.h>
35 
36 #include <gazebo_msgs/ContactState.h>
37 #include <gazebo_msgs/ContactsState.h>
38 
39 #include <gazebo/sensors/sensors.hh>
40 #include <gazebo/msgs/msgs.hh>
41 #include <gazebo/physics/physics.hh>
42 #include <sdf/sdf.hh>
43 #include <gazebo/transport/TransportTypes.hh>
44 #include <gazebo/msgs/MessageTypes.hh>
45 #include <gazebo/common/Time.hh>
46 #include <gazebo/sensors/SensorTypes.hh>
47 #include <gazebo/sensors/ContactSensor.hh>
48 #include <gazebo/common/Plugin.hh>
49 
50 namespace gazebo
51 {
53  class GazeboRosBumper : public SensorPlugin
54  {
56  public: GazeboRosBumper();
57 
59  public: ~GazeboRosBumper();
60 
63  public: void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf);
64 
66  private: void OnContact();
67 
71 
72  private: sensors::ContactSensorPtr parentSensor;
73 
75  private: std::string bumper_topic_name_;
76 
77  private: std::string frame_name_;
78 
80  private: gazebo_msgs::ContactsState contact_state_msg_;
81 
83  private: std::string robot_namespace_;
84 
86  private: void ContactQueueThread();
87  private: boost::thread callback_queue_thread_;
88 
89  // Pointer to the update event connection
90  private: event::ConnectionPtr update_connection_;
91  };
92 }
93 
94 #endif
95 
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 Wed Aug 24 2022 02:47:52