Skip to content

Commit be1e60c

Browse files
authored
Adds interval resampling on event manager's reset call (#1750)
# Description Previously on episodic resets, the "time left" for the interval events were not getting resampled. This means that if the user expects the event to happen in the range 6-8s of an episode, it could be that in a new episode, the push happens at a time outside this range as the time left variable keeps its old value. This MR fixes this issue by resampling the time left inside the manager's reset call. Note: This only matters for the case when "is_global_time" is False (which is the default). The reason is that when there is global time, the events are triggered through simulation time and not episode time. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] 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 - [x] 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
1 parent ea76678 commit be1e60c

File tree

3 files changed

+44
-13
lines changed

3 files changed

+44
-13
lines changed

source/extensions/omni.isaac.lab/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.30.6"
4+
version = "0.30.7"
55

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

source/extensions/omni.isaac.lab/docs/CHANGELOG.rst

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
11
Changelog
22
---------
33

4+
0.30.7 (2025-01-30)
5+
~~~~~~~~~~~~~~~~~~~
6+
7+
Fixed
8+
^^^^^
9+
10+
* Fixed resampling of interval time left for the next event in the :class:`~omni.isaac.lab.managers.EventManager`
11+
class. Earlier, the time left for interval-based events was not being resampled on episodic resets. This led
12+
to the event being triggered at the wrong time after the reset.
13+
14+
415
0.30.6 (2025-01-17)
516
~~~~~~~~~~~~~~~~~~~
617

718
Fixed
819
^^^^^
920

10-
* removed deprecation of :attr:`omni.isaac.lab.assets.ArticulationData.root_state_w` and
21+
* Removed deprecation of :attr:`omni.isaac.lab.assets.ArticulationData.root_state_w` and
1122
:attr:`omni.isaac.lab.assets.ArticulationData.body_state_w` derived properties.
12-
* removed deprecation of :meth:`omni.isaac.lab.assets.Articulation.write_root_state_to_sim`.
13-
* replaced calls to :attr:`omni.isaac.lab.assets.ArticulationData.root_com_state_w` and
23+
* Removed deprecation of :meth:`omni.isaac.lab.assets.Articulation.write_root_state_to_sim`.
24+
* Replaced calls to :attr:`omni.isaac.lab.assets.ArticulationData.root_com_state_w` and
1425
:attr:`omni.isaac.lab.assets.ArticulationData.root_link_state_w` with corresponding calls to
1526
:attr:`omni.isaac.lab.assets.ArticulationData.root_state_w`.
16-
* replaced calls to :attr:`omni.isaac.lab.assets.ArticulationData.body_com_state_w` and
27+
* Replaced calls to :attr:`omni.isaac.lab.assets.ArticulationData.body_com_state_w` and
1728
:attr:`omni.isaac.lab.assets.ArticulationData.body_link_state_w` properties with corresponding calls to
1829
:attr:`omni.isaac.lab.assets.ArticulationData.body_state_w` properties.
19-
* removed deprecation of :attr:`omni.isaac.lab.assets.RigidObjectData.root_state_w` derived properties .
20-
* removed deprecation of :meth:`omni.isaac.lab.assets.RigidObject.write_root_state_to_sim`.
21-
* replaced calls to :attr:`omni.isaac.lab.assets.RigidObjectData.root_com_state_w` and
30+
* Removed deprecation of :attr:`omni.isaac.lab.assets.RigidObjectData.root_state_w` derived properties.
31+
* Removed deprecation of :meth:`omni.isaac.lab.assets.RigidObject.write_root_state_to_sim`.
32+
* Replaced calls to :attr:`omni.isaac.lab.assets.RigidObjectData.root_com_state_w` and
2233
:attr:`omni.isaac.lab.assets.RigidObjectData.root_link_state_w` properties with corresponding calls to
2334
:attr:`omni.isaac.lab.assets.RigidObjectData.root_state_w` properties.
24-
* removed deprecation of :attr:`omni.isaac.lab.assets.RigidObjectCollectionData.root_state_w` derived properties.
25-
* removed deprecation of :meth:`omni.isaac.lab.assets.RigidObjectCollection.write_root_state_to_sim`.
26-
* replaced calls to :attr:`omni.isaac.lab.assets.RigidObjectCollectionData.root_com_state_w` and
35+
* Removed deprecation of :attr:`omni.isaac.lab.assets.RigidObjectCollectionData.root_state_w` derived properties.
36+
* Removed deprecation of :meth:`omni.isaac.lab.assets.RigidObjectCollection.write_root_state_to_sim`.
37+
* Replaced calls to :attr:`omni.isaac.lab.assets.RigidObjectCollectionData.root_com_state_w` and
2738
:attr:`omni.isaac.lab.assets.RigidObjectData.root_link_state_w` properties with corresponding calls to
2839
:attr:`omni.isaac.lab.assets.RigidObjectData.root_state_w` properties.
29-
* fixed indexing issue in ``write_root_link_velocity_to_sim`` in :class:`omni.isaac.lab.assets.RigidObject`
30-
* fixed index broadcasting in ``write_object_link_velocity_to_sim`` and ``write_object_com_pose_to_sim`` in :class:`omni.isaac.lab.assets.RigidObjectCollection`
40+
* Fixed indexing issue in ``write_root_link_velocity_to_sim`` in :class:`omni.isaac.lab.assets.RigidObject`
41+
* Fixed index broadcasting in ``write_object_link_velocity_to_sim`` and ``write_object_com_pose_to_sim`` in
42+
the :class:`omni.isaac.lab.assets.RigidObjectCollection` class.
3143

3244

3345
0.30.5 (2025-01-14)

source/extensions/omni.isaac.lab/omni/isaac/lab/managers/event_manager.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,25 @@ def reset(self, env_ids: Sequence[int] | None = None) -> dict[str, float]:
122122
for mode_cfg in self._mode_class_term_cfgs.values():
123123
for term_cfg in mode_cfg:
124124
term_cfg.func.reset(env_ids=env_ids)
125+
126+
# resolve number of environments
127+
if env_ids is None:
128+
num_envs = self._env.num_envs
129+
else:
130+
num_envs = len(env_ids)
131+
# if we are doing interval based events then we need to reset the time left
132+
# when the episode starts. otherwise the counter will start from the last time
133+
# for that environment
134+
if "interval" in self._mode_class_term_cfgs:
135+
for index, term_cfg in enumerate(self._mode_class_term_cfgs["interval"]):
136+
# sample a new interval and set that as time left
137+
# note: global time events are based on simulation time and not episode time
138+
# so we do not reset them
139+
if not term_cfg.is_global_time:
140+
lower, upper = term_cfg.interval_range_s
141+
sampled_interval = torch.rand(num_envs, device=self.device) * (upper - lower) + lower
142+
self._interval_term_time_left[index][env_ids] = sampled_interval
143+
125144
# nothing to log here
126145
return {}
127146

0 commit comments

Comments
 (0)