mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Add data.joint(k).dof_index and data.joint(k).qpos_index

Open vikashplus opened this issue 1 year ago • 0 comments

The feature, motivation and pitch

Significant quality-of-life improvement if all indices are returned for usecases involving

  • subsampling large datasets with joint subsets
  • resampling batches with joint subsets
  • building submatrices and subvectors of inertia, pos error, etc, for e.g. stable PD control (cc @Balint-H)
  • Optimizing for a trajectory with a subset of joints, systemID, etc. (cc @Balint-H)

Something similar already happens for

  • data.joint("my_ball_joint").qpos gives 4 numbers.
  • data.joint("my_ball_joint").qvel will give 3

Alternatives

There exist alternatives where one can check the type of joints and calculate the required indices.

Additional context

No response

vikashplus avatar Jan 09 '25 19:01 vikashplus