1
$\begingroup$

I have troubles in implementing orocos-kdl in my custom controllers. When I launch my gazebo simulation with controllers, this error happens:

gzserver: symbol lookup error: /home/roman/catkin_ws/devel/lib//libkuka_controllers.so: undefined symbol: _ZN3KDL5ChainC1Ev [gazebo-2] process has died [pid 16312, exit code 127, cmd /opt/ros/noetic/lib/gazebo_ros/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/roman/.ros/log/06c4bc58-a930-11ef-8f9b-7181b0fc999e/gazebo-2.log]. log file: /home/roman/.ros/log/06c4bc58-a930-11ef-8f9b-7181b0fc999e/gazebo-2*.log 

My CMakeList is below:

 cmake_minimum_required(VERSION 3.0.2) project(kuka_controllers) find_package(catkin REQUIRED COMPONENTS controller_interface control_msgs geometry_msgs forward_command_controller control_toolbox realtime_tools urdf roscpp kdl_parser message_generation cmake_modules kdl_conversions sensor_msgs std_msgs tf_conversions pluginlib orocos_kdl ) add_definitions (-fpermissive -std=c++11) find_package(orocos_kdl REQUIRED) include_directories(${orocos_kdl_INCLUDE_DIRS}) include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS}) find_package(Eigen3 REQUIRED) include_directories(${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS}) find_package(catkin REQUIRED message_generation std_msgs) add_message_files( FILES KukaState.msg ) generate_messages( DEPENDENCIES std_msgs geometry_msgs sensor_msgs # Or other packages containing msgs ) catkin_package( CATKIN_DEPENDS controller_interface control_msgs geometry_msgs control_toolbox realtime_tools urdf forward_command_controller kdl_parser message_runtime INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} ) add_library(${PROJECT_NAME} src/kuka_inverse_dynamic_controller.cpp src/kuka_kuka_state_controller.cpp ) add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) install(DIRECTORY include/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/include) install(DIRECTORY launch/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch) install(DIRECTORY config/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config) install(DIRECTORY msg/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/msg) 

I simply registered the controllers with plugin.xml. I've already included orocos-kdl in my CmakeList.txt but nothing has changed.

$\endgroup$

1 Answer 1

1
$\begingroup$

orocos-kdl is not a ros1 package in noetic, so it should not be in your catkin_package() statement in CMakeLists.txt. That also means you need to explicitly link it's libraries to your project.

As a separate issue, this line makes no sense to me:

add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}) 
$\endgroup$
1
  • $\begingroup$ Could you give me a hint how to do it or what titles to read. Thank you $\endgroup$ Commented Nov 23, 2024 at 15:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.