Skip to content

Commit 01aeacb

Browse files
jsmith-bdaiooctipus
authored andcommitted
Add backwards compatibility for attach_yaw_only
1 parent 74c145e commit 01aeacb

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

source/isaaclab/isaaclab/sensors/ray_caster/ray_caster.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,13 @@ def _update_buffers_impl(self, env_ids: Sequence[int]):
254254
ray_starts_w = self.ray_starts[env_ids]
255255
ray_starts_w += pos_w.unsqueeze(1)
256256
ray_directions_w = self.ray_directions[env_ids]
257-
elif self.cfg.ray_alignment == "yaw":
257+
elif self.cfg.ray_alignment == "yaw" or self.cfg.attach_yaw_only:
258+
if self.cfg.attach_yaw_only:
259+
omni.log.warn(
260+
"The `attach_yaw_only` property will be deprecated in a future release. Please use"
261+
" `ray_alignment='yaw'` instead."
262+
)
263+
258264
# apply horizontal drift to ray starting position in ray caster frame
259265
pos_w[:, 0:2] += quat_apply_yaw(quat_w, self.ray_cast_drift[env_ids])[:, 0:2]
260266
# only yaw orientation is considered and directions are not rotated

source/isaaclab/isaaclab/sensors/ray_caster/ray_caster_cfg.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ class OffsetCfg:
4444
offset: OffsetCfg = OffsetCfg()
4545
"""The offset pose of the sensor's frame from the sensor's parent frame. Defaults to identity."""
4646

47+
attach_yaw_only: bool = MISSING
48+
"""Whether the rays' starting positions and directions only track the yaw orientation.
49+
50+
This is useful for ray-casting height maps, where only yaw rotation is needed.
51+
52+
.. warning::
53+
54+
This attribute is deprecated. Use :attr:`~isaaclab.sensors.ray_caster.ray_caster_cfg.ray_alignment` instead.
55+
To get the same behavior, set `ray_alignment` to `"yaw"`.
56+
"""
57+
4758
ray_alignment: Literal["base", "yaw", "world"] = "yaw"
4859
"""Specify in what frame the rays are projected onto the ground. Default is `world`.
4960
* `base` if the rays' starting positions and directions track the full root orientation.

0 commit comments

Comments
 (0)