RRT Global Planner for ROS

Here is a Rapidly Exploring Random Trees (RRT) global path planner plugin for ROS written in C++. To use the planner in simulation or with an actual vehicle, follow the instructions below. All code is available on GitHub here.

RRT Global Planner with TurtleBot3 Simulation

Install Dependancies and Build

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

Usage

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.

Examples

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.

ROS API

Published Topics

~/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.

Subscribed Topics

None.

Parameters

~/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.

Services

None.