Skip to content

[Bug Report] JointPositionToLimitsAction does not preserve order on edge case #4515

@ian-chuang

Description

@ian-chuang

If you are submitting a bug report, please fill in the following details and use the tag [bug].

Describe the bug

I want to preserve the order of the joint names in EMAJointPositionToLimitsActionCfg except when I use the config below it doesn't preserve the order.

joint_pos = mdp.EMAJointPositionToLimitsActionCfg(
    asset_name="robot",
    joint_names=[f"joint_{i}" for i in range(16)],
    alpha=0.95,
    rescale_to_limits=True,
    preserve_order=True,
)

I found the bug here:

Basically if the length of joint_names matches the number of joints in the asset the joint_id needed for preserving order are overwritten.

I believe if we just confirm that self.cfg.joint_names is set beforehand then we shouldn't overwrite self._joint_ids

Steps to reproduce

Set joint_names to match the number of joints in the asset.

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