From d968f5bb52fcb2e533a6b55279fdac9c65a7b01b Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Sat, 16 Aug 2025 15:49:28 +0800 Subject: [PATCH 1/2] Fix terrain_out_of_bounds to return tensor instead of bool --- .../manager_based/locomotion/velocity/mdp/terminations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py b/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py index 2bebfb20e777..aadbad50e2fe 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py +++ b/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py @@ -30,7 +30,7 @@ def terrain_out_of_bounds( to the edge of the terrain is calculated based on the size of the terrain and the distance buffer. """ if env.scene.cfg.terrain.terrain_type == "plane": - return False # we have infinite terrain because it is a plane + return torch.zeros(env.num_envs, dtype=torch.bool, device=env.device) # we have infinite terrain because it is a plane elif env.scene.cfg.terrain.terrain_type == "generator": # obtain the size of the sub-terrains terrain_gen_cfg = env.scene.terrain.cfg.terrain_generator From e89d9603f4ae986d196ebfc7b57e957ea881400b Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Sat, 16 Aug 2025 15:52:55 +0800 Subject: [PATCH 2/2] precommit --- .../manager_based/locomotion/velocity/mdp/terminations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py b/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py index aadbad50e2fe..833663df1637 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py +++ b/source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/terminations.py @@ -30,7 +30,8 @@ def terrain_out_of_bounds( to the edge of the terrain is calculated based on the size of the terrain and the distance buffer. """ if env.scene.cfg.terrain.terrain_type == "plane": - return torch.zeros(env.num_envs, dtype=torch.bool, device=env.device) # we have infinite terrain because it is a plane + # we have infinite terrain because it is a plane + return torch.zeros(env.num_envs, dtype=torch.bool, device=env.device) elif env.scene.cfg.terrain.terrain_type == "generator": # obtain the size of the sub-terrains terrain_gen_cfg = env.scene.terrain.cfg.terrain_generator