temporary storage 7/9/2026 19:41
This commit is contained in:
30
README.md
30
README.md
@@ -13,21 +13,35 @@ Interface (base class) cho các hành vi **recovery** của navigation stack ROS
|
||||
- Core interface không publish trực tiếp. Package hiện có thêm các plugin mẫu build thành
|
||||
`.so` riêng và nạp qua **Boost.DLL** để kiểm chứng contract end-to-end.
|
||||
|
||||
## Vòng đời hướng-goal
|
||||
|
||||
```cpp
|
||||
behavior->configure(name, ctx); // 1 lần: ctx = {tf, global_path, global/local costmap}
|
||||
RecoveryGoal goal; goal.angle = 1.57; // mục tiêu RUNTIME: "quay 90 độ ngay lượt này"
|
||||
RecoveryResult r = behavior->start(goal);
|
||||
while (r.status == RecoveryStatus::kRunning)
|
||||
r = behavior->update(dt); // publish r.command; đọc r.progress / r.remaining / r.message
|
||||
```
|
||||
|
||||
API công khai `configure/start/update/cancel` là non-virtual (base lo guard/timeout/elapsed/cancel);
|
||||
plugin chỉ override hook `onConfigure()/onStart(goal)/onUpdate(dt)`.
|
||||
|
||||
## Ba họ recovery
|
||||
|
||||
| Họ | Ví dụ | Output | Method chính |
|
||||
|----|-------|--------|--------------|
|
||||
| A | regen path (đường thoát) | `robot_nav_msgs::Path` | `runBehavior()` |
|
||||
| B | clear costmap | không có (chỉ status) | `runBehavior()` |
|
||||
| C | rotation / backup | `robot_geometry_msgs::Twist` mỗi cycle | `computeCommand(dt)` |
|
||||
| Họ | Ví dụ | Output | Hook chính |
|
||||
|----|-------|--------|-----------|
|
||||
| A | regen path (đường thoát) | `robot_nav_msgs::Path` | `onUpdate()` one-shot |
|
||||
| B | clear costmap | không có (chỉ status) | `onUpdate()` one-shot |
|
||||
| C | rotation / backup | `robot_geometry_msgs::Twist` mỗi cycle | `onStart(goal)` + `onUpdate(dt)` |
|
||||
|
||||
Cả 3 chia sẻ một `RecoveryResult` hợp nhất mang cờ `output_type`.
|
||||
Cả 3 chia sẻ một `RecoveryResult` hợp nhất mang cờ `output_type` + rich feedback
|
||||
(`progress`/`remaining`/`elapsed`/`message`).
|
||||
|
||||
## Cấu trúc
|
||||
|
||||
```
|
||||
include/recovery_core/ recovery_types.h, recovery_config.h, recovery_behavior.h
|
||||
src/ phần chung của contract (types/config/default behavior)
|
||||
include/recovery_core/ recovery_types.h, recovery_behavior.h
|
||||
src/ phần chung của contract (types + base lifecycle)
|
||||
plugins/ clear_costmap, rotate, backup, regen_path plugin mẫu
|
||||
test/ contract test + Boost.DLL loader test
|
||||
examples/ minimal_recovery.cpp
|
||||
|
||||
Reference in New Issue
Block a user