Skip to main content
The 2D lidar SLAM sample application is based on Cartographer, which is capable of completing indoor map construction and localization based on 2D lidar sensors. It’s suitable for indoor navigation of robots.

Figure: Sample results of 2D lidar SLAM

Pipeline flow for 2D lidar SLAM

Figure: Pipeline flow for 2D lidar SLAM

ROS nodes used in the 2D lidar SLAM pipeline

ROS topics/services used in 2D lidar SLAM

Table: ROS topics used in 2D lidar SLAM

ROS topicTypePublished by
/tracked_posegeometry_msgs.msg.PoseStampedcartographer_node
/tftf2_msgs.msg.TFMessagecartographer_node
/submap_listcartographer_ros_msgs.msg.SubmapListcartographer_node
/scan_matched_points2sensor_msgs.msg.PointCloud2cartographer_node
/mapnav_msgs.msg.OccupancyGridcartographer_occupancy_grid_node

Table: ROS services used in in 2D lidar SLAM

ROS serviceTypeProvided by
/qrb_slam_commandqrb_ros_slam_msgs.srv.SlamCommandcartographer_node

Prerequisites

Run out-of-the-box 2D lidar SLAM

1

Set up the robot base

Note The following configuration applies exclusively to Qualcomm’s robot base. If you are using a custom or third-party robot base, skip this configuration step and apply configurations appropriate to your own robot base.
  1. Open a new terminal connect to the device.
  2. Select the robot base model.
    • 0604 AMR: robot_base (default)
    • Mini AMR: robot_base_mini
  3. (Optional) If you don’t connect the ultrasonic sensor to the MCB, disable ultrasound emergency stop.
  4. Launch the robot base AMR.
2

Set up the 2D lidar

In a new terminal, run the following commands.
3

Run the 2D lidar SLAM

In a new terminal, run the following commands.
4

Run the qrb_slam_service_request script

In a new terminal, run the following commands.
5

Start mapping

In the terminal opened in the preceding step, use the keyboard to send control commands, such as starting the mapping process.