Skip to content

Loading MJCF in python that contains an actuator subclass default overwrites other subclass params #3561

Description

@Balint-H

Intro

I'm working on an RL environment, and wanted to compare various actuator settings' effects on the learning. I noticed that having defaults of one subclass of actuators in an MJCF sets the params of other subclasses defined.

I know that the actuator subclasses are just shorthands for parameter settings and that almost everything is implemented as general actuators under the hood (with a bit of special treatment for muscles), but this is still a surprising outcome for me.

My setup

Using Linux and the Python API, MuJoCo version 3.12.

What's happening? What did you expect?

I would expect that defining defaults for one actuator subclass would leave other actuators unaffected. i.e., if I have a position default defined, and a position , a motor and a muscle actuator in the MJCF, only the position actuator should be affected.

Steps for reproduction

  1. Load the model below in Python.
  2. Print biasprm.

Minimal model for reproduction

minimal XML
<mujoco model="mvp">
    <default>
        <joint type="hinge" pos="0 0 0" axis="1 0 0" stiffness="5" damping="0.01"/>
        <position ctrllimited="true" ctrlrange="0 1" kp="2" kv="3"/>
    </default>

    <worldbody>
        <body pos="0 0 0">
            <geom name="arm" type="capsule" size="0.005" fromto="0 0 0  0 0.1 0" rgba=".5 .1 .1 1"/>
            <joint name="shoulder"/>
        </body>
    </worldbody>

    <actuator>
        <motor name="m1" joint="shoulder"/>
    </actuator>

</mujoco>

Code required for reproduction

import mujoco
xml_path="mvp.xml"
print(mujoco.MjModel.from_xml_path(xml_path).actuator_biasprm[0])

Confirmations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions