Get Time Synchronized Data#

Note

Third-party sensors and accessories noted on this page are for illustrative purposes. Please refer to NVIDIA® DRIVE® Hyperion™ 8.1 Sensors and Accessories for supported sensors and accessories.

Get Time Synchronized Lidar Packets from Live Lidar Sensor#

dwSAL_initialize(&sal, sdk);

dwSensorHandle_t timeSensor  = DW_NULL_HANDLE;
dwSensorHandle_t lidarSensor = DW_NULL_HANDLE;

dwSensorParams lidarParams;
lidarParams.parameters = "ip=192.168.3.43,port=2368,device=VELO_HDL64E,scan-frequency=10.0";
lidarParams.protocol = "lidar.socket";
dwSAL_createSensor(&lidarSensor, lidarParams, sal);

dwSensorParams timeParams;
timeParams.parameters = "nvpps-device=/dev/nvpps0,reference-type=NOVATEL_CAN,can-device=can0";
timeParams.protocol = "time.nvpps";
dwSAL_createSensor(&timeSensor, timeParams, sal);

dwSensor_start(timeSensor);
dwSensor_start(lidarSensor);

while(loop) {
    dwSensorLidar_readPacket(...);

    // CODE: use the time synchronized lidar packets for other tasks

    dwSensorLidar_returnPacket(...);
}
dwSensor_stop(...);

dwSAL_releaseSensor(&timeSensor);
dwSAL_releaseSensor(&lidarSensor);

This can also be done with sensor recordings. For example, we can modify the example above with the following parameters to reference recorded data.

lidarParams.parameters = "file=lidar_recording.bin";
lidarParams.protocol   = "lidar.virtual";

timeParams.parameters = "file=time_recording.bin";
timeParams.protocol   = "time.virtual";

For more details, see Time Sensor Sample.