ROSNavBench is an open-source framework designed to facilitate the testing and comparison of various local and global planners in the Robot Operating System (ROS) 2. This tool provides a comprehensive platform for evaluating planner performance across diverse trajectories, collecting several metrics such as navigation time, path length, and success rate.
Efficient autonomous navigation in mobile robotics demands robust path planning capabilities. Despite the availability of numerous evaluation tools and frameworks for path planners, there is a significant gap in open-source, automated frameworks specifically tailored for ROS 2. ROSNavBench addresses this gap by providing a comprehensive statistical analysis necessary for robust decision-making. This framework automates the benchmarking of ROS 2-based local and global path planners, offering quantitative assessments across critical metrics such as efficiency, reliability, and adaptability under diverse environmental scenarios.
- Comprehensive Testing: Perform tests and comparisons among diverse local and global planners across various types of trajectories.
- Quantitative Evaluation: Assess the efficiency of planners using various metrics such as safety, success rate, path length, navigation time, path deviation, and number of recoveries.
- Automated Iterative Testing: Enhance result reliability through statistical analysis and streamline the workflow.
- Gazebo Sim Integration: Built on Gazebo Sim (GZ) for modern physics simulation and improved performance.
Before using the ROS 2 ROSNavBench, make sure you have the following prerequisites in place:
-
ROS 2 Installation: Ensure you have ROS 2
Humbleinstalled on your system. This forms the foundation for running theROSNavBench. -
Python Libraries: Install the following Python libraries to enable the functionality of the
ROSNavBench:-
Csv: Used for handling CSV file formats.
pip3 install python-csv
-
Reportlab: Required for generating PDF reports.
pip3 install reportlab
-
Jinja2: This library is used for template rendering.
pip3 install Jinja2
-
psutil: Enables monitoring of system resources.
pip3 install psutil
-
Nav2 Simple Commander: Essential for navigation tasks and commands.
sudo apt install ros-humble-nav2-simple-commander
-
-
Gazebo Sim: ROSNavBench utilizes Gazebo Sim (GZ) for physics simulation. Install the required Gazebo Sim packages:
sudo apt install \ ros-$ROS_DISTRO-ros-gz-sim \ ros-$ROS_DISTRO-ros-gz-bridge \ ros-$ROS_DISTRO-ros-gz-image
-
Turtlebot3: The ROSNavBench package employs the
turtlebot3robot as the default choice for evaluating its functionalities:sudo apt install ros-$ROS_DISTRO-turtlebot3*
-
Nav2: Install the Nav2 packages using your operating system's package manager:
sudo apt install \ ros-$ROS_DISTRO-navigation2 \ ros-$ROS_DISTRO-nav2-bringup
Please ensure that these prerequisites are satisfied before proceeding with the ROSNavBench setup and usage.
-
Clone the Repository:
git clone https://github.com/riotu-lab/ROSNavBench
-
Build the Workspace:
Navigate to your ROS 2 workspace and build the package:
cd ~/your_workspace/src colcon build --packages-select ROSNavBench source install/setup.bash
ROSNavBench has been migrated from Gazebo Classic to Gazebo Sim (GZ), providing improved simulation performance and compatibility with modern ROS 2 distributions. Key improvements include:
- Enhanced Simulation Performance: Leverages Gazebo Sim's improved physics engine and rendering capabilities
- Modern ROS 2 Integration: Utilizes
ros_gz_sim,ros_gz_bridge, andros_gz_imagepackages for seamless integration - Updated Robot Models: Includes Gazebo Sim-compatible robot models, world files, and URDF configurations
- Improved Launch System: Refactored launch files for better parameter handling and spawn pose management
- Navigation Enhancements: Updated Nav2 configurations and behavior tree templates for optimal performance
The framework now includes Gazebo Sim-compatible simulation files located in the simulations/ directory, including world files (.sdf), robot models, and URDF configurations specifically designed for Gazebo Sim.
To initiate the ROSNavBench test, follow these steps:
-
Export File Name and Run:
-
You can pass the configuration file directly with the
params_filelaunch argument (recommended), or setPARAMS_FILEfor backward compatibility.- Example using a relative path (resolved relative to the package):
ros2 launch ROSNavBench main.launch.py params_file:=config/house_experiment_no_obstaclesyaml.yaml
- Example using an absolute path:
ros2 launch ROSNavBench main.launch.py params_file:=/home/USER/riout_ws/src/ROSNavBench/config/house_experiment_no_obstaclesyaml.yaml
- Example using
PARAMS_FILE:
export PARAMS_FILE="/home/USER/riout_ws/src/ROSNavBench/config/house_experiment_no_obstaclesyaml.yaml" ros2 launch ROSNavBench main.launch.py
-
-
Accessing Results:
- Once the execution of all the tests is complete, the generated files will be automatically saved to the specified results folder.
- You can find the raw results in the
sharedirectory of theROSNavBenchpackage.
Note: More information about the configuration check here.
By following these steps, you'll be able to execute the benchmarking test.
- Relative paths in
config/*.yamlare resolved relative to the config file location (e.g.,world_path,nav_config,urdf_file,behaviour_tree_directory). - results_directory:
- If absolute, it is used as-is.
- If relative (e.g.,
results), it is resolved to the ROSNavBench package root and created if missing.
- models_path supports multiple entries separated by
:and each entry can be relative.
- Controllers:
DWB,RPP,DWB_RSC,MPPI - Planners:
GridBased(NavFn),NavFn,smac_planner,ThetaStar,Lattice,SmacHybraid
To test with your custom robots, for example husky robot, follow these steps:
-
Specify the robot
- Follow the instructions inside the documentation to specfiy a robot. check here
-
Update your World
- To add a new world for ROSNavBench, follow the instructions here
- Note: World files should be in Gazebo Sim SDF format (
.sdf) for compatibility with the current version.
-
Configure Example Settings:
- Open the configuration file located at
ROSNavBench/config. - Edit the absolute paths and other parameters to match your machine's setup such as the
world,map,controllers, andurdf_file... - Customize the parameters according to the example you want to run. check here
- Open the configuration file located at
-
Adding a New Controller or Planner
- To add a new controller or planner for
ROSNavBench, follow the instructions here
- To add a new controller or planner for
-
Adding a New Behavior Tree
- To add a new Behavior Tree(BT) for
ROSNavBench, follow the instructions here
- To add a new Behavior Tree(BT) for
-
Build the Workspace:
- In your terminal, build the workspace where the
ROSNavBenchis located.
colcon build source install/setup.bash - In your terminal, build the workspace where the
-
Set the Parameters File and Launch:
-
Launch using the
params_fileargument (orPARAMS_FILEfor backward compatibility).- For example:
ros2 launch ROSNavBench main.launch.py params_file:=config/house_experiment_no_obstaclesyaml.yaml
-
Or:
export PARAMS_FILE="/home/USER/riout_ws/src/ROSNavBench/config/house_experiment_no_obstaclesyaml.yaml" ros2 launch ROSNavBench main.launch.py
-
-
Accessing Results:
- Once the execution of all the tests is complete, the generated files will be automatically saved to the specified results folder.
- You can find the raw results in the
sharedirectory of theROSNavBenchpackage.
By following these steps, you'll be able to effortlessly launch and execute the provided example, view the results, and adapt the tool to your specific machine configuration.