Skip to content

Commit b63a362

Browse files
committed
fixes
1 parent baca441 commit b63a362

File tree

5 files changed

+16
-33
lines changed

5 files changed

+16
-33
lines changed

exts/nav_suite/nav_suite/sensors/matterport_raycaster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def _update_buffers_impl(self, env_ids: Sequence[int]):
145145
self._data.quat_w[env_ids] = quat_w
146146

147147
# ray cast based on the sensor poses
148-
if self.cfg.attach_yaw_only:
148+
if self.cfg.ray_alignment == "yaw":
149149
# only yaw orientation is considered and directions are not rotated
150150
ray_starts_w = quat_apply_yaw(quat_w.repeat(1, self.num_rays), self.ray_starts[env_ids])
151151
ray_starts_w += pos_w.unsqueeze(1)

exts/nav_tasks/nav_tasks/configs/env_cfg_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class NavTasksDepthNavSceneCfg(InteractiveSceneCfg):
7676
height_scanner = RayCasterCfg(
7777
prim_path="{ENV_REGEX_NS}/Robot/base",
7878
offset=RayCasterCfg.OffsetCfg(pos=(0.0, 0.0, 20.0)),
79-
attach_yaw_only=True,
79+
ray_alignment="yaw",
8080
pattern_cfg=patterns.GridPatternCfg(resolution=0.1, size=[1.6, 1.0]),
8181
debug_vis=True,
8282
mesh_prim_paths=["/World/ground"],

exts/nav_tasks/nav_tasks/mdp/observations/height_scan_observations.py

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from isaaclab.sensors import RayCaster
1717
from isaaclab.sim import SimulationContext
1818
from isaaclab.utils import configclass
19-
from isaaclab.utils.warp import raycast_dynamic_meshes
19+
from isaaclab.utils.warp import raycast_mesh
2020

2121
if TYPE_CHECKING:
2222
from isaaclab.envs import ManagerBasedEnv, ManagerBasedRLEnv
@@ -84,15 +84,9 @@ def height_scan_door_recognition(
8484
clip_height: tuple[float, float] = (-1.0, 0.5),
8585
return_height: bool = True,
8686
) -> torch.Tensor | None:
87-
"""Height scan that xplicitly accounts for doors in the scene.
88-
89-
Doors should be recognized by performing two more raycasting operations: shortly above the ground up and down.
90-
Then it will be checked if the up raycast has a hit and if the hit is lower than the initial raycast.
91-
Moreover, it is checked if the distance between up and down raycast is above a certain threshold.
87+
"""Height scan from the given sensor w.r.t. the sensor's frame given in the square pattern of the sensor.
9288
93-
Args:
94-
95-
"""
89+
Explicitly account for doors in the scene."""
9690

9791
# extract the used quantities (to enable type-hinting)
9892
sensor: RayCaster = env.scene.sensors[sensor_cfg.name]
@@ -106,24 +100,20 @@ def height_scan_door_recognition(
106100
ray_directions = torch.zeros_like(ray_origins)
107101
ray_directions[..., 2] = -1.0
108102

109-
hit_point_down = raycast_dynamic_meshes(
103+
hit_point_down = raycast_mesh(
110104
ray_origins,
111105
ray_directions,
112-
mesh_ids_wp=sensor._mesh_ids_wp, # list with shape num_envs x num_meshes_per_env
106+
mesh=sensor.meshes[sensor.cfg.mesh_prim_paths[0]],
113107
max_dist=sensor.cfg.max_distance,
114-
mesh_positions_w=sensor._mesh_positions_w if sensor.cfg.track_mesh_transforms else None,
115-
mesh_orientations_w=sensor._mesh_orientations_w if sensor.cfg.track_mesh_transforms else None,
116108
)[0]
117109

118110
ray_directions[..., 2] = 1.0
119111

120-
hit_point_up = raycast_dynamic_meshes(
112+
hit_point_up = raycast_mesh(
121113
ray_origins,
122114
ray_directions,
123-
mesh_ids_wp=sensor._mesh_ids_wp, # list with shape num_envs x num_meshes_per_env
115+
mesh=sensor.meshes[sensor.cfg.mesh_prim_paths[0]],
124116
max_dist=sensor.cfg.max_distance,
125-
mesh_positions_w=sensor._mesh_positions_w if sensor.cfg.track_mesh_transforms else None,
126-
mesh_orientations_w=sensor._mesh_orientations_w if sensor.cfg.track_mesh_transforms else None,
127117
)[0]
128118

129119
lower_height = (
@@ -241,13 +231,11 @@ def _get_occuled_points(self, robot_position: torch.Tensor) -> torch.Tensor:
241231
ray_directions[torch.isnan(ray_directions)] = 0.0
242232

243233
# raycast from the robot to intended hit positions
244-
ray_hits_w = raycast_dynamic_meshes(
234+
ray_hits_w = raycast_mesh(
245235
robot_position,
246236
ray_directions,
247-
mesh_ids_wp=self._sensor._mesh_ids_wp, # list with shape num_envs x num_meshes_per_env
237+
mesh=self._sensor.meshes[self._sensor.cfg.mesh_prim_paths[0]],
248238
max_dist=self._sensor.cfg.max_distance,
249-
mesh_positions_w=self._sensor._mesh_positions_w if self._sensor.cfg.track_mesh_transforms else None,
250-
mesh_orientations_w=self._sensor._mesh_orientations_w if self._sensor.cfg.track_mesh_transforms else None,
251239
)[0]
252240

253241
# get not visible parts of the height-scan
@@ -323,9 +311,7 @@ def height_scan_square_exp_occlu(
323311
) -> torch.Tensor:
324312
"""Height scan from the given sensor w.r.t. the sensor's frame given in the square pattern of the sensor.
325313
326-
Explicitly account for occulsions of the terrain.
327-
328-
FIXME: IMPLEMENT AGAIN AS MODIFIER WITH NEW ISAAC SIM RELEASE"""
314+
Explicitly account for occulsions of the terrain."""
329315

330316
# extract the used quantities (to enable type-hinting)
331317
sensor: RayCaster = env.scene.sensors[sensor_cfg.name]
@@ -345,13 +331,11 @@ def height_scan_square_exp_occlu(
345331
ray_directions[torch.isnan(ray_directions)] = 0.0
346332

347333
# raycast from the robot to intended hit positions
348-
ray_hits_w = raycast_dynamic_meshes(
334+
ray_hits_w = raycast_mesh(
349335
robot_position,
350336
ray_directions,
351-
mesh_ids_wp=sensor._mesh_ids_wp, # list with shape num_envs x num_meshes_per_env
337+
mesh=sensor.meshes[sensor.cfg.mesh_prim_paths[0]],
352338
max_dist=sensor.cfg.max_distance,
353-
mesh_positions_w=sensor._mesh_positions_w if sensor.cfg.track_mesh_transforms else None,
354-
mesh_orientations_w=sensor._mesh_orientations_w if sensor.cfg.track_mesh_transforms else None,
355339
)[0]
356340

357341
# get not visible parts of the height-scan
@@ -418,7 +402,6 @@ def height_scan_square_exp_occlu_with_door_recognition(
418402
shape,
419403
door_height_thres=door_height_thres,
420404
offset=offset,
421-
clip_height=clip_height,
422405
return_height=False,
423406
)
424407
return height_scan_square_exp_occlu(env, asset_cfg, sensor_cfg, shape, offset, clip_height)

scripts/nav_suite/collector/curriculum_trajectory_sampling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TestTerrainCfg(InteractiveSceneCfg):
7575
size=(1.0, 1.0),
7676
),
7777
mesh_prim_paths=["/World/Terrain"],
78-
attach_yaw_only=True,
78+
ray_alignment="yaw",
7979
)
8080
# extras - light
8181
light = AssetBaseCfg(

scripts/nav_suite/terrains/matterport_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TestTerrainCfg(InteractiveSceneCfg):
7575
height_scanner = MatterportRayCasterCfg(
7676
prim_path="{ENV_REGEX_NS}/Robot/base",
7777
offset=MatterportRayCasterCfg.OffsetCfg(pos=(0.0, 0.0, 1.0)),
78-
attach_yaw_only=True,
78+
ray_alignment="yaw",
7979
pattern_cfg=patterns.GridPatternCfg(resolution=0.1, size=[2.0, 2.0]),
8080
debug_vis=True,
8181
mesh_prim_paths=[MATTERPORT_PLY_PATH],

0 commit comments

Comments
 (0)