Unverified Commit ff9c7529 authored by ooctipus's avatar ooctipus Committed by GitHub

Fixes test_modify_env_param_curr_term (#2950)

This PR fixes the bug in the test `test_modify_env_param_curr_term`
```
    modify_reset_joint_pos = CurrTerm(
        func=mdp.modify_term_cfg,
        params={
            "address": "events.reset_pole_position.params.position_range", <------
            "modify_fn": replace_value,
            "modify_params": {"value": (-0.0, 0.0), "num_steps": 1},
        },
    )
```

it is trying to modify `events.reset_**pole**_position`

but in the assertion, it is checking `events.reset_**cart**_position`

```
joint_ids = env.event_manager.cfg.reset_cart_position.params["asset_cfg"].joint_ids
assert torch.all(robot.data.joint_pos[:, joint_ids] == 0.0)
```

it wasn't an error before because reset_joints_by_offset function was
buggy, and the tests suite passed before right before that bug was
fixed. Now that bug fixed, we found out this bug.

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

---------
Signed-off-by: 's avatarKelly Guo <kellyg@nvidia.com>
Signed-off-by: 's avatarooctipus <zhengyuz@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyguo123@hotmail.com>
parent 0b826f72
...@@ -47,7 +47,7 @@ class CurriculumsCfg: ...@@ -47,7 +47,7 @@ class CurriculumsCfg:
modify_reset_joint_pos = CurrTerm( modify_reset_joint_pos = CurrTerm(
func=mdp.modify_term_cfg, func=mdp.modify_term_cfg,
params={ params={
"address": "events.reset_pole_position.params.position_range", "address": "events.reset_cart_position.params.position_range",
"modify_fn": replace_value, "modify_fn": replace_value,
"modify_params": {"value": (-0.0, 0.0), "num_steps": 1}, "modify_params": {"value": (-0.0, 0.0), "num_steps": 1},
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment