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

Feature/625 mujoco [draft] #908

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open

Conversation

juan-g-bonilla
Copy link
Contributor

Description

This PR adds a new paradigm for dynamics simulation. It makes use of the MuJoCo library for multi-body dynamics. A new DynamicObject is added, MJScene, whose purpose is to expose an interface that can interoperate with the rest of the Basilisk framework, while internally using MuJoCo to solve the complicated dynamics of a multi-body system. Scenarios have been added that showcase the current capabilities.

This feature should be considered in "alpha". Any and all code is subject to considerable refactors in the near future. Validation efforts are not complete; do not use this feature to produce results that you actually care about.

Verification

Tests have been added in src/simulation/dynamics/mujoco/_UnitTest and scenarios in examples/mujoco (src/tests/test_scenarioMujoco.py checks that these scenarios run).

Documentation

The scenarios documentation page has been updated to include a new section Multi-Body Dynamics Simulations with MuJoCo.

Future work

Things still to figure out (non-exhaustive):

  • Stateful SysModel (for models that define states with derivatives to be integrated by MJScene.
  • Possibly rework how the inertial properties (mass, etc.) are updated.
  • Allow prescribing joints and mass.
  • Add torque to the gravity model NBodyGravity.
  • Add hooks for vizard.
  • Add more tests to compare results and performance of spacecraft and MJScene

Upcoming mujoco features make use of SysModelTask
Need to import SWIG file from mujoco SWIG files
These SysModel output a message whose values are generated through interpolation
@juan-g-bonilla juan-g-bonilla added enhancement New feature or request dont merge Waiting on other changes before merging labels Jan 21, 2025
@juan-g-bonilla juan-g-bonilla self-assigned this Jan 21, 2025
@juan-g-bonilla juan-g-bonilla requested a review from a team as a code owner January 21, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont merge Waiting on other changes before merging enhancement New feature or request
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

MuJoCo as simulation module
1 participant