Record lidar data error

I tried to use this command below to record lidar data from my VLP16. But I always got this error msg and got nothing. Did I miss something need to add?

./sample_record --lidar-driver=lidar.socket --lidar-params=device=VELO_VLP16,ip=192.168.1.201,port=2368,scan-frequency=10,file=~/lidar.bin --write-file-lidar=~/lidar.bin

[22-03-2019 13:15:12] Platform: Detected DDPX - Tegra A
[22-03-2019 13:15:12] Initialize DriveWorks SDK v1.5.3584
[22-03-2019 13:15:12] Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g38b3a75 against Drive PDK v5.0.13.2
[22-03-2019 13:15:12] TimeSource: monotonic epoch time offset is 1553227666898512
[22-03-2019 13:15:12] TimeSource: Could not detect valid PTP time source at nvpps. Fallback to eth0
[22-03-2019 13:15:12] PTP Time is available from Eth Driver
[22-03-2019 13:15:13] Platform: number of GPU devices detected 1
[22-03-2019 13:15:13] Platform: currently selected GPU device integrated ID 0
[22-03-2019 13:15:13] SDK: Resources mounted from /usr/local/driveworks-1.5/data/resources
[22-03-2019 13:15:13] SDK: Create NvMediaDevice
[22-03-2019 13:15:13] egl::Display: found 1 EGL devices
[22-03-2019 13:15:13] egl::Display: use drm device: drm-nvdc
[22-03-2019 13:15:13] SensorFactory::createSensor() -> lidar.socket, device=VELO_VLP16,ip=192.168.1.201,port=2368,scan-frequency=10,file=~/lidar.bin
[22-03-2019 13:15:13] LidarSocket::LidarSocket, connected to 192.168.1.201:2368
Error serializing packet 0
[22-03-2019 13:15:14] Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast handle, given instance is a nullptr
Error serializing packet 1
[22-03-2019 13:15:14] Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast handle, given instance is a nullptr
Error serializing packet 2
[22-03-2019 13:15:14] Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast handle, given instance is a nullptr

Dear chun-ting.chen,
I don’t see file parameter in the documentation. Could you please remove it and check again.

Dear SivaRamaKrishna,

After I remove the file parameter the result is the same and lidar.bin file is empty.

[22-03-2019 16:27:48] Platform: Detected DDPX - Tegra A
[22-03-2019 16:27:48] Initialize DriveWorks SDK v1.5.3584
[22-03-2019 16:27:48] Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g38b3a75 against Drive PDK v5.0.13.2
[22-03-2019 16:27:48] TimeSource: monotonic epoch time offset is 1553235326651561
[22-03-2019 16:27:48] TimeSource: Could not detect valid PTP time source at nvpps. Fallback to eth0
[22-03-2019 16:27:48] PTP Time is available from Eth Driver
[22-03-2019 16:27:49] Platform: number of GPU devices detected 1
[22-03-2019 16:27:49] Platform: currently selected GPU device integrated ID 0
[22-03-2019 16:27:49] SDK: Resources mounted from /usr/local/driveworks-1.5/data/resources
[22-03-2019 16:27:49] SDK: Create NvMediaDevice
[22-03-2019 16:27:49] egl::Display: found 1 EGL devices
[22-03-2019 16:27:49] egl::Display: use drm device: drm-nvdc
[22-03-2019 16:27:49] SensorFactory::createSensor() -> lidar.socket, device=VELO_VLP16,ip=192.168.1.201,port=2368,scan-frequency=10
[22-03-2019 16:27:49] LidarSocket::LidarSocket, connected to 192.168.1.201:2368
Error serializing packet 0
Error serializing packet 1
Error serializing packet 2

Dear chun-ting.chen,
It seems you are using Velodyne VLP16 Lidar. Did you modify the default LIDAR configuration?

  • Check IP and port number
  • Check with different valid frequency value of lidar
  • Give absolute path to output file and make sure you have write permisions

Dear SivaRamaKrishna,

After I restart the Xavier and give absolute path to output file. The latest error is shown below.

[25-03-2019 14:38:41] Platform: Detected DDPX - Tegra A
[25-03-2019 14:38:41] Initialize DriveWorks SDK v1.5.3584
[25-03-2019 14:38:41] Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g38b3a75 against Drive PDK v5.0.13.2
[25-03-2019 14:38:41] TimeSource: monotonic epoch time offset is 1553494609096502
[25-03-2019 14:38:41] PTP Time is available from NVPPS Driver
[25-03-2019 14:38:42] Platform: number of GPU devices detected 1
[25-03-2019 14:38:42] Platform: currently selected GPU device integrated ID 0
[25-03-2019 14:38:42] SDK: Resources mounted from /usr/local/driveworks-1.5/data/resources
[25-03-2019 14:38:42] SDK: Create NvMediaDevice
[25-03-2019 14:38:42] egl::Display: found 1 EGL devices
[25-03-2019 14:38:42] egl::Display: use drm device: drm-nvdc
[25-03-2019 14:38:42] SensorFactory::createSensor() -> lidar.socket, device=VELO_VLP16,ip=192.168.1.201,port=2368,scan-frequency=10
[25-03-2019 14:38:42] LidarSocket::LidarSocket, connected to 192.168.1.201:2368
Segmentation fault (core dumped)

Dear chun-ting.chen,
Are you able to ping Lidar from the board? If so, Can you open the lidar configuration page with http://<LIDAR_IP>(Refer page no 25 in VLP 16 manual) to check the correct port number.
Please run the command with correct port and IP. Also, did you check changing scan frequency?

Dear SivaRamaKrishna,

The lidar works fine when we use the ./lidar_accumulator and result is shown below
https://imgur.com/2zwPXoI

Therefore, this error may be not caused by the wrong IP or port.

Dear chun-ting.chen,
Could you share the used command?

Dear SivaRamaKrishna,

I used these commands which are shown below:

./sample_record --lidar-driver=lidar.socket --lidar-params=device=VELO_VLP16,ip=192.168.1.201,port=2368,scan-frequency=10 --write-file-lidar=lidar.bin

./sample_lidar_accumulator --ip=192.168.1.201 --port=2368 --device=VELO_VLP16 --scan-frequency=10

The ./sample_lidar_accumulator can exec both on PX2 and Xavier but ./sample_record can only exec on PX2.

Xavier may show the Segmentation fault error message.

Dear chun-ting.chen,

Could you please try to run the sample with give absolute path to output file like below?

./sample_record --lidar-driver=lidar.socket --lidar-params=device=VELO_VLP16,ip=192.168.1.201,port=2368,scan-frequency=10 --write-file-lidar=/home/user/lidar.bin

Dear chun-ting.chen,
Just confirm, are you able to run sample_record on x86?

Dear SivaRamaKrishna,

I never run sample_record on x86 before.

Could you please give me a document for reference?

Dear chun-ting.chen,
Thank you for bringing it to our notice. We are able to reproduce this bug. We are working on fix. We will update you on this after the fix.

Dear chun-ting.chen,
We have fixed the issue and it will be part of next release.