DriveWorks SDK Reference
5.14.77 Release
For Test and Development only

Lidar Replay Sample

Description

The Lidar Replay sample demonstrates how to connect to a Lidar and visualize the generated point cloud in 3D.

Running the Sample

The Lidar Replay sample, sample_lidar_replay, accepts the following parameters:

./sample_lidar_replay --protocol=[lidar.virtual|lidar.socket|lidar.custom]
                      --params=[comma/separated/key/value/pairs]
                      --show-intensity=[true|false]
                      --output-dir=[path/to/output/dir]
                      --profiling=[0|1]
                      --offscreen=[0|1|2]

Where:

--protocol=[lidar.virtual|lidar.socket|lidar.custom]
    Specifies which Lidar driver to use.
    - `lidar.virtual`: replays from file.
    - `lidar.socket`: live Lidar replay.
    - `lidar.custom` is used for custom full sensor plugin based lidars
    Default value: lidar.virtual

--params=[comma/separated/key/value/pairs]
    Different parameters are available for each Lidar driver.
    Default value: file=path/to/data/samples/sensors/lidar/lidar_velodyne_64.bin

--show-intensity=[true|false]
    Enables an alternative HUE based rendering mode, which renders intensity
    proportional to wavelength. Higher intensities are in blue, while lower intensities are in red.
    In default mode, color is rendered by 2D distance from the origin where red is near and blue is far.
    Default value: false

--output-dir=[path/to/output/dir]
    Specifies the output directory, where stores lidar point cloud dumps.
    Default value: none

--profiling=[0|1]
    When set to 1, enables sample profiling. Otherwise, profiling is disabled.
    Default value: 1

--offscreen=[0|1|2]
    Used to run windowed apps in headless mode:
    0: Displays window.
    1: Displays offscreen window.
    2: No window created.
    Default value: 0

During runtime, the following sample interactions are available:

  • Mouse left button: Rotates the point cloud.
  • Mouse wheel: Zooms in or out.
Note
For a full list of key/value pairs that can be passed to –params see Sensor Enumeration Sample .

Examples

Display live Lidar point clouds

./sample_lidar_replay --protocol=[lidar protocol] --params=device=[type of device],ip=[lidar IP address],dip=[IP address of UDP packet receiver],port=[lidar port],hres=[valid horizontal resolution],return-mode=[valid return mode],scan-frequency=[valid frequency] (--show-intensity=[true])
  • The Lidar must be up and running, and connected to the network.
  • dip (Destination IP Address) is applicable only for device HESAI_P_128_V4P5.
  • hres (Horizontal Resolution) is applicable only for device HESAI_P_128_V4P5.
  • return-mode is applicable only for device Velodyne, HESAI_P_128 and HESAI_P_128_V4P5.
  • Scan frequency is usually preset using the Lidar vendor tools.
  • For a full list of currently supported devices, see Sensor Enumeration Sample.

Display recorded Lidar point clouds

./sample_lidar_replay --protocol=lidar.virtual --params=file=[lidar file] (--show-intensity=[true])
  • The Lidar file can be obtained with the provided recording tools.
  • If no arguments are passed, a default Lidar file is loaded.

Display custom Lidar Plugin point clouds

./sample_lidar_replay --protocol=lidar.custom --params=decoder-path=<path_to_so>[,<custom params>]

Output

The sample opens a window to display a 3D point cloud.

Lidar Point Clouds Sample

Additional Information

For more details see Lidar.

In case of packet drops see Increase Packet Queue Size.