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

costmap_plugins.xml misbehaving

asked 2014-05-28 22:33:52 -0600

Luke_ROS gravatar image

updated 2014-05-29 21:34:37 -0600

I created a new layer (the overwrite_layer) and declared it in the costmap_plugins.xml. The code compiles without errors but when I run it, I get the following error message:

[ INFO] [1401350861.147988001, 1397467592.599155280]: Using plugin "overwrite_layer"
terminate called after throwing an instance of 'pluginlib::LibraryLoadException'
  what():  According to the loaded plugin descriptions the class scitos_2d_navigation::OverwriteLayer with base class type costmap_2d::Layer does not exist. Declared types are blablabla ...

The puzzeling part to me is, that the plugin loader still looks for a costmap_2d::Layer object even though it is clearly defined as a costmap_2d::CostmapLayer (see costmap_plugins.xml-file below). Acutally I had it first as a costmap_2d::Layer, compiled it, then changed it to costmap_2d::CostmapLayer and then compiled it again. Can I maybe force the compiler somehow to reread the costmap_plugins.xml? Or am I overlooking something obvious? Thanks!

<class_libraries>
    <library path="lib/libdynamic_layer">
        <class type="scitos_2d_navigation::DynamicLayer" base_class_type="costmap_2d::Layer">
            <description>Publishing a static_map and a dynamic_map based on old and current measurments</description>
        </class>
    </library>
    <library path="lib/liboverwrite_layer">
        <class type="scitos_2d_navigation::OverwriteLayer" base_class_type="costmap_2d::CostmapLayer">
            <description>Overwriting the layered costmap with a user defined map.</description>
        </class>
    </library>
</class_libraries>

I'm on Hydro, Ubuntu 12.04

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-05-29 21:45:53 -0600

fergs gravatar image

updated 2014-05-29 21:47:23 -0600

The base class HAS to be costmap_2d::Layer -- the plugin loader is templated on that base class and can only find/load such a class. Even if your class derives from costmap_2d::CostmapLayer, that class derives from costmap_2d::Layer and so your class eventually has a base class of costmap_2d::Layer, and that is what has to be in the plugins.xml file in order for pluginlib to find the class.

edit flag offensive delete link more

Comments

Thanks. That helps a lot. For the ultimate learning experience: Where can I look that up?

Luke_ROS gravatar image Luke_ROS  ( 2014-05-30 04:20:23 -0600 )edit

The docs you want to look at are those for pluginlib: http://wiki.ros.org/pluginlib which is used throughout ROS.

fergs gravatar image fergs  ( 2014-05-30 14:15:16 -0600 )edit
0

answered 2016-10-26 04:18:18 -0600

chengwei gravatar image

updated 2016-10-26 22:51:54 -0600

HI,Luke_ROS,

I have the same problem when I [Creating a New Layer],(http://wiki.ros.org/costmap_2d/Tutorials/Creating%20a%20New%20Layer) I got the ERROR: terminate called after throwing an instance of 'pluginlib::LibraryLoadException' what(): According to the loaded plugin descriptions the classsimple_layer_namespace::SimpleLayer with base class type costmap_2d::Layer does not exist. Declared types are blablabla ....

Can you help me, Any opinion is look acceptable.

Thank you in advance

update:

I have already solved the problem, the cause of error is my format error in costmap_plugins.xml

edit flag offensive delete link more

Comments

Hi chengwei, I have the same problem can you point out what do you mean for my format error in costmap_plugins.xml, I have used the one described here: here

matteopantano gravatar image matteopantano  ( 2017-04-25 02:23:04 -0600 )edit

Hi, matteopantano, I haven't do this for a long time, so I remember not clear, but as fergs's answer above, the ERROR classsimple_layer_namespace::SimpleLayer with base class type costmap_2d::Layer does not exist. May be adjusted parameters, or just format, You try again. Good luck!

chengwei gravatar image chengwei  ( 2017-04-25 02:55:58 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-28 22:33:52 -0600

Seen: 2,539 times

Last updated: Oct 26 '16