Fix update of step reward when weight is zero
Description
This pull request fixes a bug where _step_reward could retain stale values when a reward term's weight was dynamically changed back to zero.
Previously, when a reward term had zero weight, the computation skipped updating _step_reward, assuming that it would stay correct.
However, if the weight was first changed from zero to nonzero and then back to zero during runtime (e.g., in curriculum settings), stale nonzero values could persist, causing incorrect reward visualizations or logging.
This change explicitly sets reward_manager._step_reward to zero when a reward term has zero weight, ensuring correctness regardless of dynamic weight changes.
Fixes #2391
No new dependencies are introduced by this change.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
Screenshots
Not applicable.
Checklist
- [x] I have run the
pre-commitchecks with./isaaclab.sh --format - [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have updated the changelog and the corresponding version in the extension's
config/extension.tomlfile - [x] I have added my name to the
CONTRIBUTORS.mdor my name already exists there