This exercise is based on CMU 16663 - F1Tenth Course :: Lab 5.
Here, we introduce SLAM, Simultaneous Localization and Mapping.
We are not going to implement SLAM ourselves, but instead use slam_toolbox to make a map of your surroundings. Please watch UPenn's F1Tenth lecture on Simultaneous Localization and Mapping (SLAM) and review CMU's F1Tenth lecture slide on Hector SLAM (slides are highly recommended).
We won't have you implement SLAM yourselves in this tutorial (that itself can be a whole project). Instead, please use slam_toolbox to make a map of the Levine Hall. Then, save the map as levine_hall.pgm and levine_hall.yaml.
- Installing
slam_toolboxsudo apt install ros-foxy-slam-toolbox
- Before running
slam_toolbox, make sure the odometry on your vehicle/simulator is tuned! - Launcing
slam_toolbox- Launch
teleopin one window - Launch
slam_toolboxin another windowros2 launch slam_toolbox online_async_launch.py params_file:=/home/nvidia/f1tenth_ws/src/f1tenth_system/f1tenth_stack/config/f1tenth_online_async.yaml
- Launch
- Visualization
- Launch rviz2
- Add
/mapby topic - Add
/graph_visualizationby topic - On top left corner of rviz, panels > add new panel > add
SlamToolBoxPluginpanel - Once you're done mapping, save the map using the plugin. You can give it a name in the text box next to "Save Map". Map will be saved in whichever directory you ran
slam_toolbox.