-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ur3 library is linked by default when using ur_kin.h and ur_kin.cpp from the ur_kinematics package #490
Comments
I think the short answer is that directly linking against the I'm a bit surprised to see that explicitly adding the version you want to This is still far from a perfect solution since:
I'm honestly not sure what the best solution is. I'd say it necessarily goes through exporting differently named classes/functions for each UR model, so you can link against all of them and still select the one you want in user code. There's probably some way to do this with minor modifications, and possibly without breaking users depending on hacks such as the one you used. Unless you want to work on a PR really fixing the issue, I'd say your solution is a good compromise. |
I've always thought the "best" way to deal with this would be to split out the kinematics plugins into packages. They could still depend on a shared package which provides all the base functionality, but each package could be specific to each plugin. Linking would be against those specific packages, not against the base package. |
Not sure I get your point. AFAIK, the plugins are not the issue here, since you can still dynamically load the one you want. The issue as I understand it is if you want to directly link your code against the different |
We could certainly rename the functions, but in the end the robot model is exactly the same, it's just the translations which differ. That makes it ideal for reuse, which I guess is what the rationale is behind the current setup (identical names of functions, change just the constants used). My idea behind using separate packages is that it conveniently allows for keeping the same code and fixes the deployment problem for consumers: by stating the correct dependency in the manifest and build script, it's clear which IK plugin is being linked. It would be similar to how IKFast plugins are used fi. |
This pull request(#355) from 2018 is closely related with our current topic. That might give us some ideas. @gavanderhoorn I am not sure that creating separate packages solves all the issues. It might be a compromise, but one problem that comes to mind with this approach is the inability to select multiple UR models from another package because of linking against |
I may be missing something here, but I don't quite see how splitting into packages helps reuse the same code. It does improve the deployment, but issues will still be there for use cases where more than one model of UR is used. I cannot think of other way to solve this other than renaming/namespacing the functions for each model, irrespective of whether they stay in the same package or not.
That's a good point.
I think something along this line would be my preferred choice. It allows to maintain the same code for the kinematics while allowing the user to pick and choose which model they want to work with. |
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:
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
By replacing the code above by this:
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.
The text was updated successfully, but these errors were encountered: