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

Writing A Global Path Planner As Plugin in ROS with rosmake?

asked 2014-07-29 09:51:11 -0500

GuillaumeB gravatar image

updated 2014-07-30 05:18:12 -0500

hi everyone, I try to do this tutorial :http://wiki.ros.org/navigation/Tutorials/Writing%20A%20Global%20Path%20Planner%20As%20Plugin%20in%20ROS

But as i work on groovy i can't use catkin_make with the costmap_2d. So i have tried this tutorial with rosmake.

My probleme is: I can't load my plugin.

CMakeLists.txt

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rosbuild_init()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_add_library(${PROJECT_NAME} src/global_planner.cpp)

manifest.xml

<package>
  <description brief="set_path_plug">

     set_path_plug

  </description>
  <author>Guillaume</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <depend package="message_generation"/>
  <depend package="roscpp"/>
  <depend package="rospy"/>
  <depend package="std_msgs"/>
  <depend package="tf"/>
  <depend package="costmap_2d"/>
  <depend package="nav_core"/>
  <depend package="geometry_msgs"/>
  <depend package="angles"/>
  <depend package="base_local_planner"/>
  <export>
    <nav_core plugin="${prefix}/global_planner_plugin.xml" />
  </export>

</package>

global_planner_plugin.xml (I have tried library path= with the full path)

 <library path="lib">
  <class name="global_planner/GlobalPlanner" type="global_planner::GlobalPlanner" base_class_type="nav_core::BaseGlobalPlanner">
    <description>This is a global planner plugin.</description>
  </class>
 </library>

And my .cpp and .h are the same than in the tutorial.

when i launch a move_base with this globalplanner i have this error:

[FATAL] [1406644445.324290214, 939.388000000]: Failed to create the global_planner/GlobalPlanner planner, are you sure it is properly registered and that the containing library is built? Exception: According to the loaded plugin descriptions the class global_planner/GlobalPlanner with base class type nav_core::BaseGlobalPlanner does not exist. Declared types are  carrot_planner/CarrotPlanner navfn/NavfnROS pr2_navigation_controllers/GoalPasser

I think the problem come from my manifest.xml, the export is not correct. Is it possible the make a plugin with rosmake? (when I rosmake everything going well) If someone have an idea?

thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-07-31 07:16:37 -0500

GuillaumeB gravatar image

manifest.xml

<package>
  <description brief="set_path_plug">
     set_path_plug
  </description>
  <author>Guillaume</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/set_path_plug</url>
  <depend package="message_generation"/>
  <depend package="roscpp"/>
  <depend package="rospy"/>
  <depend package="std_msgs"/>
  <depend package="tf"/>
  <depend package="costmap_2d"/>
  <depend package="nav_core"/>
  <depend package="geometry_msgs"/>
  <depend package="angles"/>
  <depend package="base_local_planner"/>
  <depend package="pluginlib"/>

  <export>
    <nav_core plugin="${prefix}/global_planner_plugin.xml" />
  </export>

</package>

global_planner_plugin.xml

 <library path="lib/libset_path_plug">
 <!-- <class name="global_planner/GlobalPlanner" type="global_planner::GlobalPlanner" base_class_type="nav_core::BaseGlobalPlanner">-->
<class name="global_planner/GlobalPlanner" type="global_planner::GlobalPlanner" base_class_type="nav_core::BaseGlobalPlanner">
    <description>This is a global planner plugin.</description>
  </class>
 </library>

and PLUGINLIB_DECLARE_CLASS(set_path_plug, global_planner_plugin, global_planner::GlobalPlanner, nav_core::BaseGlobalPlanner) at the begining of the .cpp file.

I was not able to see the output because i forgot the argument output="screen" for my move_base_node in my launchfile

edit flag offensive delete link more
0

answered 2014-07-30 12:30:39 -0500

ahendrix gravatar image

It looks like the library is found and loaded, but the plugin loader can't find your class within the library.

Are you using the appropriate pluginlib macro in your cpp file to export your plugin class?

edit flag offensive delete link more

Comments

I am using PLUGINLIB_DECLARE_CLASS(set_path_plug, global_planner_plugin, global_planner::GlobalPlanner, nav_core::BaseGlobalPlanner) but i have try PLUGINLIB_EXPORT_CLASS too

GuillaumeB gravatar image GuillaumeB  ( 2014-07-31 01:26:24 -0500 )edit

I think the problem comme from the global_planner_plugin.xml because acording to the tutorial the librarry is supposed to be created in the directory devel/lib/lib_global_planner_plugin but my .so file is created in src/my_package/lib

GuillaumeB gravatar image GuillaumeB  ( 2014-07-31 01:45:14 -0500 )edit

i have set <library path="lib/libset_path_plug"> in the global_planner_plugin.xml now when I launch move_base with my plugin there is no errors anymore. But i have set ROS_INFO("aa"); in each function and nothing appear like if constructors are never called.

GuillaumeB gravatar image GuillaumeB  ( 2014-07-31 03:19:50 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-29 09:51:11 -0500

Seen: 929 times

Last updated: Jul 31 '14