Skip to content

Commit e69b6d9

Browse files
authored
Resets recurrent state after episode termination in RSL-RL play.py (#3838)
# Description This PR fixes an issue in recurrent policy evaluation where the recurrent state was not being reset after an episode termination. The missing reset caused residual memory to persist between episodes. The fix ensures that `reset()` is now called during evaluation in `play.py` for policy networks, including recurrent. Fixes #3837 <!-- replace with actual issue number --> ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Screenshots N/A ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation where necessary - [x] My changes generate no new warnings - [x] I have added tests verifying that recurrent states are correctly reset during evaluation - [x] I have updated the changelog and 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
1 parent c8e1d4e commit e69b6d9

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

scripts/reinforcement_learning/rsl_rl/play.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen
185185
# agent stepping
186186
actions = policy(obs)
187187
# env stepping
188-
obs, _, _, _ = env.step(actions)
188+
obs, _, dones, _ = env.step(actions)
189+
# reset recurrent states for episodes that have terminated
190+
policy_nn.reset(dones)
189191
if args_cli.video:
190192
timestep += 1
191193
# Exit the play loop after recording one video

source/isaaclab/config/extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
# Note: Semantic Versioning is used: https://semver.org/
4-
version = "0.47.5"
4+
version = "0.47.6"
55

66
# Description
77
title = "Isaac Lab framework for Robot Learning"

source/isaaclab/docs/CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Changelog
22
---------
33

4+
5+
0.47.6 (2025-11-01)
6+
~~~~~~~~~~~~~~~~~~~~
7+
8+
Fixed
9+
^^^^^
10+
11+
* Fixed an issue in recurrent policy evaluation in RSL-RL framework where the recurrent state was not reset after an episode termination.
12+
13+
414
0.47.5 (2025-10-30)
515
~~~~~~~~~~~~~~~~~~~
616

0 commit comments

Comments
 (0)