pinocchio
pinocchio copied to clipboard
module 'pinocchio.pinocchio_pywrap_default' has no attribute 'buildModelFromSdf'
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.
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
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!
Hi @jameswzhu,
Could you share your robot model? Best,
Justin
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
@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)?
Thanks for the recommendation! I will try that and follow up with you on if that solved the issue.
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.
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.