Adding a new planner through OMPL in MoveIt.

2,147 views
Skip to first unread message

Abhishek Kashyap Jha

unread,
Jun 18, 2014, 8:46:56 AM6/18/14
to moveit...@googlegroups.com
I am trying to understand how to add a new planner to the OMPL and use it in Moveit. For that I have gone through this tutorial: http://moveit.ros.org/wiki/OMPL/Add_New_Planner

The problem I am facing is that the tutorial asks me to install MoveIt from source while I have installed Moveit as a debian package. Shall I reinstall moveit or is their a method to add a planner without installing Moveit from source?

Also it requires to download OMPL source while it already comes attached with Moveit packages. So do I still have to download OMPL source?

Any help is greatly welcome.

Acorn Pooley

unread,
Jun 18, 2014, 12:09:13 PM6/18/14
to Abhishek Kashyap Jha, moveit...@googlegroups.com
If everything works right, you should be able to install moveit from source and also leave the debians installed.  However, I usually remove the debians
    sudo apt-get remove ros-hydro-moveit-*
because sometimes there are build problems.  (It is easy to add the debians back if you want to later: sudo apt-get install ros-hydro-moveit-full )  You can then install moveit from source by following instructions at
    http://moveit.ros.org/install/
(follow the "Source Installation Instructions (for developers)" instructions).

I have not installed OMPL from source so I'm not sure how to do that, but I would start here:
  http://ompl.kavrakilab.org/installation.html#install_linux
.  My guess is that you *do* need to install moveit and OMPL from source in order to add an OMPL planner, but I do not know for sure.

-Acorn

From: moveit...@googlegroups.com [moveit...@googlegroups.com] on behalf of Abhishek Kashyap Jha [abhishekk...@gmail.com]
Sent: Wednesday, June 18, 2014 5:46 AM
To: moveit...@googlegroups.com
Subject: Adding a new planner through OMPL in MoveIt.

Dave Coleman

unread,
Jun 19, 2014, 3:48:42 AM6/19/14
to Acorn Pooley, Abhishek Kashyap Jha, moveit...@googlegroups.com
To get MoveIt! to work with your custom OMPL algorithm, you'll need to install both from source. Also, I believe you need to make sure you have them both in the same catkin workspace, or, source the ompl workspace before the MoveIt! one. You can build OMPL with catkin by using catkin_make_isolated and also pulling down the required package.xml for OMPL.

I actually just documented this last week but I don't believe the change is on the website yet:

Debians are silly, I don't use them at all for ROS ;-)

:: dave | +1.325.261.3283 c

Mark Moll

unread,
Jun 19, 2014, 9:05:21 AM6/19/14
to Acorn Pooley, Abhishek Kashyap Jha, moveit...@googlegroups.com, Dave Coleman
I like Debians and I willing to bet that most people do not enjoy compiling their software themselves from source. It would be nice if someone could simply use the installed versions of MoveIt! and OMPL as dependencies for their own planner, create a MoveIt! plugin for this planner, and edit some MoveIt! yaml file to let MoveIt! know about the new planner. Would this be hard to do?

On Jun 19, 2014, at 2:48 AM, Dave Coleman <davetc...@gmail.com> wrote:

