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

How to create a new motion planner in moveit?

asked 2018-09-07 22:53:52 -0600

Rob.Chen gravatar image

updated 2018-09-08 00:53:42 -0600

Hello everyone! I am in ROS Kinetic on Ubuntu 16.04, and i would like to make a custom planner in moveit, and i have followed the first six steps from here, and now, i am stuck by this error at 7th step, the error is :


Errors << moveit_planners_ompl:make /home/logan/ws_moveit/logs/moveit_planners_ompl/build.make.012.log
/home/logan/ws_moveit/devel/.private/moveit_planners_ompl/lib/libmoveit_ompl_interface.so.0.9.12: undefined reference to `ompl::geometric::myPlanner::myPlanner(std::shared_ptr<ompl::base::SpaceInformation> const&, bool)'
/home/logan/ws_moveit/devel/.private/moveit_planners_ompl/lib/libmoveit_ompl_interface.so.0.9.12: undefined reference to `ompl::geometric::myPlanner::~myPlanner()'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/logan/ws_moveit/devel/.private/moveit_planners_ompl/lib/moveit_planners_ompl/moveit_ompl_planner] Error 1
make[1]: *** [ompl_interface/CMakeFiles/moveit_ompl_planner.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/logan/ws_moveit/devel/.private/moveit_planners_ompl/lib/libmoveit_ompl_interface.so.0.9.12: undefined reference to `ompl::geometric::myPlanner::myPlanner(std::shared_ptr<ompl::base::SpaceInformation> const&, bool)'
/home/logan/ws_moveit/devel/.private/moveit_planners_ompl/lib/libmoveit_ompl_interface.so.0.9.12: undefined reference to `ompl::geometric::myPlanner::~myPlanner()'
    collect2: error: ld returned 1 exit status
make[2]: ***         [/home/logan/ws_moveit/devel/.private/moveit_planners_ompl/lib/moveit_planners_ompl/moveit_demo_construct_constraints_database] Error 1
make[1]: *** [ompl_interface/CMakeFiles/moveit_demo_construct_constraints_database.dir/all] Error 2
make: *** [all] Error 2
cd /home/logan/ws_moveit/build/moveit_planners_ompl; catkin build --get-env moveit_planners_ompl | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -

the new planner "myPlanner" was just copied from "ompl/src/ompl/geometric/planners/prm", and i changed all the file's name by "myPlanner" , i just want to know how to add a planner by myself. And i know the problem is appeared after i add the header file that defines the new planner and register my planner in the registerDefaultPlanners() function in "src/moveit_planners/ompl/ompl_interface/src/planning_context_manager.cpp" file. the ompl can cmake and make install success, but the ws_moveit workspace can't build success, and if i remove the content what i add in "planning_context_manager.cpp" file, the ws_moveit workspace can be build success.

If anyone knows some solutions about this problem, please help me, thank you very much!

edit retag flag offensive close merge delete

Comments

Just a note: the steps you link to are for adding a new OMPL based planner. It's perfectly possible to add a new planner without building OMPL from sources.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-09 04:16:34 -0600 )edit

Oh! That's what I hope to do, if you know how to do it, please tell me, i am very grateful!

Rob.Chen gravatar image Rob.Chen  ( 2018-09-09 20:06:09 -0600 )edit

You'd need to write an implementation of the planning_interface::PlannerManager interface and generate a plugin from that.

It's not perfect, but see moveit_mpp for a tiny example. Ignore all the loading of other plugins, that is not needed.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-10 01:40:15 -0600 )edit

Thank you very much! i will try it.

Rob.Chen gravatar image Rob.Chen  ( 2018-09-12 20:16:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-08 05:57:02 -0600

Rob.Chen gravatar image

Hello everyone, i figured it out this afternoon, i just copied the three "libompl" file from /opt/ros/kinetic/lib/x86_64_linux_gnu to /opt/ros/kinetic/lib/, and it works fine, but i am still a little confused about it, because we have at step 6, we change the install directory, so the three "libompl" file can be installed in /opt/ros/kinetic/lib/x86_64_linux_gnu, but it is still not enough, or maybe we should try change the CMAKE_INSTALL_LIBDIR to /opt/ros/kinetic/lib/ directly.

edit flag offensive delete link more

Comments

i just verified my idea, i changed the CMAKE_INSTALL_LIBDIR to /opt/ros/kinetic/lib/, and these three "libompl*" file just appeared in /opt/ros/kinetic/lib/ file, and then:

cd ~/ws_moveit
sudo catkin build

and every thing is going fine!

Rob.Chen gravatar image Rob.Chen  ( 2018-09-08 06:54:28 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-09-07 22:53:52 -0600

Seen: 1,137 times

Last updated: Sep 08 '18