Introduction
SLAM is basically trying to map out an unknown environment while figuring out where it is in this unknown environment at the same time. We need to provide 2 streams of data to SLAM node.
-
Distance/Range Sensor
- LiDAR (Laser Scanner) or a Depth Camera
- Publishes to
sensor_msgs/msg/LaserScan - This gives SLAM algorithm precise distance to walls, tables, etc
-
Odometry
- Wheel Encoders + Inertial Measurement Unit (IMU)
- It publishes nav_msgs/msg/Odometry
- This tells SLAM roughly how far the wheels think the robot travelled
-
Unified Robot Description Format (URDF)
- We need this so that we can generate the TF Tree which is being fed to the
slam_toolbox - We must use a
robot_state_publishernode to launch URDF file
- We need this so that we can generate the TF Tree which is being fed to the
Software Tools
There are some industry standard open-source packages:
-
slam_toolbox- modern default SLAM package for ROS 2
- basically whatever we want to change, like odom and laser topic names we have are not default, we will just edit the YAML file
-
cartographer- Highly accurate but advanced to set up
-
nav2_map_server- utility tool used to actually save a finished map from terminal and load it back up later for navigation