Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

External access to MuJoCo model and data - #39

Merged
eholum-nasa merged 3 commits into
NASA-JSC-Robotics:humble-develfrom
pgesel-rai:external-access-to-mj-state
Nov 21, 2025
Merged

eholum-nasa merged 3 commits into
NASA-JSC-Robotics:humble-develfrom
pgesel-rai:external-access-to-mj-state

Conversation

@pgesel-rai

Copy link
Copy Markdown
Contributor

I have a specialized use case for accessing the MuJoCo model and data external to the MujocoSystemInterface class. This PR add an interfaces for reading and writing the data. I intent to call these methods from either a hardware interface that inherits from MujocoSystemInterface or from outside the class, potentially a wrapper hardware interface or a singleton pattern. Either way, adding these public methods will work.

Signed-off-by: Paul Gesel <pgesel@theaiinstitute.com>
Signed-off-by: Paul Gesel <pgesel@theaiinstitute.com>

@eholum-nasa eholum-nasa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably little used interfaces for the near term but unlimited power.


void MujocoSystemInterface::get_model(mjModel*& dest)
{
const std::unique_lock<std::recursive_mutex> lock(*sim_mutex_);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someday we will refactor this whole darn thing so that we're not living with the lazy choice I made 6 months ago forever... But it is not this day.

@eholum-nasa
eholum-nasa merged commit 0f82d28 into NASA-JSC-Robotics:humble-devel Nov 21, 2025
2 checks passed
eholum-nasa added a commit that referenced this pull request Nov 21, 2025
External access to MuJoCo model and data
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants