Skip to content

Gazebo ROS Ray Sensors

Bruce Allen edited this page Apr 24, 2020 · 16 revisions

ROS provides Ray sensors along with its other sensors under gazebo_ros_pkgs in its repository at https://github.com/ros-simulation/gazebo_ros_pkgs under gazebo_plugins. A tutorial overview of ROS plugins is at http://gazebosim.org/tutorials?tut=ros_gzplugins. We are interested in Ray-based plugins that produce point cloud messages of type sensor_msgs/PointCloud2 or sensor_msgs/PointCloud.

These ray sensors publish these sensor messages:

  • sensor_msgs/Range: The closest distance in the scan.
  • sensor_msgs/LaserScan: One horizontal scan from the center vertical ray.
  • sensor_msgs/PointCloud: The point cloud of range and retro values given a height, width, scan angle, and horizontal angle.
  • sensor_msgs/PointCloud2: Version 2 of sensor_msgs/PointCloud.

These ray sensors detect using either Physics (non-gpu) or graphics (gpu).

Documentation about ROS Ray sensors is here: https://github.com/ros-simulation/gazebo_ros_pkgs/wiki/ROS-2-Migration:-Ray-sensors. Here are some key points:

  • ROS provides four ray sensors:
    • gazebo_ros_laser - This publishes sensor_msgs/LaserScan, one horizontal scan from the center vertical ray, rather than a sensor_msgs/PointCloud2 containing multiple rows.
    • gazebo_ros_gpu_laser - Same as gazebo_ros_laser, but is faster because it uses the GPU to identify points reflected from graphics information rather than from physics information.
    • gazebo_ros_block_laser - Publishes sensor_msgs/PointCloud.
    • gazebo_ros_range - Returns the minimum range value rather than sensor_msgs/PointCloud2.
  • In ROS 2, there is one plugin for all of this: gazebo_ros_ray_sensor. Select ray or gpu_ray for detection approach. Select output_type, one of Range, LaserScan, PointCloud, or PointCloud2, for the desired output. They are all compatible with GPU or Physics-based sensing.
Clone this wiki locally