feat: load v_shape from the profile YAML, add the dock measuring guide
Read v_shape per profile and fail loud on an unknown value. The start log now prints the loaded v_shape so it can be checked without opening the YAML on the robot. Add doc/MEASURE_AND_CONFIGURE.md with figures and link it from the README.
@@ -98,6 +98,9 @@ Ba ca khác nhau, ba cách xử trí khác nhau:
|
||||
|
||||
## Config
|
||||
|
||||
Đo trạm thật, dán dải phản quang và điền profile: xem
|
||||
[`doc/MEASURE_AND_CONFIGURE.md`](doc/MEASURE_AND_CONFIGURE.md).
|
||||
|
||||
Xem `test/config/action_handlers_params.yaml`. Nhóm khoá:
|
||||
|
||||
- định tuyến: `action_types`, `output_frame`, `scan_topic`
|
||||
|
||||
356
doc/MEASURE_AND_CONFIGURE.md
Normal file
@@ -0,0 +1,356 @@
|
||||
# Đo trạm dock và cấu hình profile
|
||||
|
||||
Tài liệu cho người đứng cạnh robot: đo một trạm dock thật, dán dải phản quang, rồi điền số vào
|
||||
profile của `DockPatternActionHandler`. Mọi số trong profile là **số đo trên trạm thật**. Giá trị
|
||||
mặc định trong code chỉ để test chạy được.
|
||||
|
||||
Luật khớp chi tiết nằm ở README của gói `dock_pattern_detector`. Tài liệu này chỉ trả lời: đo cái
|
||||
gì, đo thế nào, điền vào đâu, và kiểm ra sao.
|
||||
|
||||
## Config nằm ở đâu
|
||||
|
||||
Profile nằm trong `action_handlers_params.yaml`, dưới đúng action dùng handler này:
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
detect_lidar: # tên action, tuỳ cây config
|
||||
action_types: [DetectCharger]
|
||||
scan_topic: /b_scan
|
||||
...
|
||||
default_profile: v_std
|
||||
profiles:
|
||||
<tên_trạm>: # một profile cho MỘT loại trạm
|
||||
pattern: v
|
||||
...
|
||||
```
|
||||
|
||||
- Mỗi loại trạm một profile. Order chọn profile qua `actionParameters` (khoá `profile_param_key`,
|
||||
mặc định `dock_profile`). Không gửi thì handler dùng `default_profile`.
|
||||
- Handler đọc và **kiểm mọi profile lúc boot**. Sửa YAML xong phải khởi động lại nav, nếu không nav
|
||||
vẫn chạy với config cũ. Một profile sai miền giá trị làm handler từ chối nạp và log rõ khoá nào sai.
|
||||
|
||||
## Thứ tự làm
|
||||
|
||||
1. Xác định dạng trạm: `pattern`, `v_shape`.
|
||||
2. Đo hình học: `wing_length`, `vertex_angle`.
|
||||
3. Đo pose đích: `offset_x` (và `offset_y`, `offset_yaw` nếu cần).
|
||||
4. Dán dải phản quang, đo `tape_width`, `tape_spacing`.
|
||||
5. Đo cường độ, đặt `tape_min_intensity`.
|
||||
6. Chỉnh các khoá theo cảm biến (tầm, quạt, bộ lọc).
|
||||
7. Bật, chạy, đọc log.
|
||||
|
||||
Dụng cụ: thước dây, thước thẳng, băng phản quang lăng kính. Thông tin cần tra trước: frame của
|
||||
cảm biến trong `scan_topic` và TF `base_link → <frame cảm biến>`, bước tia của cảm biến
|
||||
(`angle_increment`).
|
||||
|
||||
```bash
|
||||
rostopic echo -n1 /b_scan/header/frame_id
|
||||
rostopic echo -n1 /b_scan/angle_increment
|
||||
rosrun tf tf_echo base_link scan_2
|
||||
```
|
||||
|
||||
## 1. Dạng trạm: `pattern` và `v_shape`
|
||||
|
||||

|
||||
|
||||
| Khoá | Giá trị | Chọn thế nào |
|
||||
|---|---|---|
|
||||
| `pattern` | `v` / `arc` | Hai tấm phẳng gặp nhau ở một đỉnh: `v`. Máng cong: `arc` (xem mục 8). |
|
||||
| `v_shape` | `any` / `convex` / `concave` | Chỉ cho `pattern: v`. |
|
||||
|
||||
- **`convex` (V lồi)**: đỉnh chĩa về robot, hai mút cánh xa robot hơn đỉnh. Lidar thấy hai **mặt
|
||||
ngoài**.
|
||||
- **`concave` (V lõm)**: lòng V mở về robot, hai mút cánh gần robot hơn đỉnh. Lidar thấy hai **mặt
|
||||
trong**. Tấm mô phỏng `sim/models/dock_plate_v` thuộc loại này.
|
||||
- **`any`**: nhận cả hai. Đây là mặc định và là hành vi trước khi có khoá này.
|
||||
|
||||
Đặt `convex` hoặc `concave` loại được mọi vật chữ V có hướng ngược lại: ví dụ trạm lồi thì góc
|
||||
trong của hai bức tường (một V lõm) không còn bị nhận nhầm. Vật lẫn **cùng hướng** với trạm thì khoá
|
||||
này không chặn được; dùng dải phản quang (mục 4).
|
||||
|
||||
Đặt sai hướng thì trạm thật bị loại, log báo `wrong concave/convex orientation (profile requires
|
||||
v_shape=...)`. Không chắc thì để `any` và kiểm một lần bằng log.
|
||||
|
||||
## 2. Hình học V: `wing_length`, `vertex_angle`
|
||||
|
||||

|
||||
|
||||
**`wing_length`** [m]: từ mép đỉnh tới mút cánh, đo trên **mặt mà lidar nhìn thấy** (mặt ngoài cho
|
||||
V lồi, mặt trong cho V lõm). Đo cả hai cánh. Hai cánh lệch nhau hơn 1 cm thì ghi lại cả hai và
|
||||
nới `length_tolerance`.
|
||||
|
||||
**`vertex_angle`** [rad]: góc giữa hai cánh tại đỉnh. Không cần thước đo góc: đo khoảng cách thẳng
|
||||
`c` giữa hai mút cánh, rồi
|
||||
|
||||
```
|
||||
vertex_angle = 2 · asin( c / (2 · wing_length) )
|
||||
```
|
||||
|
||||
Ví dụ cánh 0.31 m, `c = 0.438 m` → 1.5708 rad (90°). Góc đo giữa hai **vector cánh** xuất phát từ
|
||||
đỉnh, không phải giữa hai pháp tuyến. Hai cách trùng nhau ở đúng 90° và lệch nhau ở mọi góc khác.
|
||||
|
||||
Các dung sai đi kèm, thường giữ mặc định:
|
||||
|
||||
| Khoá | Đơn vị | Mặc định | Chỉnh khi |
|
||||
|---|---|---|---|
|
||||
| `angle_tolerance` | rad | 0.17 | Trạm cong vênh. Không vượt π/2. Nới rộng là nhận thêm vật lạ. |
|
||||
| `length_tolerance` | m | 0.05 | Hai cánh lệch nhau. Phải nhỏ hơn `wing_length`. |
|
||||
| `vertex_gap` | m | 0.05 | Đỉnh bo tròn hoặc có khe. Phải nhỏ hơn `wing_length`. |
|
||||
| `min_wing_points` | tia | 5 | Tăng khi hiện trường nhiều vật giống hình; giảm thì dò được ở góc chếch hơn. |
|
||||
| `min_confidence` | [0, 1] | 0.5 | Nâng lên là khắt khe hơn với hình méo. |
|
||||
|
||||
Luật chiều dài cánh cố ý không đối xứng: không cánh nào được **dài** hơn `wing_length +
|
||||
length_tolerance` (chặn góc pallet), và ít nhất **một** cánh phải đúng `wing_length ±
|
||||
length_tolerance`. Cánh ngắn hơn vì bị che vẫn được nhận.
|
||||
|
||||
## 3. Pose đích: `offset_x`, `offset_y`, `offset_yaw`
|
||||
|
||||
Đầu ra của handler là pose `base_link` phải đạt khi đang sạc, không phải pose của trạm. Planner dock
|
||||
không cộng thêm khoảng cách nào, nên quên nửa thân xe ở đây là robot lùi xuyên qua trạm.
|
||||
|
||||
**`offset_x`** [m]: cho robot đứng **đúng vị trí đang sạc**. Đo dọc phân giác từ đỉnh tới
|
||||
`base_link`, hướng ra phía robot là dương.
|
||||
|
||||
`base_link` thường không đánh dấu được trên xe. Khi đó đo từ đỉnh tới tâm cảm biến (`d_sensor`),
|
||||
rồi cộng khoảng cách `s_x` từ cảm biến tới `base_link` lấy từ TF:
|
||||
|
||||
```
|
||||
offset_x = d_sensor + s_x (cảm biến nằm trên trục dọc xe, xe thẳng hàng với phân giác)
|
||||
```
|
||||
|
||||
Ví dụ lidar sau có TF `base_link → scan_2` là `x = -0.325`: `s_x = 0.325`.
|
||||
|
||||
**`offset_y`** [m]: đầu cắm sạc lệch ngang so với phân giác. Dương là sang trái, trong hệ của chính
|
||||
hình. **`offset_yaw`** [rad]: trạm lắp xoay so với hướng cắm. Không lệch thì để 0.
|
||||
|
||||
## 4. Dải phản quang
|
||||
|
||||
Mọi góc tường, mọi góc pallet cũng là một chữ V. Hình học không phân biệt được chúng với trạm thật.
|
||||
Dải phản quang làm được, và không yếu đi theo tầm như hình học.
|
||||
|
||||

|
||||
|
||||
### 4.1 Chọn băng
|
||||
|
||||
Băng phản quang **lăng kính** (loại dán biển báo, thùng xe). Băng hạt thuỷ tinh mỏng hay giấy bạc
|
||||
phản xạ kém, khó tách khỏi nền.
|
||||
|
||||
### 4.2 Chiều cao
|
||||
|
||||

|
||||
|
||||
Lidar quét một mặt phẳng ngang. Đo `h_sensor`: từ sàn tới tâm cửa sổ quang của cảm biến (không phải
|
||||
đỉnh vỏ).
|
||||
|
||||
- Dải cao **≥ 10 cm** theo chiều đứng, tâm ở đúng `h_sensor`.
|
||||
- Robot chúi 1° làm mặt phẳng quét lệch ~2.6 cm ở cự ly 1.5 m. ±5 cm chịu được khoảng ±2°.
|
||||
- Dán từ sát sàn lên quá tầm cảm biến (như tấm mô phỏng) thì không cần đo `h_sensor` thật chính xác.
|
||||
|
||||
Không có khoá config nào cho chiều cao dải. Đây là ràng buộc lắp đặt.
|
||||
|
||||
### 4.3 Vị trí
|
||||
|
||||

|
||||
|
||||
- **Mỗi cánh một dải**, trên mặt lidar nhìn thấy (mục 1). Thiếu dải ở một cánh là ứng viên bị loại.
|
||||
Code chỉ lấy chuỗi tia sáng **dài nhất** trên mỗi cánh, nên dải thứ hai trên cùng cánh không giúp gì.
|
||||
- Vị trí dọc cánh **tuỳ ý**. Khuyên dán ở giữa cánh, cách đỉnh và mút ít nhất vài cm, hai bên đối
|
||||
xứng:
|
||||
- sát đỉnh: hai dải quá gần nhau, phân biệt kém;
|
||||
- sát mút: nhìn chếch là mút mất tia trước, bộ trích đoạn cũng hay bỏ vài tia ở đầu đoạn.
|
||||
- Dán phẳng, không phồng mép. Không để vật sáng khác trên cánh ở độ cao cảm biến.
|
||||
|
||||
### 4.4 `tape_width` — bề rộng dải
|
||||
|
||||
[m] Chiều dài thật của **một** dải, đo dọc theo cánh. **Phải khai đúng**: code đo chiều dài từng dải
|
||||
và so với `tape_width ± tape_width_tolerance`. Dải hẹp hơn hoặc rộng hơn khoảng đó bị loại. Dải chỉ
|
||||
trúng 1 tia (ở xa) thì bỏ qua phần kiểm này.
|
||||
|
||||
Dải càng hẹp thì càng ít tia trúng ở xa. Số tia trúng một dải:
|
||||
|
||||
```
|
||||
n ≈ tape_width · sin(vertex_angle / 2) / (tầm · angle_increment)
|
||||
```
|
||||
|
||||
Cần ít nhất 3 tia. Với V 90°, dải 0.12 m:
|
||||
|
||||
| Cảm biến | angle_increment | 1 m | 2 m | 3 m | Dải tối thiểu cho 3 tia ở 3 m |
|
||||
|---|---|---|---|---|---|
|
||||
| 1440 tia / 360° | 0.25° (0.004363 rad) | 19.4 | 9.7 | 6.5 | 5.6 cm |
|
||||
| nanoscan3 (sim) | 0.395° (0.00689 rad) | 12.3 | 6.2 | 4.1 | 8.8 cm |
|
||||
|
||||
**0.12 m** là lựa chọn an toàn cho cả hai và khớp mặc định. Dán dải rộng ra rẻ hơn nhiều so với
|
||||
chỉnh phần mềm.
|
||||
|
||||
### 4.5 `tape_spacing` — khoảng cách hai dải
|
||||
|
||||
[m] Khoảng cách **thẳng** giữa tâm hai dải (C₁, C₂ trong hình), đúng như lidar nhìn thấy từ trên
|
||||
xuống. Không đo vòng theo cánh qua đỉnh.
|
||||
|
||||
- **V lõm**: đường C₁–C₂ nằm ngoài không khí. Kéo thước thẳng đo trực tiếp. Tấm mô phỏng đo theo
|
||||
cách này: 0.1945 m.
|
||||
- **V lồi**: đường C₁–C₂ đi xuyên qua lòng V, sau hai tấm. Không kéo thước qua được. Đo `d₁`, `d₂`
|
||||
trên mặt ngoài, từ **mép đỉnh ngoài** tới tâm mỗi dải, rồi tính:
|
||||
|
||||
```
|
||||
tape_spacing = √( d₁² + d₂² − 2 · d₁ · d₂ · cos(vertex_angle) )
|
||||
vertex_angle = 90° ⇒ tape_spacing = √( d₁² + d₂² )
|
||||
```
|
||||
|
||||
| d₁ [m] | d₂ [m] | tape_spacing [m] (90°) |
|
||||
|---|---|---|
|
||||
| 0.155 | 0.155 | 0.219 |
|
||||
| 0.150 | 0.160 | 0.219 |
|
||||
| 0.120 | 0.120 | 0.170 |
|
||||
|
||||
Góc đỉnh lệch 5° làm số này đổi ~9 mm (với d = 0.155 m), vẫn trong dung sai. Đo từ mép đỉnh **ngoài**
|
||||
cho V lồi, vì hai mép đỉnh trong và ngoài lệch nhau đúng độ dày tấm.
|
||||
|
||||
Sau khi bật dải, handler in khoảng cách robot đo được (mục 7). Lệch số tính tay quá ~1 cm thì sửa
|
||||
config theo **số robot đo**, vì code so với đúng số đó.
|
||||
|
||||
### 4.6 Dung sai thực tế hẹp hơn số khai
|
||||
|
||||
Độ lệch kéo điểm tin xuống: điểm = 1 − |lệch| / dung sai, và điểm tin tổng lấy **mức thấp nhất** của
|
||||
mọi tiêu chí. Nên lệch phải dưới `(1 − min_confidence) × dung sai`:
|
||||
|
||||
| Khoá | Dung sai | `min_confidence` 0.4 | `min_confidence` 0.5 |
|
||||
|---|---|---|---|
|
||||
| `tape_spacing_tolerance` | 0.04 m | ≤ 2.4 cm | ≤ 2.0 cm |
|
||||
| `tape_width_tolerance` | 0.05 m | ≤ 3.0 cm | ≤ 2.5 cm |
|
||||
|
||||
Các ràng buộc kiểm lúc boot: mọi giá trị > 0, mỗi dung sai nhỏ hơn giá trị của chính nó,
|
||||
`tape_spacing ≤ 2 × wing_length`, `tape_width ≤ wing_length`, và không dùng với `pattern: arc`.
|
||||
|
||||
## 5. `tape_min_intensity` — ngưỡng cường độ
|
||||
|
||||
Đơn vị là thang **riêng của từng cảm biến**, không có chuẩn chung (Gazebo trả `laser_retro`, mỗi
|
||||
lidar thật một thang). Phải đo, không chép từ profile khác.
|
||||
|
||||
1. Đặt robot ở các chỗ sẽ bấm dò: gần, xa nhất dự kiến, và chếch ~30°.
|
||||
2. Đọc cường độ khi tia trúng dải, và khi trúng nền (mặt cánh, tường cạnh đó).
|
||||
|
||||
```bash
|
||||
rostopic echo -n1 /b_scan/intensities
|
||||
```
|
||||
|
||||
3. Đặt `tape_min_intensity` ở **khoảng giữa** giá trị nền cao nhất và giá trị dải thấp nhất.
|
||||
|
||||

|
||||
|
||||
4. Khoảng cách giữa hai giá trị quá hẹp (ví dụ nền 210, dải chỉ 255) thì đổi băng mạnh hơn. Đặt
|
||||
ngưỡng thấp quá là mọi bề mặt sáng đều thành dải; cao quá là dải bẩn hay nhìn chếch bị mất.
|
||||
|
||||
## 6. Khoá theo cảm biến, không theo trạm
|
||||
|
||||
Các khoá này nằm ngay dưới action, áp cho mọi profile.
|
||||
|
||||
| Khoá | Đơn vị | Mặc định | Dùng khi |
|
||||
|---|---|---|---|
|
||||
| `scan_topic` | — | — | Topic `LaserScan` có trong sensor store của nav core. |
|
||||
| `line_extraction/max_range` | m | 30.0 | **Giới hạn tầm tìm.** Tia xa hơn bị bỏ trước khi trích đoạn, nên vật ở xa không thành ứng viên. Đặt lớn hơn khoảng cách xa nhất mà robot bấm dò, cộng nửa chiều dài cánh. |
|
||||
| `line_extraction/min_range` | m | 0.05 | Bỏ tia trúng chính thân xe. |
|
||||
| `line_extraction/min_split_dist` | m | 0.04 | Đặt nhỏ hơn bề dày tấm thì hai mặt của một cánh bị tách thành hai đoạn. |
|
||||
| `line_extraction/max_line_gap` | m | 0.05 | Khe lớn hơn số này thì tách đoạn. |
|
||||
| `profiles/<tên>/search_fov` | rad | 0.0 | Nửa góc quạt quanh trục x của **cảm biến**. 0 = không giới hạn. Chỉ dùng khi robot luôn quay cùng một hướng về trạm lúc dò. |
|
||||
| `settle_delay` | s | 0.4 | Chờ xe đứng yên trước khi lấy mẫu. |
|
||||
| `timeout` | s | 15.0 | Phải lớn hơn `settle_delay + sample_window + hold_time`. |
|
||||
| `sample_window` | s | 1.0 | Cửa sổ trượt của bộ lọc mẫu. |
|
||||
| `min_samples` | mẫu | 5 | Đặt ≈ tần số dò × `sample_window` × 0.7. |
|
||||
| `max_spread_xy` | m | 0.03 | Độ tản tối đa (2 × phân vị 90) của vị trí đích trong cửa sổ. |
|
||||
| `max_spread_yaw` | rad | 0.05 | Như trên, cho góc. |
|
||||
| `jump_threshold` | m | 0.0 | Bật lọc cụm khi localization hay nhảy. 0 = tắt. |
|
||||
|
||||
`search_radius` chỉ có tác dụng khi có prior trong frame cảm biến, và hiện chưa khai được prior qua
|
||||
YAML. Đặt `search_radius` trong profile không đổi gì.
|
||||
|
||||
## 7. Mẫu profile
|
||||
|
||||
```yaml
|
||||
<tên_trạm>:
|
||||
pattern: v
|
||||
v_shape: any # any | convex | concave — mục 1
|
||||
vertex_angle: 1.5708 # [rad] góc giữa hai cánh tại đỉnh — mục 2
|
||||
wing_length: 0.31 # [m] mép đỉnh → mút cánh, mặt lidar thấy
|
||||
angle_tolerance: 0.20 # [rad] nới ra thì nhận thêm vật lạ
|
||||
length_tolerance: 0.06 # [m] phải < wing_length
|
||||
vertex_gap: 0.05 # [m] phải < wing_length
|
||||
min_wing_points: 5 # [tia] mỗi cánh
|
||||
min_confidence: 0.4 # [-] trong [0, 1]
|
||||
search_fov: 0.0 # [rad] 0 = không giới hạn quạt
|
||||
offset_x: 0.40 # [m] đỉnh → base_link ở vị trí sạc — mục 3
|
||||
offset_y: 0.0 # [m] trái là dương
|
||||
offset_yaw: 0.0 # [rad]
|
||||
tape_enabled: false # bật SAU khi đã đo tape_min_intensity — mục 5
|
||||
tape_spacing: 0.219 # [m] tâm–tâm, đường thẳng — mục 4.5
|
||||
tape_width: 0.12 # [m] một dải, dọc cánh — mục 4.4
|
||||
tape_spacing_tolerance: 0.04 # [m] phải < tape_spacing
|
||||
tape_width_tolerance: 0.05 # [m] phải < tape_width
|
||||
tape_min_intensity: 500 # [-] thang riêng của cảm biến, PHẢI ĐO
|
||||
```
|
||||
|
||||
Số trong mẫu chỉ là ví dụ cho một trạm V 90°, cánh 0.31 m. Comment trong YAML viết tiếng Việt, ghi
|
||||
đơn vị và hệ quả khi tăng/giảm.
|
||||
|
||||
## 8. Trạm máng cong (`pattern: arc`)
|
||||
|
||||
Máng cong ôm lấy robot (tâm đường tròn nằm phía robot). Dải phản quang và `v_shape` không dùng được
|
||||
với dạng này.
|
||||
|
||||

|
||||
|
||||
- **`arc_radius`** [m]: đo dây cung `c` (thẳng, giữa hai mép máng) và độ võng `s` (từ giữa dây cung
|
||||
vuông góc tới mặt máng):
|
||||
|
||||
```
|
||||
arc_radius = c² / (8 · s) + s / 2
|
||||
arc_span = 2 · asin( c / (2 · arc_radius) ) [rad]
|
||||
```
|
||||
|
||||
Công thức `arc_span` đúng khi máng không quá nửa vòng tròn (`s ≤ arc_radius`).
|
||||
|
||||
- **`arc_span`**: đặt bằng góc mở **thật**, không cộng dư. Sai yaw ≈ (arc_span − góc mở thấy được) / 2.
|
||||
- `arc_radius_tolerance`, `arc_span_tolerance`, `arc_min_span`, `arc_max_rms`, `arc_max_point_gap`,
|
||||
`min_arc_points`: xem comment ở `include/dock_pattern_detector/dock_profile.h` của
|
||||
`dock_pattern_detector`.
|
||||
|
||||
## 9. Kiểm trên robot
|
||||
|
||||
Sau khi sửa YAML, khởi động lại nav rồi dò một lần. Log của handler:
|
||||
|
||||
```text
|
||||
[dock_pattern] 'detect_lidar': detecting pattern 'v' (profile '<tên_trạm>', v_shape=convex) on '/b_scan' -> 'dock_target'.
|
||||
[dock_pattern] 'detect_lidar': reflective tape: 12 + 11 bright ray(s), spacing 0.221 m (profile 0.219+-0.040), widths 0.118 / 0.121 m (profile 0.120+-0.050).
|
||||
[move_base2] action '...-DetectCharger': 'dock_target' from 5 detection(s) of profile '<tên_trạm>' after 0.57 s
|
||||
```
|
||||
|
||||
- Dòng đầu xác nhận profile và `v_shape` đã nạp.
|
||||
- Dòng `reflective tape` (chỉ khi `tape_enabled`, in một lần mỗi lượt dò) cho số tia trúng mỗi dải,
|
||||
khoảng cách và chiều dài hai dải mà robot đo được. Khoảng cách lệch `tape_spacing` quá ~1 cm thì
|
||||
sửa theo số robot đo. Số trong ví dụ trên là minh hoạ.
|
||||
|
||||
Khi dò không ra, lý do trong log chỉ đúng cổng đã chặn:
|
||||
|
||||
| Log chứa | Nghĩa là | Xử trí |
|
||||
|---|---|---|
|
||||
| `wrong concave/convex orientation` | đúng hình, sai hướng | Sai `v_shape`, hoặc đó là vật khác. |
|
||||
| `not the reflective tape signature` | đúng hình, không có dải đúng chữ ký | Dán nhầm mặt, sai `tape_spacing`/`tape_width`, ngưỡng cường độ quá cao, hoặc đó là vật khác. Log kèm khoảng cách và số tia đo được. |
|
||||
| `no intensity data` | profile đòi dải, scan không có cường độ | Driver không publish `intensities`, hoặc tầng chuyển scan bỏ mất. |
|
||||
| `wrong wing length` | đúng góc, sai chiều dài | Sai `wing_length`, hoặc góc pallet. |
|
||||
| `wrong angle` | có đỉnh, sai góc | Sai `vertex_angle`, hoặc vật khác. |
|
||||
| `do not end at the crossing` | hai mặt cắt nhau ở xa | Không phải trạm. |
|
||||
| `need 2 line segments` | chỉ thấy một mặt | Một cánh bị che, đứng lệch, hoặc trạm ngoài `max_range`. |
|
||||
| `too few supporting rays` | ở quá xa hoặc quá chếch | Tiến lại gần, hoặc hạ `min_wing_points`. |
|
||||
| `outside the search gate` | đúng hình, ngoài quạt | Nới `search_fov`. Log in bearing của ứng viên. |
|
||||
| `detections unstable` | mẫu không chụm | Log in cửa sổ tốt nhất. Hai cụm cách xa nhau là có vật thứ hai giống trạm trong tầm. |
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] `pattern`, `v_shape` đúng với trạm.
|
||||
- [ ] `wing_length` đo trên mặt lidar thấy; `vertex_angle` tính từ khoảng cách hai mút.
|
||||
- [ ] `offset_x` đo khi robot đang ở vị trí sạc.
|
||||
- [ ] Mỗi cánh một dải, đúng mặt, phủ `h_sensor` ± 5 cm.
|
||||
- [ ] `tape_width` = chiều dài dải thật; `tape_spacing` tính từ d₁, d₂ (V lồi) hoặc đo thẳng (V lõm).
|
||||
- [ ] `tape_min_intensity` đo bằng cảm biến thật, ở giữa nền và dải.
|
||||
- [ ] `max_range` đủ xa cho vị trí bấm dò xa nhất.
|
||||
- [ ] Khởi động lại nav; log có `v_shape=...` và `reflective tape: ... spacing` khớp số đo.
|
||||
42
doc/fig/arc_measure.svg
Normal file
@@ -0,0 +1,42 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 340" width="640" height="340">
|
||||
<style>
|
||||
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
|
||||
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
|
||||
.mu { fill: #5a6b74; font-size: 12px; }
|
||||
.dt { fill: #0a7684; }
|
||||
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
|
||||
.cradle { stroke: #d27a24; stroke-width: 10; fill: none; stroke-linecap: round; }
|
||||
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
|
||||
.chord { stroke: #0a7684; stroke-width: 1.6; stroke-dasharray: 6 4; fill: none; }
|
||||
.rad { stroke: #5a6b74; stroke-width: 1.1; stroke-dasharray: 8 4; fill: none; }
|
||||
.dot { fill: #0a7684; }
|
||||
.lidar { fill: #42535e; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="640" height="340" fill="#ffffff"/>
|
||||
<text x="320" y="28" text-anchor="middle" class="mu">phía tường, sau máng</text>
|
||||
|
||||
<!-- máng cong, tâm đường tròn nằm phía robot -->
|
||||
<path d="M 151.47 158.58 A 220 220 0 0 1 488.53 158.58" class="cradle"/>
|
||||
|
||||
<line x1="151.47" y1="158.58" x2="488.53" y2="158.58" class="chord" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="320" y="178" text-anchor="middle" class="m dt halo">c (dây cung)</text>
|
||||
|
||||
<line x1="320" y1="158.58" x2="320" y2="85" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="330" y="126" class="m dt halo">s (độ võng)</text>
|
||||
|
||||
<circle cx="320" cy="300" r="4" class="dot"/>
|
||||
<text x="330" y="318" class="mu">tâm đường tròn (phía robot)</text>
|
||||
<line x1="320" y1="300" x2="484.5" y2="162" class="rad"/>
|
||||
<text x="420" y="246" text-anchor="middle" transform="rotate(-40 420 246)" class="m dt halo">arc_radius</text>
|
||||
<line x1="320" y1="300" x2="155.5" y2="162" class="rad"/>
|
||||
|
||||
<path d="M 289.36 274.29 A 40 40 0 0 1 350.64 274.29" class="dim"/>
|
||||
<text x="320" y="252" text-anchor="middle" class="m dt halo">arc_span</text>
|
||||
|
||||
<rect x="306" y="326" width="28" height="12" rx="3" class="lidar"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
65
doc/fig/dock_geometry.svg
Normal file
@@ -0,0 +1,65 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 610" width="640" height="610">
|
||||
<style>
|
||||
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
|
||||
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
|
||||
.mu { fill: #5a6b74; font-size: 12px; }
|
||||
.dt { fill: #0a7684; }
|
||||
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
|
||||
.wing { stroke: #d27a24; stroke-linecap: round; fill: none; }
|
||||
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
|
||||
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
|
||||
.axis { stroke: #5a6b74; stroke-width: 1; stroke-dasharray: 10 4 2 4; fill: none; }
|
||||
.robot { fill: none; stroke: #42535e; stroke-width: 1.6; }
|
||||
.rs { fill: #42535e; opacity: .07; }
|
||||
.lidar { fill: #42535e; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="640" height="610" fill="#ffffff"/>
|
||||
<text x="320" y="32" text-anchor="middle" class="mu">phía tường, sau trạm</text>
|
||||
<line x1="320" y1="128" x2="320" y2="604" class="axis"/>
|
||||
<text x="328" y="600" class="mu">phân giác</text>
|
||||
|
||||
<line x1="320" y1="210" x2="210.4" y2="100.4" class="wing" stroke-width="8"/>
|
||||
<line x1="320" y1="210" x2="429.6" y2="100.4" class="wing" stroke-width="8"/>
|
||||
|
||||
<path d="M 288.18 178.18 A 45 45 0 0 1 351.82 178.18" class="dim"/>
|
||||
<text x="320" y="142" text-anchor="middle" class="m dt halo">vertex_angle</text>
|
||||
<text x="320" y="158" text-anchor="middle" class="dt halo">θ</text>
|
||||
|
||||
<line x1="322.8" y1="212.8" x2="345.5" y2="235.5" class="ext"/>
|
||||
<line x1="432.4" y1="103.2" x2="455.1" y2="125.9" class="ext"/>
|
||||
<line x1="341.2" y1="231.2" x2="450.8" y2="121.6" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="407" y="187" text-anchor="middle" transform="rotate(-45 407 187)" class="m dt halo">wing_length</text>
|
||||
|
||||
<text x="530" y="66" text-anchor="middle" class="mu">ví dụ: V lồi, đỉnh chĩa về robot</text>
|
||||
|
||||
<rect x="147.5" y="247.5" width="345" height="325" rx="10" class="rs"/>
|
||||
<rect x="147.5" y="247.5" width="345" height="325" rx="10" class="robot"/>
|
||||
<text x="320" y="548" text-anchor="middle" class="mu">robot đang ở vị trí sạc (nhìn từ trên)</text>
|
||||
<rect x="307" y="249" width="26" height="16" rx="3" class="lidar"/>
|
||||
<text x="342" y="266" class="mu">cảm biến (frame của scan_topic)</text>
|
||||
<line x1="305" y1="410" x2="335" y2="410" class="dim"/>
|
||||
<line x1="320" y1="395" x2="320" y2="425" class="dim"/>
|
||||
<circle cx="320" cy="410" r="5" class="dim"/>
|
||||
<text x="342" y="414" class="m">base_link</text>
|
||||
|
||||
<line x1="330" y1="210" x2="568" y2="210" class="ext"/>
|
||||
<line x1="340" y1="410" x2="568" y2="410" class="ext"/>
|
||||
<line x1="560" y1="210" x2="560" y2="410" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="578" y="310" text-anchor="middle" transform="rotate(90 578 310)" class="m dt halo">offset_x</text>
|
||||
|
||||
<line x1="300" y1="210" x2="124" y2="210" class="ext"/>
|
||||
<line x1="307" y1="257" x2="124" y2="257" class="ext"/>
|
||||
<line x1="132" y1="210" x2="132" y2="257" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="124" y="248" text-anchor="end" class="m dt halo">d_sensor</text>
|
||||
<text x="124" y="232" text-anchor="end" class="mu halo">đỉnh → cảm biến</text>
|
||||
<line x1="305" y1="410" x2="124" y2="410" class="ext"/>
|
||||
<line x1="132" y1="257" x2="132" y2="410" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="124" y="324" text-anchor="end" class="m dt halo">s_x</text>
|
||||
<text x="124" y="340" text-anchor="end" class="mu halo">TF base_link</text>
|
||||
<text x="124" y="354" text-anchor="end" class="mu halo">→ cảm biến</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
79
doc/fig/dock_perspective.svg
Normal file
@@ -0,0 +1,79 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 500" width="640" height="500">
|
||||
<style>
|
||||
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
|
||||
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
|
||||
.mu { fill: #5a6b74; font-size: 12px; }
|
||||
.dt { fill: #0a7684; }
|
||||
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
|
||||
.faceL { fill: #e9a25f; stroke: #b9611a; stroke-width: 1.2; }
|
||||
.faceR { fill: #d27a24; stroke: #b9611a; stroke-width: 1.2; }
|
||||
.tape { fill: url(#h); stroke: #5d6b73; stroke-width: 1.2; }
|
||||
.floor { fill: #eef2f3; stroke: #c7d2d7; stroke-width: 1; }
|
||||
.scanline { stroke: #0a7684; stroke-width: 1.6; stroke-dasharray: 7 4; fill: none; }
|
||||
.ray { stroke: #0a7684; stroke-width: 1.1; stroke-dasharray: 4 3; opacity: .8; }
|
||||
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
|
||||
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
|
||||
.leader { stroke: #5a6b74; stroke-width: .9; fill: none; }
|
||||
.lidar { fill: #42535e; }
|
||||
.robot { fill: #42535e; opacity: .10; stroke: #42535e; stroke-width: 1.2; }
|
||||
</style>
|
||||
<defs>
|
||||
<pattern id="h" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
||||
<rect width="5" height="5" fill="#f4f7f8"/>
|
||||
<line x1="0" y1="0" x2="0" y2="5" stroke="#7d8b93" stroke-width="1.4"/>
|
||||
</pattern>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="640" height="500" fill="#ffffff"/>
|
||||
|
||||
<!-- sàn -->
|
||||
<polygon points="40,330 300,410 600,380 600,300 340,240 40,280" class="floor"/>
|
||||
<text x="80" y="340" class="mu">sàn</text>
|
||||
|
||||
<!-- hai mặt ngoài của trạm V lồi, đỉnh chĩa về phía người xem / robot -->
|
||||
<polygon points="300,360 129.2,314 129.2,44 300,90" class="faceL"/>
|
||||
<polygon points="300,360 392,314 392,44 300,90" class="faceR"/>
|
||||
|
||||
<!-- vết mặt phẳng quét trên hai mặt -->
|
||||
<line x1="300" y1="210" x2="129.2" y2="164" class="scanline"/>
|
||||
<line x1="300" y1="210" x2="392" y2="164" class="scanline"/>
|
||||
|
||||
<!-- hai dải phản quang, tâm ở giữa cánh, phủ mặt phẳng quét -->
|
||||
<polygon points="247.6,225.9 181.4,208.1 181.4,148.1 247.6,165.9" class="tape"/>
|
||||
<polygon points="328.2,225.9 363.8,208.1 363.8,148.1 328.2,165.9" class="tape"/>
|
||||
|
||||
<!-- robot (một phần) và cảm biến -->
|
||||
<polygon points="360,470 470,500 640,470 640,410 520,384 380,414" class="robot"/>
|
||||
<rect x="380" y="404" width="22" height="16" rx="3" class="lidar"/>
|
||||
<line x1="391" y1="410" x2="214.5" y2="187" class="ray"/>
|
||||
<line x1="391" y1="410" x2="346" y2="187" class="ray"/>
|
||||
<text x="410" y="446" class="mu">robot, cảm biến ở độ cao h_sensor</text>
|
||||
|
||||
<!-- chú thích -->
|
||||
<line x1="150" y1="108" x2="200" y2="160" class="leader"/>
|
||||
<text x="150" y="102" text-anchor="middle">dải trái</text>
|
||||
<line x1="470" y1="156" x2="358" y2="170" class="leader"/>
|
||||
<text x="530" y="148" text-anchor="middle">dải phải</text>
|
||||
<text x="530" y="166" text-anchor="middle" class="mu">mặt ngoài, mỗi cánh 1 dải</text>
|
||||
<text x="300" y="380" text-anchor="middle" class="mu">đỉnh (cạnh đứng gần robot nhất)</text>
|
||||
|
||||
<line x1="129.2" y1="164" x2="62" y2="164" class="ext"/>
|
||||
<line x1="129.2" y1="314" x2="62" y2="314" class="ext"/>
|
||||
<line x1="70" y1="314" x2="70" y2="164" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="58" y="244" text-anchor="middle" transform="rotate(-90 58 244)" class="m dt halo">h_sensor</text>
|
||||
|
||||
<line x1="181.4" y1="148.1" x2="164" y2="148.1" class="ext"/>
|
||||
<line x1="181.4" y1="208.1" x2="164" y2="208.1" class="ext"/>
|
||||
<line x1="170" y1="148.1" x2="170" y2="208.1" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="158" y="183" text-anchor="end" class="dt halo">≥ 10 cm</text>
|
||||
|
||||
<line x1="300" y1="90" x2="300" y2="68" class="ext"/>
|
||||
<line x1="392" y1="44" x2="392" y2="22" class="ext"/>
|
||||
<line x1="300" y1="74" x2="392" y2="28" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="350" y="44" text-anchor="middle" transform="rotate(-26.6 350 44)" class="m dt halo">wing_length</text>
|
||||
|
||||
<text x="510" y="262" text-anchor="middle" class="mu">nét đứt trên mặt cánh:</text>
|
||||
<text x="510" y="278" text-anchor="middle" class="mu">nơi mặt phẳng quét cắt qua</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
48
doc/fig/dock_shape.svg
Normal file
@@ -0,0 +1,48 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 236" width="640" height="236">
|
||||
<style>
|
||||
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
|
||||
.mu { fill: #5a6b74; font-size: 12px; }
|
||||
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
|
||||
.wt { fill: #b9611a; font-weight: bold; }
|
||||
.wing { stroke: #d27a24; stroke-linecap: round; fill: none; }
|
||||
.tape { fill: url(#h); stroke: #7d8b93; stroke-width: 1; }
|
||||
.fan { stroke: #0a7684; stroke-width: .9; opacity: .6; }
|
||||
.robot { fill: none; stroke: #42535e; stroke-width: 1.6; }
|
||||
.lidar { fill: #42535e; }
|
||||
.divider { stroke: #c7d2d7; stroke-width: 1; }
|
||||
</style>
|
||||
<defs>
|
||||
<pattern id="h" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
||||
<rect width="6" height="6" fill="#dfe5e8"/>
|
||||
<line x1="0" y1="0" x2="0" y2="6" stroke="#7d8b93" stroke-width="1.6"/>
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect width="640" height="236" fill="#ffffff"/>
|
||||
<line x1="320" y1="36" x2="320" y2="226" class="divider"/>
|
||||
<text x="160" y="24" text-anchor="middle" class="wt">V lồi — v_shape: convex</text>
|
||||
<text x="480" y="24" text-anchor="middle" class="wt">V lõm — v_shape: concave</text>
|
||||
|
||||
<line x1="160" y1="150" x2="86" y2="76" class="wing" stroke-width="8"/>
|
||||
<line x1="160" y1="150" x2="234" y2="76" class="wing" stroke-width="8"/>
|
||||
<polygon points="133.13,128.79 107.67,103.33 104.14,106.86 129.6,132.32" class="tape"/>
|
||||
<polygon points="186.87,128.79 212.33,103.33 215.86,106.86 190.4,132.32" class="tape"/>
|
||||
<line x1="160" y1="185" x2="118" y2="119" class="fan"/>
|
||||
<line x1="160" y1="185" x2="202" y2="119" class="fan"/>
|
||||
<rect x="120" y="185" width="80" height="26" rx="4" class="robot"/>
|
||||
<circle cx="160" cy="187" r="4" class="lidar"/>
|
||||
<text x="160" y="203" text-anchor="middle" class="mu">robot</text>
|
||||
<text x="160" y="172" text-anchor="middle" class="mu halo">đỉnh gần robot nhất</text>
|
||||
<text x="160" y="230" text-anchor="middle">dải dán MẶT NGOÀI</text>
|
||||
|
||||
<line x1="480" y1="70" x2="406" y2="144" class="wing" stroke-width="8"/>
|
||||
<line x1="480" y1="70" x2="554" y2="144" class="wing" stroke-width="8"/>
|
||||
<polygon points="458.79,96.87 433.33,122.33 436.86,125.86 462.32,100.4" class="tape"/>
|
||||
<polygon points="501.21,96.87 526.67,122.33 523.14,125.86 497.68,100.4" class="tape"/>
|
||||
<line x1="480" y1="185" x2="448" y2="112" class="fan"/>
|
||||
<line x1="480" y1="185" x2="512" y2="112" class="fan"/>
|
||||
<rect x="440" y="185" width="80" height="26" rx="4" class="robot"/>
|
||||
<circle cx="480" cy="187" r="4" class="lidar"/>
|
||||
<text x="480" y="203" text-anchor="middle" class="mu">robot</text>
|
||||
<text x="480" y="172" text-anchor="middle" class="mu halo">mút cánh gần robot</text>
|
||||
<text x="480" y="230" text-anchor="middle">dải dán MẶT TRONG</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
113
doc/fig/intensity_profile.svg
Normal file
@@ -0,0 +1,113 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 330" width="640" height="330">
|
||||
<style>
|
||||
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
|
||||
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
|
||||
.mu { fill: #5a6b74; font-size: 12px; }
|
||||
.dt { fill: #0a7684; }
|
||||
.wr { fill: #b0451a; }
|
||||
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
|
||||
.grid { stroke: #e3e8ea; stroke-width: 1; }
|
||||
.axis { stroke: #5a6b74; stroke-width: 1.2; }
|
||||
.bar-bg { fill: #c3ccd1; }
|
||||
.bar-wing { fill: #e9a25f; }
|
||||
.bar-tape { fill: #7d8b93; }
|
||||
.lvl { stroke: #5a6b74; stroke-width: 1.1; stroke-dasharray: 5 4; }
|
||||
.thr { stroke: #0a7684; stroke-width: 2; }
|
||||
.brk { stroke: #5a6b74; stroke-width: 1; fill: none; }
|
||||
</style>
|
||||
<rect width="640" height="330" fill="#ffffff"/>
|
||||
<line x1="70" y1="250.0" x2="600" y2="250.0" class="grid"/>
|
||||
<text x="64" y="254.0" text-anchor="end" class="mu">0</text>
|
||||
<line x1="70" y1="197.5" x2="600" y2="197.5" class="grid"/>
|
||||
<text x="64" y="201.5" text-anchor="end" class="mu">250</text>
|
||||
<line x1="70" y1="145.0" x2="600" y2="145.0" class="grid"/>
|
||||
<text x="64" y="149.0" text-anchor="end" class="mu">500</text>
|
||||
<line x1="70" y1="92.5" x2="600" y2="92.5" class="grid"/>
|
||||
<text x="64" y="96.5" text-anchor="end" class="mu">750</text>
|
||||
<line x1="70" y1="40.0" x2="600" y2="40.0" class="grid"/>
|
||||
<text x="64" y="44.0" text-anchor="end" class="mu">1000</text>
|
||||
<rect x="71.0" y="235.3" width="6.8" height="14.7" class="bar-bg"/>
|
||||
<rect x="79.8" y="232.2" width="6.8" height="17.8" class="bar-bg"/>
|
||||
<rect x="88.7" y="237.4" width="6.8" height="12.6" class="bar-bg"/>
|
||||
<rect x="97.5" y="230.1" width="6.8" height="19.9" class="bar-bg"/>
|
||||
<rect x="106.3" y="226.9" width="6.8" height="23.1" class="bar-bg"/>
|
||||
<rect x="115.2" y="233.2" width="6.8" height="16.8" class="bar-bg"/>
|
||||
<rect x="124.0" y="234.2" width="6.8" height="15.8" class="bar-bg"/>
|
||||
<rect x="132.8" y="231.1" width="6.8" height="18.9" class="bar-bg"/>
|
||||
<rect x="141.7" y="218.5" width="6.8" height="31.5" class="bar-wing"/>
|
||||
<rect x="150.5" y="215.3" width="6.8" height="34.7" class="bar-wing"/>
|
||||
<rect x="159.3" y="212.2" width="6.8" height="37.8" class="bar-wing"/>
|
||||
<rect x="168.2" y="210.1" width="6.8" height="39.9" class="bar-wing"/>
|
||||
<rect x="177.0" y="213.2" width="6.8" height="36.8" class="bar-wing"/>
|
||||
<rect x="185.8" y="206.9" width="6.8" height="43.1" class="bar-wing"/>
|
||||
<rect x="194.7" y="69.4" width="6.8" height="180.6" class="bar-tape"/>
|
||||
<rect x="203.5" y="58.9" width="6.8" height="191.1" class="bar-tape"/>
|
||||
<rect x="212.3" y="52.6" width="6.8" height="197.4" class="bar-tape"/>
|
||||
<rect x="221.2" y="49.4" width="6.8" height="200.6" class="bar-tape"/>
|
||||
<rect x="230.0" y="54.7" width="6.8" height="195.3" class="bar-tape"/>
|
||||
<rect x="238.8" y="50.5" width="6.8" height="199.5" class="bar-tape"/>
|
||||
<rect x="247.7" y="61.0" width="6.8" height="189.0" class="bar-tape"/>
|
||||
<rect x="256.5" y="67.3" width="6.8" height="182.7" class="bar-tape"/>
|
||||
<rect x="265.3" y="208.0" width="6.8" height="42.0" class="bar-wing"/>
|
||||
<rect x="274.2" y="211.2" width="6.8" height="38.8" class="bar-wing"/>
|
||||
<rect x="283.0" y="214.3" width="6.8" height="35.7" class="bar-wing"/>
|
||||
<rect x="291.8" y="216.4" width="6.8" height="33.6" class="bar-wing"/>
|
||||
<rect x="300.7" y="212.2" width="6.8" height="37.8" class="bar-wing"/>
|
||||
<rect x="309.5" y="218.5" width="6.8" height="31.5" class="bar-wing"/>
|
||||
<rect x="318.3" y="210.1" width="6.8" height="39.9" class="bar-wing"/>
|
||||
<rect x="327.2" y="205.9" width="6.8" height="44.1" class="bar-wing"/>
|
||||
<rect x="336.0" y="209.1" width="6.8" height="40.9" class="bar-wing"/>
|
||||
<rect x="344.8" y="211.2" width="6.8" height="38.8" class="bar-wing"/>
|
||||
<rect x="353.7" y="217.4" width="6.8" height="32.6" class="bar-wing"/>
|
||||
<rect x="362.5" y="213.2" width="6.8" height="36.8" class="bar-wing"/>
|
||||
<rect x="371.3" y="210.1" width="6.8" height="39.9" class="bar-wing"/>
|
||||
<rect x="380.2" y="208.0" width="6.8" height="42.0" class="bar-wing"/>
|
||||
<rect x="389.0" y="212.2" width="6.8" height="37.8" class="bar-wing"/>
|
||||
<rect x="397.8" y="214.3" width="6.8" height="35.7" class="bar-wing"/>
|
||||
<rect x="406.7" y="65.2" width="6.8" height="184.8" class="bar-tape"/>
|
||||
<rect x="415.5" y="55.8" width="6.8" height="194.2" class="bar-tape"/>
|
||||
<rect x="424.3" y="51.6" width="6.8" height="198.4" class="bar-tape"/>
|
||||
<rect x="433.2" y="48.4" width="6.8" height="201.6" class="bar-tape"/>
|
||||
<rect x="442.0" y="53.7" width="6.8" height="196.3" class="bar-tape"/>
|
||||
<rect x="450.8" y="57.8" width="6.8" height="192.2" class="bar-tape"/>
|
||||
<rect x="459.7" y="63.1" width="6.8" height="186.9" class="bar-tape"/>
|
||||
<rect x="468.5" y="69.4" width="6.8" height="180.6" class="bar-tape"/>
|
||||
<rect x="477.3" y="211.2" width="6.8" height="38.8" class="bar-wing"/>
|
||||
<rect x="486.2" y="214.3" width="6.8" height="35.7" class="bar-wing"/>
|
||||
<rect x="495.0" y="209.1" width="6.8" height="40.9" class="bar-wing"/>
|
||||
<rect x="503.8" y="216.4" width="6.8" height="33.6" class="bar-wing"/>
|
||||
<rect x="512.7" y="218.5" width="6.8" height="31.5" class="bar-wing"/>
|
||||
<rect x="521.5" y="220.6" width="6.8" height="29.4" class="bar-wing"/>
|
||||
<rect x="530.3" y="230.1" width="6.8" height="19.9" class="bar-bg"/>
|
||||
<rect x="539.2" y="233.2" width="6.8" height="16.8" class="bar-bg"/>
|
||||
<rect x="548.0" y="226.9" width="6.8" height="23.1" class="bar-bg"/>
|
||||
<rect x="556.8" y="235.3" width="6.8" height="14.7" class="bar-bg"/>
|
||||
<rect x="565.7" y="232.2" width="6.8" height="17.8" class="bar-bg"/>
|
||||
<rect x="574.5" y="237.4" width="6.8" height="12.6" class="bar-bg"/>
|
||||
<rect x="583.3" y="231.1" width="6.8" height="18.9" class="bar-bg"/>
|
||||
<rect x="592.2" y="234.2" width="6.8" height="15.8" class="bar-bg"/>
|
||||
<line x1="70" y1="250" x2="600" y2="250" class="axis"/>
|
||||
<line x1="70" y1="40" x2="70" y2="250" class="axis"/>
|
||||
<text x="18" y="145.0" text-anchor="middle" transform="rotate(-90 18 145.0)" class="mu">intensity (thang của cảm biến)</text>
|
||||
<text x="600" y="270" text-anchor="end" class="mu">từng tia, quét ngang qua trạm →</text>
|
||||
|
||||
<line x1="70" y1="205.9" x2="600" y2="205.9" class="lvl"/>
|
||||
<line x1="70" y1="69.4" x2="600" y2="69.4" class="lvl"/>
|
||||
<line x1="70" y1="137.65" x2="600" y2="137.65" class="thr"/>
|
||||
<text x="600" y="199.9" text-anchor="end" class="mu halo">nền cao nhất ≈ 210</text>
|
||||
<text x="600" y="63.400000000000006" text-anchor="end" class="mu halo">dải thấp nhất ≈ 860</text>
|
||||
<text x="600" y="131.65" text-anchor="end" class="m dt halo">tape_min_intensity ≈ 535</text>
|
||||
|
||||
<path d="M 193.7 30 L 193.7 24 L 264.3 24 L 264.3 30" class="brk"/>
|
||||
<text x="229.0" y="18" text-anchor="middle" class="mu">dải trái: 8 tia</text>
|
||||
<path d="M 405.7 30 L 405.7 24 L 476.3 24 L 476.3 30" class="brk"/>
|
||||
<text x="441.0" y="18" text-anchor="middle" class="mu">dải phải: 8 tia</text>
|
||||
|
||||
<rect x="70" y="290" width="12" height="10" class="bar-bg"/>
|
||||
<text x="88" y="299" class="mu">tường, vật khác</text>
|
||||
<rect x="220" y="290" width="12" height="10" class="bar-wing"/>
|
||||
<text x="238" y="299" class="mu">mặt cánh</text>
|
||||
<rect x="330" y="290" width="12" height="10" class="bar-tape"/>
|
||||
<text x="348" y="299" class="mu">dải phản quang</text>
|
||||
<text x="70" y="320" class="wr">Số minh hoạ. Đo thang thật của cảm biến, không chép số này.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.3 KiB |
61
doc/fig/tape_height.svg
Normal file
@@ -0,0 +1,61 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 300" width="640" height="300">
|
||||
<style>
|
||||
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
|
||||
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
|
||||
.mu { fill: #5a6b74; font-size: 12px; }
|
||||
.dt { fill: #0a7684; }
|
||||
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
|
||||
.tape { fill: url(#h); stroke: #7d8b93; stroke-width: 1; }
|
||||
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
|
||||
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
|
||||
.robot { fill: none; stroke: #42535e; stroke-width: 1.6; }
|
||||
.rs { fill: #42535e; opacity: .07; }
|
||||
.lidar { fill: #42535e; }
|
||||
.wheel { fill: #ffffff; stroke: #42535e; stroke-width: 1.6; }
|
||||
.floor { stroke: #5a6b74; stroke-width: 1.6; }
|
||||
.scan { stroke: #0a7684; stroke-width: 1.4; stroke-dasharray: 8 5; }
|
||||
.fan { stroke: #0a7684; stroke-width: .9; opacity: .55; }
|
||||
.leader { stroke: #5a6b74; stroke-width: .9; fill: none; }
|
||||
</style>
|
||||
<defs>
|
||||
<pattern id="h" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
||||
<rect width="6" height="6" fill="#dfe5e8"/>
|
||||
<line x1="0" y1="0" x2="0" y2="6" stroke="#7d8b93" stroke-width="1.6"/>
|
||||
</pattern>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="640" height="300" fill="#ffffff"/>
|
||||
<line x1="20" y1="260" x2="620" y2="260" class="floor"/>
|
||||
<text x="24" y="282" class="mu">sàn</text>
|
||||
<rect x="40" y="140" width="230" height="110" rx="8" class="rs"/>
|
||||
<rect x="40" y="140" width="230" height="110" rx="8" class="robot"/>
|
||||
<circle cx="80" cy="250" r="14" class="wheel"/>
|
||||
<circle cx="230" cy="250" r="14" class="wheel"/>
|
||||
<text x="155" y="200" text-anchor="middle" class="mu">robot (nhìn ngang)</text>
|
||||
<rect x="262" y="190" width="22" height="20" rx="3" class="lidar"/>
|
||||
<text x="273" y="128" text-anchor="middle" class="mu">cảm biến</text>
|
||||
<line x1="273" y1="134" x2="273" y2="188" class="leader"/>
|
||||
|
||||
<line x1="284" y1="200" x2="423" y2="200" class="scan"/>
|
||||
<line x1="284" y1="200" x2="423" y2="191" class="fan"/>
|
||||
<line x1="284" y1="200" x2="423" y2="209" class="fan"/>
|
||||
<text x="345" y="244" text-anchor="middle" class="mu">robot chúi ±1° (phóng đại)</text>
|
||||
|
||||
<rect x="430" y="70" width="14" height="190" fill="#d27a24"/>
|
||||
<text x="437" y="60" text-anchor="middle" class="mu">tấm cánh (nhìn ngang)</text>
|
||||
<rect x="423" y="175" width="7" height="50" class="tape"/>
|
||||
<line x1="380" y1="122" x2="422" y2="178" class="leader"/>
|
||||
<text x="370" y="116" text-anchor="middle" class="mu">dải phản quang</text>
|
||||
|
||||
<line x1="448" y1="175" x2="470" y2="175" class="ext"/>
|
||||
<line x1="448" y1="225" x2="470" y2="225" class="ext"/>
|
||||
<line x1="462" y1="175" x2="462" y2="225" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="470" y="198" class="dt halo">≥ 10 cm</text>
|
||||
<text x="470" y="214" class="mu halo">h_sensor ± 5 cm</text>
|
||||
|
||||
<line x1="444" y1="200" x2="588" y2="200" class="ext"/>
|
||||
<line x1="580" y1="260" x2="580" y2="200" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="596" y="224" text-anchor="middle" transform="rotate(90 596 224)" class="m dt halo">h_sensor</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
61
doc/fig/tape_layout.svg
Normal file
@@ -0,0 +1,61 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 400" width="640" height="400">
|
||||
<style>
|
||||
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
|
||||
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
|
||||
.mu { fill: #5a6b74; font-size: 12px; }
|
||||
.dt { fill: #0a7684; }
|
||||
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
|
||||
.wing { stroke: #d27a24; stroke-linecap: round; fill: none; }
|
||||
.tape { fill: url(#h); stroke: #7d8b93; stroke-width: 1; }
|
||||
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
|
||||
.chord { stroke: #0a7684; stroke-width: 1.6; stroke-dasharray: 6 4; fill: none; }
|
||||
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
|
||||
.leader { stroke: #5a6b74; stroke-width: .9; fill: none; }
|
||||
.dot { fill: #0a7684; }
|
||||
</style>
|
||||
<defs>
|
||||
<pattern id="h" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
||||
<rect width="6" height="6" fill="#dfe5e8"/>
|
||||
<line x1="0" y1="0" x2="0" y2="6" stroke="#7d8b93" stroke-width="1.6"/>
|
||||
</pattern>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="640" height="400" fill="#ffffff"/>
|
||||
<line x1="320" y1="300" x2="122.7" y2="102.7" class="wing" stroke-width="10"/>
|
||||
<line x1="320" y1="300" x2="517.3" y2="102.7" class="wing" stroke-width="10"/>
|
||||
<text x="320" y="140" text-anchor="middle" class="mu">lòng V: khuất, thước không đi thẳng qua được</text>
|
||||
|
||||
<polygon points="255.99,243.08 179.64,166.72 175.40,170.96 251.76,247.32" class="tape"/>
|
||||
<polygon points="384.01,243.08 460.36,166.72 464.60,170.96 388.24,247.32" class="tape"/>
|
||||
<line x1="104" y1="128" x2="176" y2="166" class="leader"/>
|
||||
<text x="96" y="122" text-anchor="middle" class="mu">dải trái</text>
|
||||
<line x1="536" y1="128" x2="464" y2="166" class="leader"/>
|
||||
<text x="544" y="122" text-anchor="middle" class="mu">dải phải</text>
|
||||
|
||||
<line x1="213.58" y1="209.14" x2="426.42" y2="209.14" class="chord" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<circle cx="213.58" cy="209.14" r="3.5" class="dot"/>
|
||||
<circle cx="426.42" cy="209.14" r="3.5" class="dot"/>
|
||||
<text x="232" y="203" class="m dt halo">C₁</text>
|
||||
<text x="408" y="203" text-anchor="end" class="m dt halo">C₂</text>
|
||||
<text x="320" y="200" text-anchor="middle" class="m dt halo">tape_spacing</text>
|
||||
|
||||
<line x1="251.76" y1="247.32" x2="238.33" y2="260.75" class="ext"/>
|
||||
<line x1="175.40" y1="170.96" x2="161.97" y2="184.39" class="ext"/>
|
||||
<line x1="242.57" y1="256.51" x2="166.21" y2="180.15" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="196" y="227" text-anchor="middle" transform="rotate(45 196 227)" class="m dt halo">tape_width</text>
|
||||
|
||||
<line x1="316.46" y1="303.54" x2="280.4" y2="339.6" class="ext"/>
|
||||
<line x1="213.58" y1="209.14" x2="181.76" y2="240.96" class="ext"/>
|
||||
<line x1="284.64" y1="335.36" x2="186.0" y2="236.72" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="226" y="295" text-anchor="middle" transform="rotate(45 226 295)" class="m dt halo">d₁</text>
|
||||
|
||||
<line x1="323.54" y1="303.54" x2="359.6" y2="339.6" class="ext"/>
|
||||
<line x1="426.42" y1="209.14" x2="458.24" y2="240.96" class="ext"/>
|
||||
<line x1="355.36" y1="335.36" x2="454.0" y2="236.72" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
|
||||
<text x="414" y="295" text-anchor="middle" transform="rotate(-45 414 295)" class="m dt halo">d₂</text>
|
||||
|
||||
<text x="320" y="370" text-anchor="middle" class="mu">đỉnh ngoài</text>
|
||||
<text x="320" y="392" text-anchor="middle" class="mu">↓ phía robot</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.7 KiB |
@@ -242,9 +242,13 @@ public:
|
||||
filter_.reset();
|
||||
filter_.setLabels(scan_topic_, ctx_.global_frame);
|
||||
|
||||
robot::log_info("[dock_pattern] '%s': detecting pattern '%s' (profile '%s') on '%s' -> '%s'.",
|
||||
// v_shape in kèm: khoá này loại cả trạm thật khi đặt sai hướng, và dòng này là chỗ duy nhất
|
||||
// xác nhận được giá trị đã nạp mà không cần mở YAML trên robot.
|
||||
robot::log_info("[dock_pattern] '%s': detecting pattern '%s' (profile '%s', v_shape=%s) on "
|
||||
"'%s' -> '%s'.",
|
||||
name_.c_str(), dock_pattern_detector::toString(found->second.pattern),
|
||||
profile_name.c_str(), scan_topic_.c_str(), output_frame_.c_str());
|
||||
profile_name.c_str(), dock_pattern_detector::toString(found->second.v_shape),
|
||||
scan_topic_.c_str(), output_frame_.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -377,6 +381,16 @@ private:
|
||||
nh_param(p_nh, "angle_tolerance", profile.angle_tolerance);
|
||||
nh_param(p_nh, "length_tolerance", profile.length_tolerance);
|
||||
nh_param(p_nh, "vertex_gap", profile.vertex_gap);
|
||||
|
||||
std::string v_shape_name = dock_pattern_detector::toString(profile.v_shape);
|
||||
nh_param(p_nh, "v_shape", v_shape_name);
|
||||
if (!dock_pattern_detector::vShapeFromString(v_shape_name, profile.v_shape, error))
|
||||
{
|
||||
robot::log_error("[dock_pattern] '%s': profile '%s': %s", name_.c_str(),
|
||||
profile_name.c_str(), error.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
nh_param(p_nh, "search_radius", profile.search_radius);
|
||||
nh_param(p_nh, "search_fov", profile.search_fov);
|
||||
nh_param(p_nh, "offset_x", profile.offset_x);
|
||||
|
||||