zoukankan      html  css  js  c++  java
  • 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
    )
    
    不忘初心,不轻言放弃,认真选择,然后勇往直前!
  • 相关阅读:
    Linux上查找最大文件的 3 种方法
    不念过去,不畏将来
    Weblogic/WAS之Full GC监控与计算
    EntityFramework:An error occurred while executing the command definition. See the inner exception for details.
    1051 复数乘法(C#)
    BACnet开发资料与调试工具
    JS设置cookie、读取cookie、删除cookie
    认识BACnet协议
    Unity WebGL请求Http接口出现的Cors跨域问题
    VS 2017 产品密钥
  • 原文地址:https://www.cnblogs.com/BoltLi/p/12853383.html
Copyright © 2011-2022 走看看