Skip to content

Conversation

@pgesel-rai
Copy link
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.

@pgesel-rai pgesel-rai force-pushed the external-access-to-mj-state branch from a1733ef to 52a72aa Compare November 20, 2025 19:45
@pgesel-rai pgesel-rai force-pushed the external-access-to-mj-state branch from 52a72aa to ab949b7 Compare November 20, 2025 19:48
Signed-off-by: Paul Gesel <[email protected]>
Copy link
Member

@eholum-nasa eholum-nasa left a comment

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
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 join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants