Skip to content
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

module 'pinocchio.pinocchio_pywrap_default' has no attribute 'buildModelFromSdf' #1839

Open
jameswzhu opened this issue Jan 20, 2023 · 8 comments

Comments

@jameswzhu
Copy link

Greetings,

I am trying to load a SDF model using the Pinocchio 3 Python bindings:
model, collision_model, visual_model = pin.buildModelsFromSdf(sdf_model_path)

However, I receive the following exception:
Exception has occurred: AttributeError module 'pinocchio.pinocchio_pywrap_default' has no attribute 'buildModelFromSdf' File "/usr/local/lib/python3/dist-packages/pinocchio/shortcuts.py", line 76, in buildModelsFromSdf model, constraint_models = pin.buildModelFromSdf(filename) File "/home/james/catkin_ws/src/quad-sdk/ilqr/microtaur.py", line 29, in <module> model, collision_model, visual_model = pin.buildModelsFromSdf(sdf_model_path) AttributeError: module 'pinocchio.pinocchio_pywrap_default' has no attribute 'buildModelFromSdf'

Did I miss installing a dependency or something similar? Help would be immensely appreciated. Thank you.

@fabinsch
Copy link
Contributor

fabinsch commented Jan 21, 2023

Hey @jameswzhu ,
It seems you're not building Pinocchio with SDF support . Make sure to be on the pinocchio3-preview branch and enable the cmake option BUILD_WITH_SDF_SUPPORT. I hope this helps

@jameswzhu
Copy link
Author

Thank you for the help! Yes I needed to turn on the SDF support. But now, I am seeing this error when I attempt to load a model:

Exception has occurred: MemoryError exception: no description File "/usr/local/lib/python3/dist-packages/pinocchio/shortcuts.py", line 78, in buildModelsFromSdf model, constraint_models = pin.buildModelFromSdf(filename, root_joint) File "/home/james/catkin_ws/src/quad-sdk/ilqr/microtaur.py", line 29, in <module> model, collision_model, visual_model = pin.buildModelsFromSdf(sdf_model_path, root_joint=pin.JointModelFreeFlyer()) MemoryError:

Any thoughts on this? Though this may be something with my personal setup that I will try to debug. Thanks!

@jcarpent
Copy link
Contributor

Hi @jameswzhu,

Could you share your robot model?
Best,

Justin

@jameswzhu
Copy link
Author

Sure, the robot model I want to load is for the Ghost Robotics Spirit. But also for debugging, I've have tried just a simple box model. But the error occurs for both models. I've attached the files below, hope this helps!
models.zip

@jcarpent
Copy link
Contributor

@jameswzhu from your previous message, it seems you are mixing two strategies to install Pinocchio. One uses catkin, and the other one uses dist-package. Could you start from a fresh environment (e.g., docker or conda)?

@jameswzhu
Copy link
Author

Thanks for the recommendation! I will try that and follow up with you on if that solved the issue.

@jameswzhu
Copy link
Author

jameswzhu commented Feb 10, 2023

Sorry for the delay in response, but I think I'm still struggling with the installation. When I install pinocchio from source, should it not be found in the python3/dist-packages folder? Also wanted to mention that loading models from URDF works fine, but not from SDF.

@jameswzhu
Copy link
Author

I wanted to follow up with some more information. Does it matter which libsdformat release I am using? I currently have libsdformat6. on Ubuntu 20.04, with C++14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants