A Rapidly Exploring Random Trees (RRT) global path planner plugin for ROS.
cd ~/catkin_ws/src
git clone https://github.com/mech0ctopus/rrt-global-planner.git
cd .. && rosdep install --from-paths src --ignore-src -r -y
catkin_make
source devel/setup.bash
Within the move_base node in your launch file, set the base_global_planner
parameter to global_planner/RRTGlobalPlanner
and load the required parameters.
<param name="base_global_planner" value="global_planner/RRTGlobalPlanner"/>
<rosparam file="$(find rrt-global-planner)/params/rrt_global_planner.yaml" command="load" />
After launching the system, when you set a move_base/goal
using RViz's 2D Nav Goal
or with an action client, the RRTGlobalPlanner
will be called. The global path will be published as a topic for visualization. Optionally, a visualization of the full RRT constructed for path planning will be published.
RRTGlobalPlanner
's output can be visualized in RViz. To see the global path, add a Path
display and subscribe to ~/move_base/RRTGlobalPlanner/plan
. To see the full tree (viz_tree
must be true), add a Marker
display and subscribe to ~/move_base/RRTGlobalPlanner/tree
.
An example launch file for using RRTGlobalPlanner
with the TurtleBot3 Simulation is located in rrt-global-planner/launch.
An example RViz config file for using RRTGlobalPlanner
with the TurtleBot3 Simulation is located in rrt-global-planner/config.
If you find that the RRT global planner continues to produce plans even after a solution has been found, try setting the /move_base/planner_frequency
to 0. Zero is normally what the default value is (see planner_frequency
on the move_base Wiki), but that's not what the value is in the turtlebot examples. If you're running the turtlebot examples, you can change the parameter in turtlebot3_navigation/param/move_base_params.yaml
.
If you see that the RRT planner repeatedly fails to find a solution, you may want to play around with the parameters in the rrt_global_planner.yaml
.
~/move_base/RRTGlobalPlanner/plan
(nav_msgs/Path)
- The global path constructed by the planner. Used for visualization purposes.
~/move_base/RRTGlobalPlanner/tree
(visualization_msgs/Marker)
- Visualization of full tree built during planning process.
None.
~/move_base/RRTGlobalPlanner/goal_tol
(double
, default: 0.05)
- Cartesian goal tolerance to be achieved by the global planner.
~/move_base/RRTGlobalPlanner/K_in
(int
, default: 4000)
- Maximum number of iterations to attempt to find a plan.
~/move_base/RRTGlobalPlanner/d
(double
, default: 0.2)
- Distance to extend tree per iteration.
~/move_base/RRTGlobalPlanner/viz_tree
(bool
, default: false)
- Whether to publish full tree on
~/move_base/RRTGlobalPlanner/tree
topic for visualization purposes after planning success.
None.