16
16
from isaaclab .sensors import RayCaster
17
17
from isaaclab .sim import SimulationContext
18
18
from isaaclab .utils import configclass
19
- from isaaclab .utils .warp import raycast_dynamic_meshes
19
+ from isaaclab .utils .warp import raycast_mesh
20
20
21
21
if TYPE_CHECKING :
22
22
from isaaclab .envs import ManagerBasedEnv , ManagerBasedRLEnv
@@ -84,15 +84,9 @@ def height_scan_door_recognition(
84
84
clip_height : tuple [float , float ] = (- 1.0 , 0.5 ),
85
85
return_height : bool = True ,
86
86
) -> 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.
92
88
93
- Args:
94
-
95
- """
89
+ Explicitly account for doors in the scene."""
96
90
97
91
# extract the used quantities (to enable type-hinting)
98
92
sensor : RayCaster = env .scene .sensors [sensor_cfg .name ]
@@ -106,24 +100,20 @@ def height_scan_door_recognition(
106
100
ray_directions = torch .zeros_like (ray_origins )
107
101
ray_directions [..., 2 ] = - 1.0
108
102
109
- hit_point_down = raycast_dynamic_meshes (
103
+ hit_point_down = raycast_mesh (
110
104
ray_origins ,
111
105
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 ]],
113
107
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 ,
116
108
)[0 ]
117
109
118
110
ray_directions [..., 2 ] = 1.0
119
111
120
- hit_point_up = raycast_dynamic_meshes (
112
+ hit_point_up = raycast_mesh (
121
113
ray_origins ,
122
114
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 ]],
124
116
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 ,
127
117
)[0 ]
128
118
129
119
lower_height = (
@@ -241,13 +231,11 @@ def _get_occuled_points(self, robot_position: torch.Tensor) -> torch.Tensor:
241
231
ray_directions [torch .isnan (ray_directions )] = 0.0
242
232
243
233
# raycast from the robot to intended hit positions
244
- ray_hits_w = raycast_dynamic_meshes (
234
+ ray_hits_w = raycast_mesh (
245
235
robot_position ,
246
236
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 ]],
248
238
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 ,
251
239
)[0 ]
252
240
253
241
# get not visible parts of the height-scan
@@ -323,9 +311,7 @@ def height_scan_square_exp_occlu(
323
311
) -> torch .Tensor :
324
312
"""Height scan from the given sensor w.r.t. the sensor's frame given in the square pattern of the sensor.
325
313
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."""
329
315
330
316
# extract the used quantities (to enable type-hinting)
331
317
sensor : RayCaster = env .scene .sensors [sensor_cfg .name ]
@@ -345,13 +331,11 @@ def height_scan_square_exp_occlu(
345
331
ray_directions [torch .isnan (ray_directions )] = 0.0
346
332
347
333
# raycast from the robot to intended hit positions
348
- ray_hits_w = raycast_dynamic_meshes (
334
+ ray_hits_w = raycast_mesh (
349
335
robot_position ,
350
336
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 ]],
352
338
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 ,
355
339
)[0 ]
356
340
357
341
# get not visible parts of the height-scan
@@ -418,7 +402,6 @@ def height_scan_square_exp_occlu_with_door_recognition(
418
402
shape ,
419
403
door_height_thres = door_height_thres ,
420
404
offset = offset ,
421
- clip_height = clip_height ,
422
405
return_height = False ,
423
406
)
424
407
return height_scan_square_exp_occlu (env , asset_cfg , sensor_cfg , shape , offset , clip_height )
0 commit comments