Skip to content

ur3 library is linked by default when using ur_kin.h and ur_kin.cpp from the ur_kinematics package #490

Description

@BlueNoise

Hi,

I've been trying to use the inverse() method from the ur_kinematics package and had some issues figuring out why the IK wasn't working properly for the UR5. I followed recommendations made by people to get it to work. Unfortunately, it still wasn't working after adding those lines at the top of my cpp node:

#define UR5_PARAMS
#include "ur_kinematics/ur_kin.h"

This doesn't solve the issue because it stills links against the UR3 library, instead of the UR5 library. This happened because of this in the CMakeLists.txt

target_link_libraries(ur5_ik_node
  ${catkin_LIBRARIES}
)

By replacing the code above by this:

target_link_libraries(ur5_ik_node
  ${catkin_LIBRARIES}
  ur5_kin
)

It now forces to link against libur5_kin.so instead of the default libur3_kin.so by "overwriting" the previous link.

A call to ldd on my node shows that it worked correctly.

libur5_kin.so =>~/camera_calibration_ws/devel/lib/libur5_kin.so (0x00007fecc8526000)

I am wondering how to avoid this kind of problem in the future, since I believe using the catkin_LIBRARIES variable is the standard way to proceed when linking against ROS libraries, and not specifying each one of them manually.

On a side note, I am aware that this issue is somehow related to #220 and #247.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions