Implementation of autonomous exploration based on RRT (Rapidly Exploring Trees) algorithm using ROS2 and SLAM Toolbox by Nav2 framework. Algorithm is heavily inspired by the paper published on IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) in 2017.
This project is just an addition to my Mobile Robot Programming experiments and shouldn't be used as a state-of-the-art exploration algorithm for the real system.
It was tested on Ubuntu 22.04, with ROS2 Humble and Gazebo Classic.
Warning: Gazebo Classic is outdated. This project may be moved to the Gazebo Fortress/Harmonic in the future.
This project relies on external software:
nanoflannC++11 header-only library for building KD-Trees. The code is already contained in the project.PCL Cloud Libraryfor frontier clustering. Refer to installation instructions here.
Run from the project root directory:
home~$ colcon build && source install/setup.bashhome~$ ros2 launch single_agent_rrt rrt_exploration.launch.py- Algorithm finds frontiers very fast in the beginning and as the robot progresses but slows down exponentially when there's not much left to explore.
- Rarely occuring bug in
local_frontier_detectorwhich I still need to investigate. - Current implementation of RRT trees visualization works very slowly in rviz2.
- Previous version of the code used nodes composition. I am planning on bringing it back for convenience.
- An extra
frontier detection rateobservation block shall be added which tracks the frontier update rate. When the map is almost fully explored and frontier detection rate becomes slow enough to trigger a threshold the algorithm switches from building RRT to bruteforce search. - A special hash map tracking the already explored areas shall be added to filter out these areas in
filternode. - Currently I added a custom Costmap2D layer which fixes a bug currently existing in Gazebo Classic simulation. If the bug is fixed for you or you use other versions just disable the layer in nav2_params:
custom_layer:
plugin: "nav2_custom_costmap_plugin::CustomLayer"
enabled: False
