Skip to content

Commit 162881c

Browse files
committed
Bugfix: Reset recurrent state after episode termination during evaluation in RSL-RL framework
1 parent 90af2be commit 162881c

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

scripts/reinforcement_learning/rsl_rl/play.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
import time
5959
import torch
6060

61-
from rsl_rl.runners import DistillationRunner, OnPolicyRunner
62-
6361
from isaaclab.envs import (
6462
DirectMARLEnv,
6563
DirectMARLEnvCfg,
@@ -70,6 +68,7 @@
7068
from isaaclab.utils.assets import retrieve_file_path
7169
from isaaclab.utils.dict import print_dict
7270
from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkpoint
71+
from rsl_rl.runners import DistillationRunner, OnPolicyRunner
7372

7473
from isaaclab_rl.rsl_rl import RslRlBaseRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx
7574

@@ -185,7 +184,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen
185184
# agent stepping
186185
actions = policy(obs)
187186
# env stepping
188-
obs, _, _, _ = env.step(actions)
187+
obs, _, dones, _ = env.step(actions)
188+
# reset recurrent states for episodes that have terminated
189+
policy_nn.reset(dones)
189190
if args_cli.video:
190191
timestep += 1
191192
# 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)