feat: AMCL 定位接入、场地定位工具与文档更新

This commit is contained in:
mzx committed 2026-11-19 12:54:02 +08:00
1 parent 0c6b49e276
commit 0e4e4c6e18
45 files changed
+3173 -151

No files matched your search

+9 -3
View File
@@ -17,7 +17,7 @@
```bash
cd ~/Gazebo_projects/sentry_nav_dev
xmake # 约 9 秒(首次),增量 0.5 秒
xmake test # 85 项单测,约 5 ms
xmake test # 3 个套件 223 项,约 5 ms
```
产物在**仓库根**的 `build/linux/x86_64/release/{self_filter,patrol}`。
@@ -100,7 +100,7 @@ src/sentry_nav/
│ ├── self_filter_core.hpp
│ ├── waypoint_sequencer.hpp
│ └── README.md ★ 两个头的完整接口
├── tests/ ★ 85 项单测(8 组 + 9 组)
├── tests/ ★ 223 项单测(3 个套件)
│ ├── test_self_filter_core.cpp
│ ├── test_waypoint_sequencer.cpp
│ ├── test_util.hpp
@@ -117,7 +117,7 @@ src/sentry_nav/
| | 放在 `src/core/` | 混进节点代码里 |
|---|---|---|
| 跑单测 | **1 秒跑完 85 项** | 要起 Gazebo + Nav2 |
| 跑单测 | **5 毫秒跑完 223 项** | 要起 Gazebo + Nav2 |
| 需要 `source /opt/ros/...` | **不需要** | 需要 |
| 边界条件(`0.40` vs `0.39`) | 能精确断言 | 肉眼看不出来 |
@@ -186,6 +186,12 @@ build/linux/x86_64/release/patrol --ros-args -p use_sim_time:=true \
| `frame_id` | `map` | 航点坐标系 |
| `waypoints` | 一组示例点 | `[x1, y1, x2, y2, ...]`,成对 |
| `loop` | `true` | `false` = 走完一轮退出 |
| `face_mode` | `next` | 到达航点时车头朝哪:`next` = 朝下一个航点(到点即可接着走)/ `travel` = 顺着来路 / `none` = 不关心(旧行为,朝 +X) |
> **`face_mode` 为什么重要**:Nav2 的导航目标是「位置 + 朝向」。
> 朝向漏掉时四元数退化成 `yaw = 0`,也就是不管往哪走,到点后车头都摆向场地东边。
> 麦克纳姆轮能横着走,所以车会「平移过去再原地转正」,像被拖着的箱子;
> 真机上枪口在车头,朝向错了等于枪口朝后。
## 下一步(按优先级)