Skip to content

[Proposal] Inconsistent Application of ray_cast_drift vs. drift_range #4333

Open

Description

@AngLi-00

Proposal

As discussed in #4144, the current implementation of ray_cast_drift is confusing because it implent differently from drift_range about z-drift.

Specifically:
drift_range is applied to the ray origin (pos_w) in world coordinates (see [ray_caster.py#L245–L246]):

apply drift to ray starting position in world frame
pos_w += self.drift[env_ids]

however ray_cast_drift is applied directly to the hit point’s z-coordinate in world frame (see [ray_caster.py@8ccebfe#L307]):

apply vertical drift to ray starting position in ray caster frame
self._data.ray_hits_w[env_ids, :, 2] += self.ray_cast_drift[env_ids, 2].unsqueeze(-1)

If ray_cast_drift is intended as an enhanced version of drift_range, its effect should be implemented in a consistent way.

Besides, typically we got height_scan observation through

    # extract the used quantities (to enable type-hinting)
    sensor: RayCaster = env.scene.sensors[sensor_cfg.name]
    # height scan: height = sensor_height - hit_point_z - offset
    return sensor.data.pos_w[:, 2].unsqueeze(1) - sensor.data.ray_hits_w[..., 2] - offset

Adding drift to pos_w (the sensor height) would naturally and correctly affect the final height reading.

Suggested Change

Consider applying ray_cast_drift to the ray origin (pos_w) instead of the hit point, aligning its implementation with drift. This would improve conceptual consistency.

Checklist

[x] I have checked that there is no similar issue in the repo (required)

Activity

  1. Mayankm96 commented on Jan 5, 2026

    @Mayankm96
    Contributor

    @jtigue-bdai Any idea on the above? I believe @jsmith-bdai initially merged this drifting feature.

  2. AngLi-00 commented on Jan 6, 2026

    @AngLi-00
    Author

    I also sawed the original PR 2556 , the intention to add drift to hit points was visualized drift in z-axis. Maybe change implementation of drift_range is more reasonable?

  3. added
    enhancement
    on Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions