how to solve undefined symbol error?
Hello,
I am implementing laser scanner using gazebo_ros_laser
plugin
when I loaded the model in gazebo, I get the following error:
Failed to load plugin “path to my plugin” undefined symbol: _ZN6gazebo9RayPlugin15OnNewLaserScansEv
any idea how to solve this problem? I set up gazebo path plugin environment in the right way, but still cannot figure out what it might be wrong.
Thanks in advance!
Asked by Zahra on 2013-06-12 12:13:35 UTC
Answers
try changing cmakelists.txt to get it to target the library with your plugin. see http://answers.gazebosim.org/question/3176/resolving-symbol-lookup-errors-in-gazebo-15-and-18/.
Though in short it is a linking issue, changing CMakeLists.text targeting the right libraries would be a good place to start.
Asked by PMilani on 2013-06-13 04:07:08 UTC
Comments
thanks PMilani, I have seen you post earlier and edited CMakeLists.txt , and it helped solving that linking issue, but I have now other issues with Launching the world file that has my plugin in, as I just explained in the answer.
Asked by Zahra on 2013-06-13 04:15:56 UTC
thanks PMilani, I have seen you post earlier and edited CMakeLists.txt , and it helped solving that linking issue, but I have now other issues with Launching the world file that has my plugin in, as I just explained in the answer.
Asked by Zahra on 2013-06-13 04:15:59 UTC
I have installed Gazebo and compiling it from source . Followed http://gazebosim.org/wiki/1.5/install then, I edited the CmakeLists.txt file of my project by linking the libraries to RayPlugin as following:
target_link_libraries(gazebo_ros_laser ${roscpp_LIBRARIES} ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${PROTOBUF_LIBRARIES} RayPlugin)
the undefined symbol error is solved. but another error msgs occurred when I launch my world file that has my plugin as following gazebo model.world.
the error :
Not loading plugin since ROS hasn't been properly initialized. Try starting gazebo with ros plugin:
gazebo -s libgazebo_ros_api_plugin.so
that msg error is part of gazebo_ros_laser.cpp. and when I start gazebo with : gazebo -s libgazebo_ros_laser.so , I get the following error msgs:
Msg Waiting for master.Error [gazebo.cc:48] System is attempting to load a plugin, but detected an incorrect plugin type. Plugin filename[libgazebo_ros_laser.so].
so, Can you please tell me what am I missing here?
Thanks in advance!
Asked by Zahra on 2013-06-13 04:12:50 UTC
Comments
That could mean the plugin is compiled against a different of gazebo then the one you are running. You can recompile the plugin from source to avoid this issue. Can you show how we can reproduce this issue? thanks.
Asked by hsu on 2013-06-12 14:24:26 UTC
sorry for the trivial question. What do you by compile the plugin from the source? For example , I have created a camera sensor using the CameraPlugin plugin and I followed the camera plugin tutorials on here http://gazebosim.org/wiki/Tutorials/1.0/plugins/camera_plugin and compiled the plugin as it is in this tutorial and everything worked well.I have been working with Gazebo standalone version for sometime and I have followed the Pre-compiled binaries method when installing it. thanks
Asked by Zahra on 2013-06-13 00:25:31 UTC