> To get MoveIt! to work with your custom OMPL algorithm, you'll need to install both from source. Also, I believe you need to make sure you have them both in the same catkin workspace, or, source the ompl workspace before the MoveIt! one. You can build OMPL with catkin by using catkin_make_isolated and also pulling down the required package.xml for OMPL.
>
> I actually just documented this last week but I don't believe the change is on the website yet:
> https://bitbucket.org/ompl/ompl/commits/631cbb2
>
> Debians are silly, I don't use them at all for ROS ;-)
>
> :: dave | +1.325.261.3283 c
>
>
> On Thu, Jun 19, 2014 at 1:09 AM, Acorn Pooley <acorn....@sri.com> wrote:
> If everything works right, you should be able to install moveit from source and also leave the debians installed. However, I usually remove the debians
> sudo apt-get remove ros-hydro-moveit-*
> because sometimes there are build problems. (It is easy to add the debians back if you want to later: sudo apt-get install ros-hydro-moveit-full ) You can then install moveit from source by following instructions at
> http://moveit.ros.org/install/
> (follow the "Source Installation Instructions (for developers)" instructions).
>
> I have not installed OMPL from source so I'm not sure how to do that, but I would start here:
> http://ompl.kavrakilab.org/installation.html#install_linux
> . My guess is that you *do* need to install moveit and OMPL from source in order to add an OMPL planner, but I do not know for sure.
>
> -Acorn
> From: moveit...@googlegroups.com [moveit...@googlegroups.com] on behalf of Abhishek Kashyap Jha [abhishekk...@gmail.com]
> Sent: Wednesday, June 18, 2014 5:46 AM
> To: moveit...@googlegroups.com
> Subject: Adding a new planner through OMPL in MoveIt.
>
> I am trying to understand how to add a new planner to the OMPL and use it in Moveit. For that I have gone through this tutorial: http://moveit.ros.org/wiki/OMPL/Add_New_Planner
>
> The problem I am facing is that the tutorial asks me to install MoveIt from source while I have installed Moveit as a debian package. Shall I reinstall moveit or is their a method to add a planner without installing Moveit from source?
>
> Also it requires to download OMPL source while it already comes attached with Moveit packages. So do I still have to download OMPL source?
>
> Any help is greatly welcome.
>

--
Mark Moll



signature.asc

Acorn Pooley

unread,
Jun 19, 2014, 12:00:10 PM6/19/14
to Mark Moll, Abhishek Kashyap Jha, moveit...@googlegroups.com, Dave Coleman
Hello Mark,

You may know better than me whether a new OMPL planner could be added without needing sourcecode :). Moveit uses planners as plugins (ie. .so files that can be (I believe) built without needing MoveIt source). OMPL is the default plugin. You can add new plugins without having built moveit from source.

However, I do not know the OMPL side. How do you add a new planner to OMPL? Do you need the sourcecode? If you can build a new OMPL plugin without needing the OMPL sourcecode (e.g. as a .so file that gets loaded at runtime by the stock OMPL binaries) then you can probably also use the stock MoveIt debians.

