This repository contains a ROS 2 workspace with tools that can collect data to benchmark SLAM algorithms using a Gazebo simulation with Leo Rover.
- Clone this package:
git clone https://github.com/jasiex01/leo_sim_slam_comparison_workspace
- Install Gazebo
- Install all dependencies with
rosdep
and install all SLAM packages: - Build the workspace using
colcon build
- Source the workspace
source install/setup.bash
Data collection happens in 2 steps:
- Preparation of
rosbag
with sensor and robot data - Running the SLAM algorithm with data from
rosbag
and collecting results
- Launch the simulation:
ros2 launch leo_gz_bringup leo_gz.launch.py
- Start collecting the data using
ros2 bag record
. Make sure that the following topics are recorded:
- /tf_static
- /world/leo_empty/dynamic_pose/info
- /joint_states
- /odom
- /clock
- /tf
- /imu/data_raw
- /lidar/laserscan
- /cmd_vel
- /camera/camera_info
- /robot_description
- /camera/points Note: the bag might reach sizes above 20-30 GB. Ensure that you have enough disk space. The size might be greatly reduced if /camera/points topic is not recorded - the topic is not needed if only algorithms using LiDAR are compared.
- Drive the rover manually in the simulation world. To do that you can use for example:
ros2 launch leo_teleop joy_teleop.launch.xml
which will allow you to control the rover using a gamepad. - Save your rosbag
- Launch SLAM algorithm, ground_truth_odom node to calculate the rover position in simulation, pose_logger and ram_logger to export pose information and RAM usage information to .CSV files. To do all that you can use and modify the
test_environment.launch.xml
file - Launch rotop tool to provide CPU usage data.
- Play your recorded
rosbag
- Wait until the
rosbag
finishes its playback - Save the map generated by SLAM algorithm using
nav2_map_server
tool
After following the steps you should have .CSV files containing RAM usage, CPU usage and poses (ground truth and estimated), and a .PGM map file.
Now you can perform the analysis using tools in the SLAM comparison tools repository.
Note: make sure to crop the maps to the size of the ground truth maps.