Skip to content

[Question] Question about applying vertical drift of raycaster to hit point instead of starting pos #4144

Closed

Description

@AngLi-00

Question

In source/isaaclab/isaaclab/sensors/ray_caster/ray_caster.py --> _update_buffers_impl() --> line 307~308, the comment says that "apply vertical drift to ray starting position" but the vertical drift is applied to hit points instead of sensor pos i.e. starting position, is this a trick or bug?

        # 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)

Build Info

Describe the versions that you are currently using:

  • Isaac Lab Version: on main branch

Activity

  1. RandomOakForest commented on Dec 8, 2025

    @RandomOakForest
    Collaborator

    Thank you for posting this. The comment may need updating. The team will review it.

  2. RandomOakForest commented on Dec 23, 2025

    @RandomOakForest
    Collaborator

    @pascal-roth for vis. Thanks.

  3. pascal-roth commented on Dec 24, 2025

    @pascal-roth
    Collaborator

    This is intended. The z coordinate of the ray_hits_w can be independent of the vertical starting position of the raycaster (take the case of a height scanner with ray directions [0, 0, -1], then any change to the z-start position does not affect the z-position of the ray hits). To make sure that the vertical drift is correct applied, we add it directly to the ray_hits_w

  4. AngLi-00 commented on Dec 25, 2025

    @AngLi-00
    Author

    Thanks for the clarification!
    While I'm still confused why drift_range can added to starting point directly?
    Code in ray_caster.py line 245~246: https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab/isaaclab/sensors/ray_caster/ray_caster.py#L245C1-L246C37

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

    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
    

    maybe add drift to pos_w still works?

  5. RandomOakForest commented on Jan 2, 2026

    @RandomOakForest
    Collaborator

    Thank you for following up. Could you please post a new issue as a feature request, that is, a Proposal, for the team to consider this behavior? Thank you.

  6. AngLi-00 commented on Jan 5, 2026

    @AngLi-00
    Author

    Thank you for following up. Could you please post a new issue as a feature request, that is, a Proposal, for the team to consider this behavior? Thank you.

    Already posted an issue #4333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions