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 72.36% 72.38% +0.02%
==========================================
Files 1024 1024
Lines 92038 92137 +99
Branches 8420 8439 +19
==========================================
+ Hits 66600 66692 +92
- Misses 23167 23172 +5
- Partials 2271 2273 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files 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
Needed for fastlivo (and would be good for pointlio/fastlio)
Partly does the "TODO: work with full spectrum of pointcloud2".
Test with