• 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
..
isaaclab Loading commit data...
isaaclab_assets Loading commit data...
isaaclab_mimic Loading commit data...
isaaclab_rl Loading commit data...
isaaclab_tasks Loading commit data...