25 #ifndef _LEICA_PLUGIN_H 26 #define _LEICA_PLUGIN_H 30 #include <boost/bind.hpp> 31 #include <boost/thread.hpp> 38 #include <sensor_msgs/LaserScan.h> 39 #include "std_msgs/Float32.h" 40 #include "sensor_msgs/RegionOfInterest.h" 42 #include <gazebo/physics/physics.hh> 43 #include <gazebo/transport/TransportTypes.hh> 44 #include <gazebo/msgs/MessageTypes.hh> 45 #include <gazebo/common/Time.hh> 46 #include <gazebo/common/Plugin.hh> 47 #include <gazebo/common/Events.hh> 48 #include <gazebo/sensors/SensorTypes.hh> 49 #include <gazebo/plugins/GpuRayPlugin.hh> 50 #include <gazebo_plugins/PubQueue.h> 52 #include <condition_variable> 77 void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf);
ros::Subscriber sub_
Subscriber for the laser sensor.
ros::CallbackQueue cb_queue_
Queue for the callback functions.
void gazeboMsgToROSMsg(ConstLaserScanStampedPtr &_msg)
Tailor the gazebo message to the ROS format.
physics::WorldPtr world_
Pointer to the virtual world where the simulation takes place.
void disconnectFromLaser()
Unregister the laser.
std::string namespace_
The namespace of the Leica station.
gazebo::transport::NodePtr gazebo_node_
Node for gazebo.
void gazeboLoaderThread()
Load the sensor controller.
PubQueue< sensor_msgs::LaserScan >::Ptr pub_queue_
Publisher queue.
std::string world_name_
Stores the name of the virtual world where the simulation takes place.
sdf::ElementPtr sdf_
Pointer to the *.sdf file.
std::string frame_name_
Stores the name of the root of the reference system tree.
LeicaPlugin()
Construct a new Gazebo ROS Laser object.
void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf)
Load the plugin controller.
void connectToLaser()
Register de new laser and connect to its topic.
std::mutex mutex_
Mutex used so that no laser sensor data is published until the configuration of the scan window has b...
int laser_connect_count_
A counter to register the number of laser sensors in use.
boost::thread deferred_load_thread_
Object for the sensor controller thread.
void configureScanWindow(const sensor_msgs::RegionOfInterestConstPtr &_msg)
Configure the scan window from a topic.
void callbacksQueueHelperThread()
Thread that calls all functions in the callback queue when resources are available.
ros::NodeHandle * nh_
Pointer to the ROS node.
std::thread queue_helper_thread_
Thread that calls all functions in the callback queue when resources are available.
gazebo::transport::SubscriberPtr laser_scan_sub_
Gazebo part of the laser sensor subscriber.
std::string tf_prefix_
tf_prefix_ as the namespace
ros::Publisher pub_
Publisher for the laser sensor.
std::string topic_name_
Saves the name of the topic where the laser scanner publishes what it reads.
unsigned int seed_
Seed for the Gaussian noise generator.
std::condition_variable condition_variable_
Variable used to wait until the configuration of the scan window has been completed.
bool start_laser_
Flag to start the laser after the scan window has been set.
PubMultiQueue pmq_
Object for the ROS queue system.
sensors::GpuRaySensorPtr parent_ray_sensor_
Pointer to the laser sensor object.
~LeicaPlugin()
Destroy the Gazebo ROS Laser object.