Gazebo | Ignition | Community
Ask Your Question
0

Failed to load plugin undefined symbol

asked 2015-11-26 14:50:28 -0500

gazbegin gravatar image

Hi, I'm new at gazebo/ROS and wanted to write my own plugin after i tried the tutorial. but i get the following error:

 Error [Plugin.hh:156] Failed to load plugin /home/student/gazebo_plugin_tutorial/build/libTestPlugin.so: /home/student/gazebo_plugin_tutorial/build/libTestPlugin.so: undefined symbol: _ZN6gazebo10TestPlugin4InitEv

This is my CMakelist.

  cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

find_package(Boost REQUIRED COMPONENTS system)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
  pkg_check_modules(GAZEBO gazebo)
endif()
include_directories(${GAZEBO_INCLUDE_DIRS})

link_directories(${GAZEBO_LIBRARY_DIRS})


add_library(TestPlugin SHARED TestPlugin.cc)


target_link_libraries(  TestPlugin ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES} )

Thanks in advance for every answer

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2022-01-28 10:15:11 -0500

lauracorssac gravatar image

in my case I was doing an extension of a plugin (the FlashLightPlugin) and I did not link mine with that.

adding the following on my CMakeLists.txt and recompiling resolved the issue.

target_link_libraries(flash_light_extension_plugin ${GAZEBO_LIBRARIES} FlashLightPlugin)

edit flag offensive delete link more
0

answered 2015-11-26 16:47:28 -0500

gazbegin gravatar image

updated 2015-11-26 17:02:43 -0500

Thanks for the fast answer.

Yeah I already did those tutorials from there and they are working fine. So the difference in the plugins is that I want to use the plugin with a publisher and subscriber.

edit flag offensive delete link more

Comments

ros or gazebo publisher/subscriber?

AndreiHaidu gravatar imageAndreiHaidu ( 2015-11-27 03:16:07 -0500 )edit

I want to publish velocity, angle in ros. Subscribe it in the gazebo plugin. And publish the actuell velocity, position etc from gazebo to ros

gazbegin gravatar imagegazbegin ( 2015-11-27 03:38:37 -0500 )edit

did you look over the gazebo-ros tutorials, there are many working examples and explanations there http://gazebosim.org/tutorials?cat=connect_ros

AndreiHaidu gravatar imageAndreiHaidu ( 2015-11-27 04:23:24 -0500 )edit
0

answered 2015-11-26 15:37:37 -0500

AndreiHaidu gravatar image

Hi there,

the error appears because the plugin was not correctly linked. You probably missing a link_directories variable.

I would just start with the given working plugins from the tutorials, and grow from there. Here is the link: http://gazebosim.org/tutorials?tut=pl...

Cheers, Andrei

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-11-26 14:50:28 -0500

Seen: 1,943 times

Last updated: Nov 26 '15