Embeding KDL within Gazebo plugin

Embeding KDL within Gazebo plugin

原网页:https://community.gazebosim.org/t/embeding-kdl-within-gazebo-plugin/248
Help

chris-mt
Nov '18
For controlling a 6-d.f. robotic arm I need to make the inverse kinematics maths within a plugin. I installed KDL and Eigen2 and 3 but at runtime (I used an example source code taken from KDL org) I get an error message like, symbol not found -random letters-chain-random letters-. Questions: what kinematics library, most compatible with Gazebo’s plugins, should I use? How to install/link the kinematics library with Gazebo’s plugins?

created
Nov '18
last reply
7d
2
replies
164
views
3
users

nate
Nov '18
Sounds like you have a linking error. You should be able to use KDL with Gazebo. Chances are you just need to include the correct libraries in your CMake or Makefile.

1 YEAR LATER

AlessandroMelone

Hi @chris-mt (sorry for the late, i will answer for who could met the same problem), if u mean a message in the bash like this:
gzserver: symbol lookup error: /home/alessandro/ros_ws/devel/lib/libplugin_control_iiwa.so: undefined symbol: _ZN3KDL4TreeC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

To be clear, I want to implement a gazebo plugin using ros, the file .cpp in ros use the KDL libraries.

How I fixed it
I fixed it with modifying the CMakeList that compile the plugin the command, in particular adding {catkin_LIBRARIES} to the istruction target_link_libraries. So I changed: target_link_libraries(plugin_ros_gazebo {GAZEBO_LIBRARIES} ${Boost_LIBRARIES})

to:

target_link_libraries(plugin_ros_gazebo ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES})

Where plugin_ros_gazebo is the name of the executable .cpp that defines the plugin.

I think that is caused by the dependencies of KDL to Eigen, and Eigen is in catkin_LIBRARIES (but is just a hypothesis).

To be more accurate I past all my CMakeList.txt:

cmake_minimum_required(VERSION 2.8.3)
project(gazebo_plugin_iiwa)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
    set(CMAKE_CXX_FLAGS "-std=c++0x")
else()
    message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

find_package(catkin REQUIRED COMPONENTS 
  roscpp 
  gazebo_ros 


  geometry_msgs
  kdl_parser
  sensor_msgs
)

原文链接: https://www.cnblogs.com/BoltLi/p/12853383.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    Embeding KDL within Gazebo plugin

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/347167

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年3月2日 上午4:22
下一篇 2023年3月2日 上午4:22

相关推荐