-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support for jaxsim simulator with examples #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early comments.
They can be rapidly addressed using pyupgrade as pyupgrade src/comodo/jaxsimSimulator/jaxsimSimulator.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early review.
I'm waiting for #21 to be fixed and be able to run on a server the same notebook, but the implementation is now complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xela-95 for this PR! I left minor nits (non-blocking). I'm facing the following problem when running the notebook, does it reproduce also on other setups?
AttributeError Traceback (most recent call last)
Cell In[6], line 15
13 step_length = 0.1
14 mpc = CentroidalMPC(robot_model=robot_model_init, step_length=step_length)
---> 15 mpc.intialize_mpc(mpc_parameters=mpc_parameters)
17 # Set desired quantities
18 mpc.configure(s_init=s_0, H_b_init=H_b_0)
File ~/git/comodo/src/comodo/centroidalMPC/centroidalMPC.py:93, in CentroidalMPC.intialize_mpc(self, mpc_parameters)
91 self.contact_0_handler.set_parameter_int("number_of_corners", 4)
92 self.contact_0_handler.set_parameter_string("contact_name", "left_foot")
---> 93 self.contact_0_handler.set_parameter_vector_float("corner_0",self.robot_model.corner_0)
94 self.contact_0_handler.set_parameter_vector_float("corner_1", self.robot_model.corner_1)
95 self.contact_0_handler.set_parameter_vector_float(
96 "corner_2", self.robot_model.corner_2
97 )
AttributeError: 'RobotModel' object has no attribute 'corner_0'
Should be fixed by #20 (comment) |
Thanks for the review @diegoferigo! Since I detached this branch from a previous fork of @flferretti, I built my code on his changes, and some of them were needed for this notebook to run correctly (I had these local changes active on my machine). I will update the PR soon to include the missing changes to comodo. |
After the fix reported in #20 (comment), FYI I still get the following error, likely related to the changes you still need to port here:
|
3ac21c8
to
fcea6d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I successfully ran the notebook locally with the RigidContacts
model 🎉 I still have to try with other contact models, but for the moment this PR is good to go from my side. We can enhance it as needed in the future. Thanks @xela-95!
@CarlottaSartore this PR is ready for your review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, If it is possible I would divide the loading of the model from the initialization of the simulator
Co-authored-by: Filippo Ferretti <[email protected]>
Simplify conda environment installation Co-authored-by: Filippo Luca Ferretti <[email protected]>
Used `pyupgrade` for this. Co-authored-by: Filippo Ferretti <[email protected]>
Co-authored-by: Diego Ferigo <[email protected]> Co-authored-by: Filippo Luca Ferretti <[email protected]>
- update enum class for contact model type - manage the different ordering of joints internally (as done in mujoco) - Add docstrings for public apis - import contact models from the rbda.contacts module - Added a new property to track simulation time - Modified the step() method to support dry run mode for simulation - Updated the rendering logic to use the new simulation time property - Optimized the update of link contact forces - Added a new property to retrieve the contact model type
Addressing PR review comments. Co-authored-by: Diego Ferigo <[email protected]> Co-authored-by: Filippo Luca Ferretti <[email protected]>
Co-authored-by: Filippo Ferretti <[email protected]>
…ad_model` to the constructor
074acf6
to
28c219d
Compare
Great @xela-95 thank you ! Merging ! |
In this PR I'm adding support for JaxSim simulator and explaining how to use its interface with a notebook similar to the ones already available for the other simulators.