Disabling actuators during run-time from Python #2684
Replies: 1 comment
-
Solved now, I was trying to access MjModel.opt directly instead of using MjOptions |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am a PhD student at Imperial College London and I use MuJoCo for my research on reconfigurable and adaptable robotics in the field of BioEngineering.
My setup
MuJoCo version: 3.3.1
Python API
Windows 11
My question
I am struggling with the actuatorgroupdisable functionality. I can get this to work well in the viewer, but is there a way to do this during run-time from Python?
I've tried digging through the simulate code to see how it's done for the viewer but I hit a dead end. Seems the Python bindings expose mjModel as read-only, but since editing the 'disableactuator' field in the model struct is possible for the viewer I'm wondering if there is a way to make it work for me also.
The documentation seems only to show how this works in the simulate window but I can find no evidence of anyone doing this or something similar from Python.
Any help is greatly appreciated.
Minimal model and/or code that explain my question
Model:
Code:
The codebase is split across many files, so posting it all here wouldn't be practical. The core idea is this:
I’m using two actuators to control a sliding joint on the shin:
One actuator moves the joint to a desired location
The other simulates locking it in place
I want to disable or enable these actuators at runtime, but I’m struggling to find a working approach through the Python API.
Ideally, I want to do something like this:
If there's a clean workaround or alternative solution to toggle actuator control on and off at runtime, please let me know.
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions