Gazebo | Ignition | Community
Ask Your Question

How to resolve undefined symbol referenced from my plugin for ray sensor?

asked 2018-03-26 14:34:41 -0500

bybee.taylor gravatar image

I've created a Gazebo Plugin that inherits from the RayPlugin type.

class CustomPlugin : public RayPlugin

It compiles just fine (using Gazebo 9), but when I launch Gazebo I get the following error.

[Err] [Plugin.hh:180] Failed to load plugin {path_to_plugin}/ {path_to_plugin}/ undefined symbol:

I am referencing it in my model file like this:

   <plugin name="custom_plugin" filename="">

In my CMakeLists.txt, I am linking like this:

add_library(custom_plugin SHARED plugins/custom_plugin.cpp)
target_link_libraries(custom_plugin ${GAZEBO_LIBRARIES} ${IGNITION-MSGS_LIBRARIES})

I've done two things to ensure that the GAZEBO_PLUGIN_PATH is set correctly. First, I've used the tag in package.xml.

    <!-- Other tools can request additional information be placed here -->
    <gazebo_ros plugin_path="${prefix}/lib" gazebo_media_path="${prefix}" gazebo_model_path="${prefix}/models"/>

Secondly, I've manually set the variable to reference both the native Gazebo plugins and the lib folder.

export GAZEBO_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/gazebo-9/plugins:{path_to_ros_package}/devel/lib

I've verified that /usr/lib/x86_64-linux-gnu/gazebo-9/plugins contains Neither of these two works.

I am at a loss. Any thoughts?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-26 15:10:15 -0500

bybee.taylor gravatar image

Just for reference, I got it working by including the following in the CMakeLists.txt.



add_library(custom_plugin SHARED plugins/custom_plugin.cpp)
target_link_libraries(custom_plugin RayPlugin ${GAZEBO_LIBRARIES} ${IGNITION-MSGS_LIBRARIES})
edit flag offensive delete link more


That worked for me also

adel gravatar imageadel ( 2020-08-19 04:18:42 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-03-26 14:34:41 -0500

Seen: 614 times

Last updated: Mar 26 '18