0
$\begingroup$

Rosanswers logo

I am trying to create a camera plugin in gazebo 1.0.1. I am using Ubuntu 12.04 on VMWare (MacOS Lion).
I don't know if I did all the steps in the correct way, so let me summarize:

I installed fuerte using the official instructions. I then followed both the instructions on ROS and Gazebo webpage to create plugins. I had no problems in creating a simple helloworld plugin or a plugin to move a box.

I am referring to this tutorial about the creation of a camera.

I created a package using

roscreate-pkg camera_plugin gazebo roscpp std_msgs

then I copy-paste the suggested code in two different files put in src/ folder of my package. I edited CMakeLists.txt in order to compile the plugins:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

rosbuild_init()

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)<br> set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

rosbuild_add_library(CameraDump SHARED src/CameraDump.cpp)
target_link_libraries(CameraDumb ${GAZEBO_libraries})

rosbuild_add_library(CameraMove SHARED src/CameraMove.cpp)
target_link_libraries(CameraMove ${GAZEBO_libraries} CameraPlugin)`

I compiled the code using rosmake, then I edited the default empty.world (after creating a backup copy) in order to add my plugins. I copy-paste the world suggested by the tutorial, then I launched gazebo using

roslaunch gazebo_worlds empty_world.launch.

Gazebo starts but I get as error:

Error [Plugin.hh:100] Failed to load plugin /path/camera_plugin/lib/libCameraDump.so: /path/camera_plugin/lib/libCameraDump.so: undefined symbol: _ZTIN6gazebo12CameraPluginE

Any suggestion on what may be the cause of this error?


Originally posted by Saphrosit on ROS Answers with karma: 197 on 2012-06-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I had a similar issue and have actually been periodically checking this page for a solution. However, I believe I have solved the issue (at least on my local machine).

The issue was an undefined symbol, thus pointing the error in the direction of the linking stage. Then I realized it was because I was not linking the correct libraries. It appears in your CMakeLists.txt above you have also made the same copy/paste mistake.

The CameraPlugin library should be linked with CameraDump, not CameraMove. Thus if you update your target_link_libraries as below it may fix the issue.

target_link_libraries(CameraDump ${GAZEBO_libraries} CameraPlugin)
target_link_libraries(CameraMove ${GAZEBO_libraries})

Originally posted by schadlerm with karma: 86 on 2012-06-12

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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