Hi,
I am trying to implement a basic camera using ROS (**Kinetic**) and Gazebo (v **7.5**).
I need the ROS plugin to publish my frames on a rostopic. I am using the **SDF** standard and not **URDF**.
I had trouble finding such a plugin.
First I tried to compile it myself from the sources found [there](http://docs.ros.org/jade/api/gazebo_plugins/html/gazebo__ros__camera_8cpp_source.html)
using this CMakeLists.txt :
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(ros_gazebo_camera)
include_directories(${roscpp_INCLUDE_DIRS})
include_directories(${std_msgs_INCLUDE_DIRS})
link_directories(${roscpp_LIBRARY_DIRS})
link_directories(${std_msgs_LIBRARY_DIRS})
# Find Gazebo
find_package(gazebo REQUIRED)
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
# Build our plugins
add_library(gazebo_ros_camera_utils gazebo_ros_camera_utils.cpp)
add_dependencies(gazebo_ros_camera_utils ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_camera gazebo_ros_camera.cpp)
add_dependencies(gazebo_ros_camera ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} CameraPlugin ${catkin_LIBRARIES})
It created the shared library, but when using it in this SDF model
model://sun model://ground_plane model://camera
using the command
gazebo --verbose ../camera.world
But after launching successfuly Gazebo I received the error
[Err] [Plugin.hh:165] Failed to load plugin libCameraPlugin.so: /home/adrien/camera_plugin/build/libCameraPlugin.so: undefined symbol: _ZTIN6gazebo12CameraPluginE
From different forums I found it meant that my linkage was not done properly in the CMakeLists.txt.
I haven't been able to solve this.
I finally compile *gazebo_ros_pkgs*. The compilation provides many plugins including the one interesting me : *libgazebo_ros_camera.so*
But when using this library as the plugin of my camera in my SDF world file I receive the following error after launching Gazebo :
[Err] [Model.cc:1058] Model[my_camera] is attempting to load a plugin, but detected an incorrect plugin type. Plugin filename[libgazebo_ros_camera.so] name[CameraPlugin]
So far I have no idea of what that error means.
I would appreciate any help !
Thanks in advance,
Adrien.
↧