Skip to content

Support act and act_dot spans on BoundDataAccessor for actuators - #13

Open
M-Colley wants to merge 1 commit into
google-deepmind:mainfrom
M-Colley:feat/bound-data-accessor-act
Open

M-Colley wants to merge 1 commit into
google-deepmind:mainfrom
M-Colley:feat/bound-data-accessor-act

Conversation

@M-Colley

Copy link
Copy Markdown

Summary

Support actuator activation state (act) and activation derivative (act_dot) spans on BoundDataAccessor when binding MjsActuator specs via sim.data.bind(sim.model, actuator_specs):

  • Resolve self.act_id in BoundDataAccessor.__init__ using model_wrapper.actuator_actadr and model_wrapper.actuator_actnum via _span_indices (handling stateless actuators with actnum=0, single-state <muscle> actuators, and multi-state actuators).
  • Route "act" and "act_dot" through BoundDataAccessor.__getname and _get_indices, raising AttributeError when accessed on non-actuator bindings.

Testing

  • Added parameterized BindTest.test_actuator_act_bind (Impl.CPP and Impl.WARP) in torch_wrapper_test.py covering stateless <motor>, <muscle> (actdim=1), multi-state actdim=2, list bindings across mixed actuators, act_dot, unmasked and env_mask .set("act", ...), and AttributeError checks on non-actuator specs.
  • Ran pyink --check, isort --check, pyrefly check, and pytest reaf/simulation/torch/_src/core/torch_wrapper_test.py (77 passed).

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.

1 participant