Dave has more experience with this than me and he says you need the sourcecode. But if you know how to add an OMPL planner without needing OMPL sourcecode then we can probably figure out out how to do it without MoveIt sourcecode too. (Dave (or Sachin/Ioan), if I'm just wrong about this let me know).

-Acorn
________________________________________
From: Mark Moll [mark...@gmail.com] on behalf of Mark Moll [mm...@rice.edu]
Sent: Thursday, June 19, 2014 6:05 AM
To: Acorn Pooley
Cc: Abhishek Kashyap Jha; moveit...@googlegroups.com; Dave Coleman
Subject: Re: Adding a new planner through OMPL in MoveIt.

Abhishek Kashyap Jha

unread,
Jun 19, 2014, 12:16:27 PM6/19/14
to Acorn Pooley, Mark Moll, moveit...@googlegroups.com, Dave Coleman
Hello Acorn

You said that we can add plugins for planners and use it in Moveit!. Do you know about any tutorials where I can learn about creating a plugin for a planner without adding it to OMPL? The existing tutorial on adding new planner in Moveit! goes over only the OMPL way of adding. 

Regards,
Abhishek 

Ryan Luna

unread,
Jun 19, 2014, 12:53:00 PM6/19/14
to Abhishek Kashyap Jha, Acorn Pooley, Mark Moll, moveit...@googlegroups.com, Dave Coleman
It is straightforward to compile a shared library containing a new OMPL planner that links against libompl.so.  You do not need to build OMPL from source to do this.  Loading the new planner into the existing MoveIt-OMPL infrastructure, however, is a different animal.  The existing OMPL plugin for MoveIt is not extensible, i.e., the plugin does not support plugins, which essentially requires that you add your planner to OMPL directly and then rebuild OMPL.

I have not done this, but it should be possible to use the debian install of both MoveIt and OMPL.  You can compile the new OMPL planner into its own shared library.  Next you create a new PlannerManager plugin that loads the new OMPL planner.  Then you update your launch files to use the new planning plugin. 

When creating the new PlannerManager plugin, you can start with the existing MoveIt-OMPL plugin code and just make the handful of changes (http://moveit.ros.org/wiki/OMPL/Add_New_Planner) to incorporate the additional planner. 

For the record, I don't find this solution terribly attractive.  Making a new PlannerManager plugin seems like total overkill just to add one planner.  Ideally the OMPL plugin would also support plugins for additional OMPL planners.

Ryan
--
Ryan Luna
Luna...@gmail.com

Mark Moll

unread,
Jun 19, 2014, 5:47:03 PM6/19/14
to Ryan Luna, Abhishek Kashyap Jha, Acorn Pooley, moveit...@googlegroups.com, Dave Coleman

On Jun 19, 2014, at 11:52 AM, Ryan Luna <Luna...@gmail.com> wrote:

> It is straightforward to compile a shared library containing a new OMPL planner that links against libompl.so. You do not need to build OMPL from source to do this. Loading the new planner into the existing MoveIt-OMPL infrastructure, however, is a different animal. The existing OMPL plugin for MoveIt is not extensible, i.e., the plugin does not support plugins, which essentially requires that you add your planner to OMPL directly and then rebuild OMPL.
>
> I have not done this, but it should be possible to use the debian install of both MoveIt and OMPL. You can compile the new OMPL planner into its own shared library. Next you create a new PlannerManager plugin that loads the new OMPL planner. Then you update your launch files to use the new planning plugin.
>
> When creating the new PlannerManager plugin, you can start with the existing MoveIt-OMPL plugin code and just make the handful of changes (http://moveit.ros.org/wiki/OMPL/Add_New_Planner) to incorporate the additional planner.
>
> For the record, I don't find this solution terribly attractive. Making a new PlannerManager plugin seems like total overkill just to add one planner. Ideally the OMPL plugin would also support plugins for additional OMPL planners.

I agree. What if the yaml moveit-ompl config format was extended to allow a user to specify which library should be loaded for a particular planner (this can default to libompl.so, to be backward compatible with existing config files)?
--
Mark Moll



signature.asc

Dave Coleman

unread,
Jun 20, 2014, 12:04:55 AM6/20/14
to Mark Moll, Ryan Luna, Abhishek Kashyap Jha, Acorn Pooley, moveit...@googlegroups.com
I didn't mean to start a long thread about installing from source or not, I was mostly joking about debians. Its just from my experience its usually best to build from source components you are working with so that you can easily debug/modify them if necessary. All too often I need to fix a bug/add an extra hook/better understand the code so I need to install it from source.

MoveIt! has a plugin interface for planners of course. There are 3 currently, but I believe only the OMPL plugin is in a good working state right now. Within the OMPL plugin you can load many different planners, including your own custom ones. To add a custom algorithm to the OMPL plugin, you will need to add your header file to this file:

You would then modify your moveit_config package to also include the planner, such as with the PR2: https://github.com/ros-planning/moveit_pr2/blob/hydro-devel/pr2_moveit_config/config/ompl_planning.yaml

IMHO it is much easier if you just integrate your new planner into the main OMPL source code, so that eventually it can be contributed back and shared with everyone else. As others pointed out, you could probably build it separate and link against OMPL, but that sounds much more difficult to me in terms of configuring the build system to work correctly.

Also note that, as pointed out, the current MoveIt-OMPL interface has some assumptions that would be nice to fix in the future, such as geometric planning only (no dynamics). 

Zhang Jun

unread,
Jun 20, 2014, 4:42:04 AM6/20/14
to moveit...@googlegroups.com, acorn....@sri.com, abhishekk...@gmail.com
Hi Dave Coleman,

If putting the OMPL and MoveIt in the same catkin workspace, and building OMPL with catkin_make_isolated while buliding MoveIt with catkin_make, will there be a conflict?

Jun

Dave Coleman

unread,
Jun 22, 2014, 10:08:12 PM6/22/14
to Zhang Jun, moveit-users, Acorn Pooley, Abhishek Kashyap Jha
catkin_make_isolated would replace using the catkin_make command. I'm not an expert on it, but afaik it just alters the way dependencies are built such that there is less concurrency (none?) and so that non-catkin packages (OMPL) can be included in a catkin workspace.

:: dave | +1.325.261.3283 c
Reply all
Reply to author
Forward
0 new messages