unitreerobotics / unilidar_sdk

SDK for Unitree L1 LiDAR
BSD 3-Clause "New" or "Revised" License
59 stars 23 forks source link

Documentation clarification #6

Open DevonMorris opened 11 months ago

DevonMorris commented 11 months ago

I just ordered one of your lidar and am preparing to set up a ROS environment to use the lidar. Upon reviewing your SDK, I had a few questions.

Thanks for your support. I'm excited to get the hardware in hand and use your lidar!

bluecamel commented 11 months ago

I've also been getting familiar with the SDK recently and I can answer some of these questions.

* What is `cloud_scan_num` and why is it default set to 18?

I'd also like some clarification on this. I'd guess that they're doing something similar to what spinning, multi-channel lidar manufacturers do, where each channel has a ring ID. Ouster and Velodyne lidars that rotate 360 degrees and have some number of vertical channels/beams would have a corresponding number of rings in the output cloud. For example, a 64 channel lidar would produce 64 rings, a 128 channel would produce 128 rings, and so on.

That said, I'm not sure how that translates to this lidar since 1) there aren't truly distinct channels/beams/rings, and 2) I think there would be more than 18. If I had to guess, I'd say that they probably split the cloud up into 18 regions, but I think that would mean every 5 degrees of vertical FOV. Or perhaps it's every 10 degrees of the full 180, but that seems even more strange.

I just got the ROS node working with my unit last night. Sometime in the next week, I can look closer at the data and see if I can tease out how that works here.

* How do I interpret the different modes in `LEDDisplayMode` and do these effect the scan pattern of the lidar?

The English documentation is surprisingly hard to find on their site, but there's a bit more information in both the user manual (page 11) and unilidar user manual (page 5).

FWIW, I've found these documents in English:

* How do I interpret the `time` field of `PointUnitree`? Why is this a floating point number? Does this time field have units? Similarly for `stamp` in `PointCloudUnitree`

I'm certain of one thing here, which is that the time field is an offset for each point. The stamp of the overall point cloud will be the beginning time and the time for each point is an offset from the point cloud stamp. Now, I'm not yet sure if this is in milliseconds, microseconds, or nanoseconds. I would suspect that it's not the latter since it's a float.

DevonMorris commented 11 months ago

Hey thanks for responding @bluecamel. Mine is coming in the mail today so maybe I'll get an opportunity to play with it tonight.

Also, as an aside, I wonder if there is a way to make this work like a 2D LiDAR by turning off some of the LED. I know that there is this "Ring Light Mode," that has a bunch of bitflags for each LED (which I'm actually assuming really means some azimuth/elevation coordinates of the singular LED).

lingbomeng commented 11 months ago

Hi guys,

The cloud_scan_num means how many scan lines are cached as a frame of pointcloud. For example, if you set it to 18, then a frame of pointcloud will contain 18 laser scans. So the higher cloud_scan_num is, the lower the cloud frequency will be, which is because the total scans per second is fixed.

Secondly, the LEDDisplayMode is used only for controlling the LED lights' pattern, which is only for visual effect. So this will not effect the scan pattern of the lidar.

Lastly, the time field of PointUnitree stands for the relative time of this point from the cloud stamp and its unit is second.

@DevonMorris @bluecamel

gh0st-gh commented 7 months ago

What are the actual numbers though? "The higher it is, the slower" doesn't say much. The code is all closed source apparently. I don't think it's asking too much for a $400+ product to give configuration parameters and a datasheet, instead of requiring everyone to do trial and error and graph things just to figure out how they work.

Also, exactly how doe these parameters work? float rotate_yaw_bias = 0, float range_scale = 0.001, float range_bias = 0, float range_max = 50, float range_min = 0

I assume the range is in meters, but exactly how do the rest work? How does the yaw bias work? Can it be used to counteract rotational motion of the base, and by what factor per speed unit? What are the units of range scale? What's range bias and what are its UNITS?