stephane-caron / pink

Python inverse kinematics based on Pinocchio
Apache License 2.0
169 stars 11 forks source link

Update to the Pinocchio 3 API #100

Open stephane-caron opened 5 days ago

stephane-caron commented 5 days ago

Pink still relies on some parts of the Pinocchio 2 API that have changed in Pinocchio 3, for instance:

Traceback (most recent call last):
  File "pink/examples/barriers/go2_squat.py", line 19, in <module>
    from pink.visualization import start_meshcat_visualizer
  File "pink/examples/barriers/pink/visualization.py", line 14, in <module>
    ) -> pin.visualize.MeshcatVisualizer:
         ^^^^^^^^^^^^^
AttributeError: module 'pinocchio' has no attribute 'visualize'
simeon-ned commented 4 days ago

I would be happy to assist with the integration and debugging of Pin3 if needed. Additionally, I think it would be interesting to modify some examples to work with models parsed from MJCF.

domrachev03 commented 2 hours ago

Apparently, this is the only issue with Pinocchio 3, and could be easily solved with from Pinocchio import visualize and using visualize instead of pin.visualize.

This is all I've changed in the pink to update it to pin3 (this branch is a little bit messy, but it shows the idea): https://github.com/domrachev03/pink/commit/08642f9bc0273964f59feb00b68b3058f7e1844f

I can open a PR for this after we finish with self-collision barrier.