OMPL/Add New Planner

If you would like to use a planner that does not come standard with MoveIt!, it is possible to do so. Although there are several ways of accomplishing this, the easiest may be to add the new planner to an existing motion planning library. The advantages of this approach are that the interface for these libraries and MoveIt! is already written and, if the planner is superior in some way, it could easily be included in the next release of the library.

This tutorial gives the example of modifying OMPL.

Download OMPL Source
Download the source code for OMPL and save it wherever you would like. The download page is here: http://ompl.kavrakilab.org/download.html. The OMPL.app source is not required, only the OMPL source.

Add the new planner to OMPL
Add the new planner to the OMPL source code alongside the existing ones (for instance if it's an rrt in geometric/planners/rrt). The following source has the requirements the new planner has to meet to integrate into OMPL: http://ompl.kavrakilab.org/newPlanner.html.

Compile and Install OMPL
Follow the installation instructions from this source: http://ompl.kavrakilab.org/installation.html

If you want to overwrite the OMPL version which came with MoveIt!, set the cmake_install_prefix to your ros directory (usually /opt/ros/hydro). In other words, run the following command when running cmake:

replacing the path with your ros directory.

If you don't want to overwrite the standard version, you can change the path to anywhere you like.

Download MoveIt! Source
Download the MoveIt! source as described here: http://moveit.ros.org/wiki/Installation but don't catkin_make yet as we have to modify some of the source.

Modify MoveIt! Source
In your MoveIt! directory, modify src/moveit_planners/ompl/ompl_interface/src/planning_context_manager.cpp. Include the header file that defines your planner at the top and register your planner in the registerDefaultPlanners function as the existing ones are

Install MoveIt! from Source
Finish the last 2 steps of the MoveIt! installation (catkin_make and source the install)

If you did not overwrite the existing OMPL in your ros directory, you will have to set environment variables to tell MoveIt! which version of OMPL to use

You can set: OMPL_PREFIX = [local install directory]

append OMPL_PREFIX to CMAKE_PREFIX_PATH

Modify ompl_planning.yaml
If you've already generated MoveIt! config files for your robot, modify /config/ompl_planning.yaml in YOURROBOT_moveit_config to include the option for the new planner.

You should be good to go!

Links

 * Back to Quick Start
 * Back to Main Page