Skip to content

[v2.0.1] LiDAR PointCloud2 is empty (0 points) because RGL 0.18 compact_by_field(IS_HIT) drops all hits #471

Description

@kazu-321

Environment

  • OS: Ubuntu 22.04
  • GPU: NVIDIA RTX 3070 Ti
  • AWSIM: v2.0.1 (AutowareSimulationDemo)
  • Unity: 6000.0.34f1
  • Bundled RGL: 0.18 (libRobotecGPULidar.so in AWSIM v2.0.1)
  • Reproduced on both the official Demo player and a local rebuild from the v2.0.1 source
  • Same PC: AWSIM Labs v1.6.1 (RGL 0.17) publishes a non-empty cloud

Also confirmed:

  • ROS 2 was not sourced in the AWSIM process (ROS_DISTRO unset). The "do not source ROS 2 in RobotecGPULidar standalone build" warning is a separate issue and was not the cause here.
  • RGL scene registration succeeded (~1400 objects).
  • LiDAR topics exist at ~10 Hz (/sensing/lidar/top/pointcloud_raw, ..._ex).

Problem

In AutowareSimulationDemo, LiDAR topics publish at ~10 Hz, but the cloud is empty (points = 0).
The Unity Game view also shows no points, so Autoware localization has no usable scan.

Cause

Raytracing itself is fine. Hits are discarded by the compact node.

Stage Point count
Rays 28800
Hits before compact (IS_HIT = 1) ~27080 / 28800 (~94%)
After compact_by_field(IS_HIT_I32) 0

v2.0.1 connects the graph as:

RGLNodeSequence.Connect(rglGraphLidar, rglSubgraphCompact);
RGLNodeSequence.Connect(rglSubgraphCompact, rglSubgraphToLidarFrame);

rglSubgraphCompact is AddNodePointsCompactByField(..., RGLField.IS_HIT_I32).

A standalone test of the same .so could produce hits. The failure appears in the AWSIM LiDAR graph + RGL 0.18 compact_by_field. Labs on this PC uses RGL 0.17 (AddNodePointsCompact) and does not hit this bug.

Materializing IS_HIT with a Format node before compact did not fix it. This looks like an RGL 0.18 compact bug (or a field-layout mismatch), not a missing mesh / CUDA / ROS setup problem.

Workaround (not a proper fix)

Skip the compact node and publish the raw cloud.

In Assets/RGLUnityPlugin/Scripts/LidarSensor.cs Awake():

// official v2.0.1
// RGLNodeSequence.Connect(rglGraphLidar, rglSubgraphCompact);
// RGLNodeSequence.Connect(rglSubgraphCompact, rglSubgraphToLidarFrame);

// workaround
RGLNodeSequence.Connect(rglGraphLidar, rglSubgraphToLidarFrame);

Also always connect ConnectToWorldFrame() to rglGraphLidar (not rglSubgraphCompact).

After this:

  • AWSIM Game view shows the cloud
  • /sensing/lidar/top/pointcloud_raw has 28800 points
  • Autoware NDT can consume the scan

Side effects:

  • Miss rays remain (~6%). They often become NaN / non-hits in the ROS cloud.
  • Autoware crop_box may warn about NaNs.
  • Visualization can still drop misses in C# by reading IS_HIT, but the ROS topic still includes them.

A proper fix would be in RGL 0.18 compact_by_field(IS_HIT), or AWSIM switching compact back on after that is fixed (or filtering misses without that node).

How to reproduce

  1. Ubuntu 22.04 + NVIDIA RTX GPU
  2. Run official AWSIM v2.0.1 Demo without sourcing ROS 2
  3. Load AutowareSimulationDemo (Shinjuku)
  4. ros2 topic hz /sensing/lidar/top/pointcloud_raw → ~10 Hz
  5. Inspect PointCloud2 size → 0 points
  6. Uncompacted yield of the same graph still shows ~27000 hits

Activity

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

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions