Skip to content

[Bug Report] reset_mocap_welds doesn't work properly #213

Open
@pmh5050

Description

@pmh5050

Describe the bug
The function reset_mocap_welds in mujoco_utils.py doesn't work properly.

def reset_mocap_welds(model, data):
    """Resets the mocap welds that we use for actuation."""
    if model.nmocap > 0 and model.eq_data is not None:
        for i in range(model.eq_data.shape[0]):
            if model.eq_type[i] == mujoco.mjtEq.mjEQ_WELD:
                model.eq_data[i, :7] = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0])
    mujoco.mj_forward(model, data)

The issue appears to be related to Line 79:

model.eq_data[i, :7] = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]) # (x, y, z, qx, qy, qz, qw)

It should be corrected to:

model.eq_data[i, 3:10] = np.array([0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]) # (x, y, z, qw, qx, qy, qz)

System Info

  • OS: ubuntu 20.04
  • Packages
gymnasium 0.29.1 (pip)
gymnasium-robotics 1.2.4 (pip)
mujoco 2.3.7 (pip)
  • Python version: 3.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions