Skip to content

Commit 1732493

Browse files
committed
Remove the orphaned object_away_from_robot termination term
Its only consumer was the removed legacy ReorientObjectEnvCfg; neither the Direct env nor the parity manager configurations use an object-to-robot distance criterion.
1 parent 2727616 commit 1732493

3 files changed

Lines changed: 3 additions & 24 deletions

File tree

source/isaaclab_tasks/changelog.d/dexterous-env-convergence.major.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ Removed
3636
* Removed the legacy manager-based reorientation configuration
3737
``ReorientObjectEnvCfg`` and the manager terms only it consumed
3838
(``success_bonus``, ``track_pos_l2``, ``track_orientation_inv_l2``,
39-
``max_consecutive_success``, and ``object_away_from_goal``). Use the
40-
Direct-compatible manager configurations and terms instead (e.g.
39+
``max_consecutive_success``, ``object_away_from_goal``, and
40+
``object_away_from_robot``). Use the Direct-compatible manager
41+
configurations and terms instead (e.g.
4142
:class:`~isaaclab_tasks.core.reorient.mdp.ReorientReward` and
4243
:class:`~isaaclab_tasks.core.reorient.mdp.ReorientTimeout`).
4344

source/isaaclab_tasks/isaaclab_tasks/core/reorient/mdp/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ __all__ = [
2424
"evaluate_reorient_success",
2525
"reorient_reward",
2626
"ReorientReward",
27-
"object_away_from_robot",
2827
"object_reorientation_out_of_reach",
2928
"ReorientTimeout",
3029
]
@@ -54,7 +53,6 @@ from .rewards import (
5453
)
5554
from .terminations import (
5655
ReorientTimeout,
57-
object_away_from_robot,
5856
object_reorientation_out_of_reach,
5957
)
6058
from isaaclab.envs.mdp import *

source/isaaclab_tasks/isaaclab_tasks/core/reorient/mdp/terminations.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,3 @@ def __call__(
9595
reward_term: ReorientReward = env.reward_manager.get_term_cfg(reward_name).func
9696
max_success_reached = reward_term.successes >= max_successes
9797
return (env.episode_length_buf >= env.max_episode_length - 1) | max_success_reached
98-
99-
100-
class object_away_from_robot(ManagerTermBase):
101-
"""Terminate when the object is farther than the threshold [m] from the robot."""
102-
103-
def __init__(self, cfg: TerminationTermCfg, env: ManagerBasedRLEnv):
104-
super().__init__(cfg, env)
105-
106-
def __call__(
107-
self,
108-
env: ManagerBasedRLEnv,
109-
threshold: float,
110-
asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"),
111-
object_cfg: SceneEntityCfg = SceneEntityCfg("object"),
112-
) -> torch.Tensor:
113-
"""Return per-environment termination flags."""
114-
robot = env.scene[asset_cfg.name]
115-
obj = env.scene[object_cfg.name]
116-
distance = torch.linalg.norm(robot.data.root_pos_w.torch - obj.data.root_pos_w.torch, ord=2, dim=-1)
117-
return distance > threshold

0 commit comments

Comments
 (0)