0
$\begingroup$

Rosanswers logo

I wrote a custom costmap plugin.

It can work on local costmap.The configuration is as follows:

plugins:
- {name: grid_layer, type: "simple_layer_namespace::GridLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}

But if I configure it to the global costmap,it will report an error.

[ INFO] [1688106907.862182415, 1687920714.481622674]: global_costmap: Using plugin "grid_layer" terminate called after throwing an instance of 'pluginlib::LibraryLoadException' what(): Failed to load library /home/msy/ros_ws/devel/lib//libgrid_layer.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/msy/ros_ws/devel/lib//libgrid_layer.so: undefined symbol: _ZN2tf11Transformer18DEFAULT_CACHE_TIMEE)

The configuration is as follows:

plugins:
# - {name: static_layer, type: "costmap_2d::StaticLayer"}
# - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: grid_layer, type: "simple_layer_namespace::GridLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}

What went wrong?


Originally posted by peter_feng on ROS Answers with karma: 3 on 2023-06-30

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

"Transformer" is part of the tf ros package, so in your CMakeLists.txt you need to specify that your plugin has a dependency on this package. There are other tf-related ros packages you may also need (tf2, tf2_ros, tf_conversions), but I'm pretty sure that particular error is from tf.


Originally posted by Mike Scheutzow with karma: 4903 on 2023-07-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by peter_feng on 2023-07-03:
I added all of them(tf, tf2_ros, tf_conversions) to the configuration file.

It worked! Thank you.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.