3. Lidar Sensors

3.1. Learning Objectives

In this example, we will add a lidar sensor to match the one on top of Turtlebot3, and add the rostopics to publish lidar sensor data and info.

  • Add lidar sensor to the robot, and start a lidar rostopic publisher to publish the data.

  • Visualize everything in Rviz.


3.2. Adding a Lidar Rostopic

Adding a Lidar Sensor

First we need to add a lidar sensor to the robot.

  1. Go to Create -> Isaac -> Sensors -> Lidar -> Rotating.

  2. To place the synthetic lidar sensor at the same place as the robot’s lidar unit, drag the lidar prim under /World/turtlebot3_burger/base_scan. Zero out any displacement in the Transform fields inside the Property tab. The lidar prim should now be overlapping with the scanning unit of the robot.

  3. Inside the RawUSDProperties tab for the lidar prim, set the maxRange to 25. This way the lidar will not see the wall until it’s within 25 meters. This will prevent the lidar reporting a hit everywhere in the room because of the walls.

  4. We’ll check drawLines to visualize the lidar scans.

  5. Press Play to see the lidar comes to life. Red lines of the scan means hit, green means no hit, the color spectrum from green to yellow to red is proportional to the distance of the object detected.

Connecting the Lidar Rostopic

Once the lidar sensor is in place, we can add the corresponding rostopics to stream the detection data.

To add the rostopic, go to Create -> Isaac -> ROS -> Lidar. Assign the existing lidar sensor to the newly added ROS_Lidar. Scanning data will then be streamed to the rostopic /laser_scan, and point cloud data will be streamed to the topic /point_cloud.

3.3. Multiple Sensors in Rviz

To visualize all the sensors at once inside Rviz, make sure the frameID of all the cameras and sensors all have the same ID name. The frameID can be found inside the Property tab -> RawUSDProperties menu -> frameId field.

To see the Rviz output below, go to the frameID field for both ROS_Cameras and the ROS_Lidar, and change them all to turtle, then in a ROS-sourced terminal to open with the configuration provided: rviz -d ros_workspace/src/isaac_tutorials/rviz/camera_lidar.rviz.

3.4. Summary

This tutorial covered

  1. Adding a Lidar sensor

  2. Adding a Lidar Rostopic

  3. Displaying multiple sensors in Rviz.

3.4.1. Next Steps

Continue on to the next tutorial in our ROS Tutorials series, Transform Trees, to learn how to add global and relative transforms to a TF tree.

3.4.2. Further Learning

-Range Sensors for more on Lidars.