Refactor lidar library: rename olei_config to lidar_config, add nanoscan example and shared byte helpers

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 09:27:43 +07:00
parent 59880871b0
commit 323715eab0
16 changed files with 621 additions and 814 deletions

View File

@@ -1,6 +1,4 @@
// test_dual.cpp — test 2 Olei lidars (front + rear) concurrently, per appsettings.json
// Olei-front: scan_1, DeviceIp 192.168.100.11, LocalIp 192.168.100.100, DevicePort 2368
// Olei-rear : scan_2, DeviceIp 192.168.100.12, LocalIp 192.168.100.100, DevicePort 2369
// Test 2 Olei lidars (front + rear) concurrently.
#include "lidarlib/lidar.hpp"
#include <cstdio>
#include <thread>
@@ -36,14 +34,7 @@ static void run_lidar(const char* tag, const lidarlib::ModelConfig& cfg,
}
int main() {
// Both front and rear are Family B in practice — front's real header
// string is "OLELR-1BS2", rear's is "OLELR-1BS5" (verified via live UDP
// sniff), NOT the VB (Family A) model the config name suggested. With
// MODEL_AUTO, the driver reads the real model name from the header and
// narrows the FOV when it matches a known entry in kModelTable
// (olei_lidar.cpp); "1BS5" matches (→ full 360°), but "1BS2" doesn't, so
// front currently stays at the unfiltered 360° default. Call
// drv.detected_model() to see which name was actually read.
// Real headers (UDP sniff): front = "OLELR-1BS2", rear = "OLELR-1BS5".
std::thread t_front(run_lidar, "front/scan_1", lidarlib::MODEL_AUTO,
"192.168.100.100", 2368, false, 5);
std::thread t_rear(run_lidar, "rear/scan_2", lidarlib::MODEL_AUTO,