Sample_lidar_replay to visualize recorded lidar data as a 3D point cloud

Please provide the following info (check/uncheck the boxes after creating this topic):
Software Version
DRIVE OS Linux 5.2.6
DRIVE OS Linux 5.2.6 and DriveWorks 4.0
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other

Target Operating System
Linux
QNX
other

Hardware Platform
NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
1.7.1.8928
other

Host Machine Version
native Ubuntu 18.04
other

Hello, there!

I’m trying to use sample_lidar_replay to visualize my recorded lidar data as a 3D point cloud. But the output is not as expected.
The recorded data has been sampled by a non-supported custom lidar. The lidar is not rotating. It creates a picture of 3260 points. 96 pictures have been recorded without moving the lidar.
I mapped my recorded data to the dwLidarDecodedPacket structure in the following why:
dwTime_t hostTimestamp; → currently set to 0
dwTime_t sensorTimestamp; → currently set to 0
dwTime_t duration; → should be 0 (nothing rotating)
uint32_t maxPoints; → 32
60=1.920
uint32_t nPoints; → 1920
bool scanComplete; → true
const dwLidarPointRTHI* pointsRTHI; → spherical coordinates, intensity=0
const dwLidarPointXYZI* pointsXYZI; → set to NULL

I also changed the dwLidarProperties as follows:
spinFrequency = 30; → 30 frames per second
packetsPerSecond = 30;
packetsPerSpin = 1;
pointsPerSecond = 303260;
pointsPerPacket = 3260;
pointsPerSpin = 32
60;
pointStride = 4;

In the sample_lidar_replay main.cpp I mainly made these changes:
· Instead of calling dwSensorLidar_readPacket I take the mapped date from my recorder file.
· I changed the coordinates from XYZ to RTH
· Function dwSensorLidar_returnPacket is not used

After building I execute the new sample_lidar_replay on nvidia drive AGX Xavier A. As output I can see a rectangular point cloud – see picture.
It shows a 360° point cloud, but as the lidar is not rotating I expected a theta = 70° point cloud only.

Is my mapping to dwLidarDecodedPacket and dwLidarProperties correct?
Is the sample_lidar_replay capable to work with spherical coordinates?
Do I have to define the coordinate system?

Thanks!

Dear @Benutzer2154,
Could you share your lidar details and code snippet?

Hello,

attached is the modified main file from lidar_replay sample.

From lidar I get spherical coordinates (r, theta and phi). The orientation is like in the picture:

image003.jpg

Do you have the same orientation?

In the forum I cannot upload my picture. See point cloud result attached.

Thanks for your help.

main.cpp (20.3 KB)

Hello,

short update: the values for theta and phi were much too big. I reduced them and now the point cloud goes more in the direction of the expected result.
There is a movement from top to bottom. But still the orientation of the coordinate system is not correct.

In the replay file we should see a person walking towards the lidar sensor (z-axis).

In the conventions it’s just stated “The LIDAR manufacturer defines the LIDAR Coordinate System.”
What exactly do we have to do?

Thanks.

Hello,

assuming this orientation of axis:

image001.png

The angles of our lidar replay data are defined like this:

image002.png

Is this understanding correct?

Thanks for your support.

Dear @Benutzer2154,
It looks you are able to fix the issue with your code snippet. Do you still need any support in the code snippet? If so, could you please share the latest code snippet after changes.

I am yet to get response from the engineering team on the clarification of " Lidar coordinate system"? I will update the thread once I hear from them soon.

Hello,

the implementation for lidar replay is fine.
The only open point is the orientation of the lidar coordinate system.
I am looking forward to get some more information on that. Thanks!

Dear @Benutzer2154,
Is this understanding correct?

Yes.

I changed the coordinates from XYZ to RTH

I don’t get this, for what? Lidar packet should contain both, XYZI and RTHI coordinates

Hello,

in the original nvidia lidar replay sample XYZ coordinates where used only and copied to pointcloud buffer.
Our lidar sends RTHI coordinates only. Therefore I copied our RTHI values to the pointcloud buffer.
But now they are mixed up with XYZ which is wrong.
Is there no configuration which defines whether XYZ or RTH coordinates are used?
Can’t I decide whether I want to use XYZ or RTH coordinates?

Thanks.