Created
July 24, 2026 08:17
-
-
Save Muhammad-Yunus/0a54e58c25b47192ad8ebc2d7d2fa545 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://www.youtube.com/shorts/goCs0tH-d78 | |
| github - kaiaai/LDS | |
| Your LIDAR uses the Delta-2A / 3irobotics protocol (same as LDS08RR in the kaiaai/LDS repo), NOT the Neato XV11 protocol. | |
| Key issues with the old code: | |
| - Start byte is 0xAA, not 0xFA. The 0xFA bytes you were seeing are just random data/distance values | |
| - Packet size is variable (typically 72 bytes: header says packet_length=70 + 2 for the start/length fields), not a fixed 42 bytes | |
| - You were reading misaligned slices of the actual data stream | |
| Protocol structure (confirmed from your data matching AA 00 46 01 61 AD 00 3E): | |
| ┌────────┬───────────────────┬──────────────────┬─────────────────────────────┐ | |
| │ Offset │ Field │ Your data │ Meaning │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 0 │ Start byte │ AA │ Packet start │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 1-2 │ Packet length │ 00 46 (70) │ Total - 2 │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 3 │ Protocol version │ 01 │ Always 0x01 │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 4 │ Packet type │ 61 │ Always 0x61 │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 5 │ Data type │ AD │ RPM + measurements │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 6-7 │ Data length │ 00 3E (62) │ n_samples = (62-5)/3 = 19 │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 8 │ Scan freq ×20 │ 85/86 │ ~4.25 Hz │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 9-10 │ Offset angle ×100 │ varies │ Signed, BE │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 11-12 │ Start angle ×100 │ varies │ e.g. 08 CA = 22.50° │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ 13+ │ Samples (×19) │ 3 bytes each │ [quality, dist_hi, dist_lo] │ | |
| ├────────┼───────────────────┼──────────────────┼─────────────────────────────┤ | |
| │ last 2 │ Checksum │ sum of all bytes │ Big-endian │ | |
| └────────┴───────────────────┴──────────────────┴─────────────────────────────┘ | |
| Each measurement sample: distance_mm = (dist_hi<<8 | dist_lo) * 0.25 | |
| The updated script syncs on 0xAA, validates the header constants and checksum, decodes all 19 samples per packet with proper angles, | |
| and plots a polar scan like your previous version. Try running it and let me know if the data looks correct! |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python XIAOMI_LDS02RR Visualizer (watch https://www.youtube.com/shorts/goCs0tH-d78)