Gazebo | Ignition | Community
Ask Your Question
0

Cannot call function "rendering::Scene::VisualAt", undefined symbol?

asked 2018-10-23 09:40:32 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Whenever I call the function "rendering::Scene::VisualAt" or "Camera::ZValue", it complains:

gzserver: symbol lookup error:
catkin_ws/devel/lib/librand_camera.so:
undefined symbol: _ZN6gazebo9rendering6Camera6ZValueEii

in which "rand_camera" is the my project name. Anyone knows how to solve this? I really appreciate it!!

------------------- Details---------------------

Gazebo version: 7.1

CMakeLists:

cmake_minimum_required(VERSION 2.8.3)
project(rand_camera)

find_package(catkin REQUIRED COMPONENTS
  gazebo
  gazebo_dev
  roslib
  roscpp
  geometry_msgs
  std_srvs
  std_msgs
  gazebo_msgs
  gazebo_ext_msgs
  gazebo_plugins

)

find_package(OpenCV REQUIRED)

find_package(Boost REQUIRED COMPONENTS thread)

catkin_package(
  LIBRARIES
    rand_camera

  CATKIN_DEPENDS
    roslib
    roscpp
    gazebo_ros
    geometry_msgs
    std_srvs
    std_msgs
    gazebo_msgs
    gazebo_ext_msgs
    gazebo_plugins
)

include_directories(
  include
  ${Boost_INCLUDE_DIRS}
  ${catkin_INCLUDE_DIRS}
  src/skyx/include
  ${OGRE_INCLUDE_DIRS}/Paging
  )

link_directories(${catkin_LIBRARY_DIRS})

# link_directories(${GAZEBO_LIBRARY_DIRS})


set(cxx_flags)
foreach (item ${GAZEBO_CFLAGS})
  set(cxx_flags "${cxx_flags} ${item}")
endforeach ()

set(ld_flags)
foreach (item ${GAZEBO_LDFLAGS})
  set(ld_flags "${ld_flags} ${item}")
endforeach ()

## Plugins
add_library(rand_camera src/RandCamera.cpp)
add_dependencies(rand_camera ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(rand_camera ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${TinyXML_LIBRARIES} ${OpenCV_LIBS} ${GAZEBO_LIBRARIES})

# Install Gazebo System Plugins
install(TARGETS rand_camera
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  )
edit retag flag offensive close merge delete

Comments

Could you add the Gazebo version to your question? Also the CMakeLists file for your plugin should help.

chapulina gravatar imagechapulina ( 2018-10-23 16:19:38 -0500 )edit

@chapulina, sure, updated

Whyamihere gravatar imageWhyamihere ( 2018-10-23 19:01:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-02 08:47:21 -0500

wentz gravatar image

By the look on your question i assume that you try to call the function like this:

VisualPtr vis = rendering::Scene::VisualAt(_camera, _Pos, _mod);

if thats the case the fix is easy. You need to call the functions on an scene pointer (not directly).

It would look like this.

rendering::ScenePtr scene_ = rendering::get_scene();
VisualPtr vis = scene_->VisualAt(_camera, _Pos, _mod);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-10-23 09:40:32 -0500

Seen: 241 times

Last updated: Nov 02 '18