ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello again,

I figured it out, so I thought I would come back to share my solution. I hope it can help other people.

As of today (July 2018), the solution to implementing a new sampler (or a planner for that matter) in MoveIt works as follow:

  1. Build MoveIt from source. Just follow the instructions on MoveIt website. I tested with ROS Kinetic. (As long as you later use an OMPL version that is compatible with your ROS distro, everything should work fine)
  2. Delete the OMPL binaries that should have been installed by the procedure in the previous link. To do that I used sudo apt-get remove and sudo apt-get purge on the libompl-dev package.
  3. Download/Checkout OMPL source code. You can use their BitBucket repository, in the "Download" section, in the "Branches" tab, you can find archives containing source code compatible with your ROS distro. Put the source code in the same catkin workspace as your MoveIt source.
  4. Modify OMPL source code as you need. You can find tutorials about adding planners/samplers on their website.
  5. Modify MoveIt source code. If you added a planner, you need to do that. It shouldn't be needed if you just added a new sampling strategy. Modify planning_context_manager.h and planning_context_manager.cpp to add your planner just like the original ones. This comes from this webarchive.
  6. Change install target folder in the CMakeLists.txt that can be found in ../ompl/src/ompl/CMakeList.txt. On line 83, you should change ${CMAKE_INSTALL_LIBDIR} to the path where the OMPL binaries are usually installed (their names are libompl.so or libompl.so.version_number). For example, on my system, it was /opt/ros/kinetic/lib/x86_64_linux_gnu. This step can be avoided if you understand CMake and source building better than me. You can probably tell catkin to link to the right place (some build or include folder in the workspace) while building MoveIt, but I don't know how to do that.
  7. sudo catkin build. You need sudo because it will install the libs in /opt. I know this is unsafe, and I guess it shows that I don't really know what I'm doing. But it worked for me.
  8. Modify ompl_planning.yaml. This is quite trivial. Please follow the last step from the webarchive linked above.

That's it. I'm pretty sure most steps are useless to someone who understands build systems but that's what solved my problem.