stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
http://stack-of-tasks.github.io/pinocchio/
BSD 2-Clause "Simplified" License
1.7k stars 366 forks source link

Ros related compatibility issues #2230

Closed fangnan99 closed 2 months ago

fangnan99 commented 2 months ago

I've been using pinocchio with ros and there seems to be compatibility issues between different releases.

I have installed the python bindings of Pinocchio from pip, and the C++ bindings from ros (i.e. apt install ros-noetic-pinocchio). However, if I then run a python ros node that uses Pinocchio I get segmentation faults. This was not happening last year though After looking into the problem I found that

I could confirm this by removing /opt/ros/noetic/lib/x86_64-linux-gnu from LD_LIBRARY_PATH and the issue is solved. This is, however, not a good solution because there could be cases when the ros library is required. Therefore, I wonder what is the best practice for using Pinocchio with ros in both python and cpp. Should I compile from source?

jcarpent commented 2 months ago

You cannot install pinocchio from apt and use the one in pip together. You should isolate your different installations to be able to properly have several Pinocchio installed on your OS.

For Python usage, you can easily isolate your system using conda for instance.