build: vendor the Slamtec rplidar SDK in third_party
The repo is now self-contained: driver_rplidar compiles the SDK from third_party/rplidar_sdk (Linux sources only, teardown delete[] bug fixed in place), so a plain cmake configure needs no SDK path and no probing — the XLIDAR_RPLIDAR_SDK_DIR option and external references are gone. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
13
README.md
13
README.md
@@ -32,6 +32,8 @@ xlidar_driver/
|
||||
│ ├── driver_sick_tim/ # → driver_sick_tim.so (sick_tim_driver)
|
||||
│ ├── driver_sick_safety/ # → driver_sick_safety.so (sick_nanoscan3_driver)
|
||||
│ └── driver_espe/ # → driver_espe.so (espe_lga60_driver)
|
||||
├── third_party/
|
||||
│ └── rplidar_sdk/ # SDK Slamtec, build thẳng vào driver_rplidar.so
|
||||
├── examples/ # list_drivers, example, lidar_app
|
||||
└── docs/diagnostics.md # nghiên cứu layout dữ liệu chẩn đoán
|
||||
```
|
||||
@@ -59,19 +61,16 @@ xlidar_driver/
|
||||
## Cài đặt
|
||||
|
||||
Yêu cầu: Linux, CMake ≥ 3.16, C++17. Không có dependency ngoài (pthread,
|
||||
dl). Plugin rplidar cần thêm source SDK của Slamtec.
|
||||
dl); SDK của hãng (Slamtec cho plugin rplidar) đã nằm sẵn trong
|
||||
`third_party/` — clone là build được.
|
||||
|
||||
```bash
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
|
||||
-DXLIDAR_RPLIDAR_SDK_DIR=/path/to/rplidar_sdk # dir chứa include/ + src/
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build -j"$(nproc)"
|
||||
```
|
||||
|
||||
Kết quả: `build/src/liblidar_manager.so`, plugin trong `build/plugins/*.so`,
|
||||
demo trong `build/examples/`. Không truyền `XLIDAR_RPLIDAR_SDK_DIR` thì các
|
||||
vị trí quen thuộc được tự dò (`third_party/rplidar_sdk`,
|
||||
`../rplidar_sdk/sdk`, `../xloc-monorepo/xlocd/deps/rplidar_sdk`); không thấy
|
||||
SDK thì plugin rplidar bị bỏ qua, phần còn lại build bình thường.
|
||||
demo trong `build/examples/`.
|
||||
|
||||
Tùy chọn: `-DXLIDAR_BUILD_EXAMPLES=OFF`. Hỗ trợ `cmake --install` +
|
||||
`find_package(xlidar_driver)` (target `xlidar::lidar_manager`).
|
||||
|
||||
Reference in New Issue
Block a user