feat: per-point timing support for PointCloud2 - #3103
Conversation
1fa46bf to
a61f4a4
Compare
Greptile SummaryThis PR adds per-point timing metadata to Livox PointCloud2 messages. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "review: vendor-neutral PointCloud2 docs/..." | Re-trigger Greptile |
…oint-timing round-trip test
…ng config (default on) Consumers that never read offset_time/tag/line no longer pay for extracting them (0.50 -> 0.35 ms/frame decode; plain layout 0.21). Mid360Config.per_point_timing=False restores the legacy 16-byte wire layout entirely.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3103 +/- ##
==========================================
+ Coverage 74.90% 74.91% +0.01%
==========================================
Files 1114 1114
Lines 106086 106185 +99
Branches 9665 10223 +558
==========================================
+ Hits 79459 79551 +92
- Misses 23817 23822 +5
- Partials 2810 2812 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
| pc.fields[3] = make_field("intensity", 12, sensor_msgs::PointField::FLOAT32); | ||
| if (timing) { | ||
| pc.fields[4] = | ||
| make_field("offset_time", OFFSET_TIME_OFFSET, sensor_msgs::PointField::UINT32); |
There was a problem hiding this comment.
ROS version of livox follows the same general pattern
…fset_time) / legacy (x,y,z,intensity) Replaces the per_point_timing bool. No LIO in the stack reads intensity (passthrough for viz only), so minimal mode carries just geometry + the per-point timing that scan undistortion needs, at the legacy 16 B/point.
…stale layout-sync comment
… drop stale wire-layout block
…e wire default, full-format clouds imply a consumer that reads them
…idate sidecar array lengths in from_numpy
| // minimal (default) x,y,z,offset_time — 16 B/point | ||
| // full x,y,z,intensity,offset_time,tag,line — 22 B/point | ||
| // legacy x,y,z,intensity — 16 B/point | ||
| // offset_time is uint32 ns since the header stamp; tag/line are the Livox |
There was a problem hiding this comment.
main livox change: publish timing info
| # Parse field offsets. The message is self-describing; a known field is | ||
| # honored only when its advertised datatype matches what we read it as, | ||
| # otherwise it is treated as absent rather than misread. | ||
| _expected_datatype = { |
There was a problem hiding this comment.
note: this is generic, PointField is a ROS struct, and Pointcloud2 supports all these fields
Overdue cleanup
TLDR: PointCloud2 now supports more of PointCloud2 spec, ex:
x,y,z,intensity,offset_time,tag,lineandx,y,z,timestampinstead of only supportingx,y,z,intensityTest with