• Bikram Pandit's avatar
    Resets step reward buffer properly when weight is zero (#2392) · f1ba9c3a
    Bikram Pandit authored
    # 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-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
    - [ ] 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.toml` file
    - [x] I have added my name to the `CONTRIBUTORS.md` or my name already
    exists there
    f1ba9c3a
Name
Last commit
Last update
.aws Loading commit data...
.github Loading commit data...
.vscode Loading commit data...
apps Loading commit data...
docker Loading commit data...
docs Loading commit data...
scripts Loading commit data...
source Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.flake8 Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.pre-commit-config.yaml Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS.md Loading commit data...
LICENSE Loading commit data...
LICENSE-mimic Loading commit data...
README.md Loading commit data...
SECURITY.md Loading commit data...
VERSION Loading commit data...
environment.yml Loading commit data...
isaaclab.bat Loading commit data...
isaaclab.sh Loading commit data...
pyproject.toml Loading commit data...