kjyv / FloBaRoID

Framework for dynamical system identification of floating-base rigid body tree structures
GNU Lesser General Public License v3.0
61 stars 26 forks source link

python Excution problem with idyntree #13

Closed Lejou closed 2 years ago

Lejou commented 2 years ago

Version: ROS noetic

I compile the idyntree with the guidance in https://github.com/robotology/robotology-superbuild , with python-binding . However, when I run: ./trajectory.py .... I get the error:

Traceback (most recent call last):
  File "./trajectory.py", line 10, in <module>
    import iDynTree; iDynTree.init_helpers(); iDynTree.init_numpy_helpers()
ModuleNotFoundError: No module named 'iDynTree'

Then,I doubt that the module was not exported in the $PYTHONPATH, so I turn on a terminal and run python3 to verify the pythonpath. However, iDynTree was still not found while the module with the name "idyntree" was found. How could this happen? Is there something wrong with the installation of iDynTree? Why the module name could be different?

Screenshot from 2022-04-27 15-47-27

I would appreciate any help from you!

traversaro commented 2 years ago

Hi, iDynTree mantainer here. I think this repo was written against a really old version of iDynTree, the correct way of importing Gazebo with a modern version of iDynTree is:

import idyntree.bindings as iDynTree

see for example https://github.com/robotology/idyntree/blob/v5.1.0/examples/python/KinDynComputationsTutorial.py#L11 . I am afraid that this is not the only incompatibility between this repo and the latest version of iDynTree.

Lejou commented 2 years ago

Got it. Thank you, Traversaro!

I am very grateful for your reply and your contribution of this work!

kjyv commented 2 years ago

If you want to use this project, ideally start using only versions of all modules that where available in march 2017, also ros and ubuntu. Pull requests for any changes for compatibility updates are of course welcome ;)