Skip to content

Allow armature and damping on actuator elements - #544

Closed
adityasingh2400 wants to merge 1 commit into
google-deepmind:mainfrom
adityasingh2400:fix-actuator-armature-damping
Closed

Allow armature and damping on actuator elements#544
adityasingh2400 wants to merge 1 commit into
google-deepmind:mainfrom
adityasingh2400:fix-actuator-armature-damping

Conversation

@adityasingh2400

Copy link
Copy Markdown

MuJoCo accepts armature and damping on the general, motor, position, velocity, intvelocity, damper, cylinder and muscle actuators, and the <default> section of schema.xml already listed both for exactly those eight elements. The <actuator> elements themselves did not, so the attributes could only be reached through a default class and setting either one directly on an actuator raised AttributeError: 'armature' is not a valid attribute for <position>.

I found this by probing every attribute name in schema.xml against every element with MuJoCo 3.11.0 and keeping the ones MuJoCo parses but PyMJCF rejects. armature and damping on those eight actuators were the only remaining gap. I also confirmed that adhesion correctly rejects both, so it is left alone, and that the parsed values reach actuator_armature and actuator_damping in the compiled model. The declarations mirror the ones already used in the <default> block.

The new tests cover all eight actuator types and a round trip through MjModel that asserts the values survive. All nine fail before this change and pass after it.

MuJoCo accepts armature and damping on general, motor, position,
velocity, intvelocity, damper, cylinder and muscle actuators, and the
<default> section of the PyMJCF schema already listed both for exactly
those eight elements. The <actuator> elements themselves did not, so the
attributes could only be set through a default class and writing them
directly on an actuator raised AttributeError.

Verified against MuJoCo 3.11.0 that all eight accept both attributes,
that adhesion correctly rejects them, and that the parsed values reach
actuator_armature and actuator_damping in the compiled model.
@adityasingh2400

Copy link
Copy Markdown
Author

Closing this as superseded by 985d094, which replaced the hand-maintained schema.xml with the generated schema from MuJoCo's mjcf.schema.

I verified the specific gap this PR filled: the <general> actuator element on current main now carries both armature and damping, so the schema no longer rejects them and the hand edit here is redundant.

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