|
| 1 | +# Troubleshooting |
| 2 | + |
| 3 | +This guide covers the most common bringup failures reported in open issues |
| 4 | +[#70](https://github.com/rsasaki0109/lidar_localization_ros2/issues/70), |
| 5 | +[#35](https://github.com/rsasaki0109/lidar_localization_ros2/issues/35), |
| 6 | +[#43](https://github.com/rsasaki0109/lidar_localization_ros2/issues/43), and |
| 7 | +[#48](https://github.com/rsasaki0109/lidar_localization_ros2/issues/48). |
| 8 | + |
| 9 | +For frame-tree and TF questions, see [frame_contract.md](frame_contract.md). |
| 10 | +For open-issue triage, see [reliability_roadmap.md](reliability_roadmap.md). |
| 11 | + |
| 12 | +## Symptom: Node Starts But Pose Never Updates |
| 13 | + |
| 14 | +This is the most common "it launches but does not localize" pattern. |
| 15 | + |
| 16 | +### Minimum Bringup Checklist |
| 17 | + |
| 18 | +Work through these in order: |
| 19 | + |
| 20 | +1. **Map loaded** |
| 21 | + - `use_pcd_map:=true` with a valid `map_path`, or a `/map` publisher is running |
| 22 | + - log should show `Map Size <N>` with `N > 0` |
| 23 | +2. **Initial pose set** |
| 24 | + - publish `/initialpose` with `header.frame_id = map` |
| 25 | + - RViz **2D Pose Estimate** is the usual path; see [frame_contract.md](frame_contract.md) |
| 26 | +3. **LiDAR cloud arriving** |
| 27 | + - `ros2 topic hz <cloud_topic>` shows a steady rate |
| 28 | + - point cloud has `x`, `y`, `z` fields (`PointCloud2`) |
| 29 | +4. **Frames consistent** |
| 30 | + - `base_frame_id` matches your robot TF |
| 31 | + - lidar frame is reachable from `base_link` if TF is used |
| 32 | + |
| 33 | +Quick smoke: |
| 34 | + |
| 35 | +```bash |
| 36 | +source scripts/setup_local_env.sh |
| 37 | +ros2 launch lidar_localization_ros2 nav2_lidar_localization.launch.py \ |
| 38 | + map_path:=/absolute/path/to/map.ply \ |
| 39 | + cloud_topic:=/your/points |
| 40 | + |
| 41 | +# other terminal |
| 42 | +ros2 topic echo /alignment_status --once |
| 43 | +ros2 topic echo /pcl_pose --once |
| 44 | +ros2 run tf2_ros tf2_echo map base_link |
| 45 | +``` |
| 46 | + |
| 47 | +If `/pcl_pose` never updates, inspect `/alignment_status` next. |
| 48 | + |
| 49 | +## Reading `/alignment_status` |
| 50 | + |
| 51 | +Topic: `/alignment_status` (`diagnostic_msgs/msg/DiagnosticArray`) |
| 52 | + |
| 53 | +Each update publishes one status named `lidar_localization_ros2/alignment`. |
| 54 | +The `message` field is the primary reject reason. Key-value pairs carry context. |
| 55 | + |
| 56 | +### Startup flags (check first) |
| 57 | + |
| 58 | +| Key | Meaning when `false` | |
| 59 | +| --- | --- | |
| 60 | +| `map_received` | map not loaded yet; wait for `map_path` load or `/map` | |
| 61 | +| `initialpose_received` | no valid `/initialpose` in `map` frame yet | |
| 62 | + |
| 63 | +### Common `message` values |
| 64 | + |
| 65 | +| Message | Likely cause | What to try | |
| 66 | +| --- | --- | --- | |
| 67 | +| `ok` | last alignment accepted | localization is running | |
| 68 | +| `scan_missing_xyz_field` | cloud is not `PointCloud2` with x/y/z | fix driver conversion (common with custom lidar bridges) | |
| 69 | +| `filtered_scan_empty` | crop/range filter removed all points | check `min_scan_range` / `max_scan_range`, sensor FOV | |
| 70 | +| `local_map_crop_too_small` | predicted pose is outside local map crop | wrong initial pose or map frame offset; re-send `/initialpose` | |
| 71 | +| `registration_not_converged` | NDT/GICP did not converge | initial pose too far from truth; try closer seed | |
| 72 | +| `fitness_score_over_threshold_rejected` | match quality too poor | fix initial pose, map alignment, or sensor frame | |
| 73 | +| `fitness_score_over_threshold_consistency_recovered` | borderline reject overridden by consistency gate | monitor; may recover if environment is consistent | |
| 74 | +| `recovery_retry_from_last_pose_recovered` | retry from last good pose succeeded | transient glitch; usually OK | |
| 75 | +| `gtsam_update_rejected` / `ekf_update_rejected` | backend smoother rejected the update | often follows repeated measurement rejects | |
| 76 | + |
| 77 | +### Useful numeric keys |
| 78 | + |
| 79 | +| Key | How to use it | |
| 80 | +| --- | --- | |
| 81 | +| `fitness_score` | lower is better; compare to `effective_score_threshold` | |
| 82 | +| `consecutive_rejected_updates` | high streak means seed or map is wrong | |
| 83 | +| `seed_translation_since_accept_m` | large drift since last accept → open-loop problem | |
| 84 | +| `filtered_point_count` | very low → scan preprocessing or crop issue | |
| 85 | +| `reinitialization_requested` | `true` means node wants a new `/initialpose` | |
| 86 | + |
| 87 | +Watch live: |
| 88 | + |
| 89 | +```bash |
| 90 | +ros2 topic echo /alignment_status |
| 91 | +``` |
| 92 | + |
| 93 | +For benchmark runs, record diagnostics to CSV with `benchmark_diagnostic_recorder` |
| 94 | +(see [benchmarking.md](benchmarking.md)). |
| 95 | + |
| 96 | +## Symptom: Direct Positioning Got Stuck (#35) |
| 97 | + |
| 98 | +"Stuck" usually means repeated rejects, not a hung process. |
| 99 | + |
| 100 | +1. echo `/alignment_status` and note `message` + `consecutive_rejected_updates` |
| 101 | +2. if `fitness_score_over_threshold_rejected`: |
| 102 | + - re-check initial pose in RViz (roughly correct position and yaw) |
| 103 | + - confirm map and trajectory are in the same coordinate convention |
| 104 | +3. if `local_map_crop_too_small`: |
| 105 | + - initial pose is far from where scans actually are |
| 106 | + - or `local_map_radius` is too small for your map scale |
| 107 | +4. if `registration_not_converged`: |
| 108 | + - move initial pose closer manually, then let scan matching refine |
| 109 | + |
| 110 | +Do not expect automatic relocalization in v1.1 runtime; use a new `/initialpose` |
| 111 | +when `reinitialization_requested` stays true. |
| 112 | + |
| 113 | +## Symptom: Map Not Visible in RViz (#43, #48) |
| 114 | + |
| 115 | +Two different map paths exist: |
| 116 | + |
| 117 | +| Source | Topic / param | When it appears | |
| 118 | +| --- | --- | --- | |
| 119 | +| PCD/PLY file | `map_path` + `use_pcd_map:=true` | after node loads file; also publishes `/initial_map` | |
| 120 | +| External map server | `/map` subscription | when another node publishes the map | |
| 121 | + |
| 122 | +RViz tips: |
| 123 | + |
| 124 | +- set **Fixed Frame** to `map` |
| 125 | +- add **PointCloud2** display on `/initial_map` or `/map` depending on your launch |
| 126 | +- live localization cloud is separate from the static map topic |
| 127 | + |
| 128 | +If the map displays but localization fails, the issue is usually initial pose or |
| 129 | +scan frame mismatch, not map publishing. |
| 130 | + |
| 131 | +## Symptom: Pose Looks Offset From Reality (#44, #75) |
| 132 | + |
| 133 | +Separate these cases: |
| 134 | + |
| 135 | +1. **Consistent offset** (always wrong by ~same translation/rotation) |
| 136 | + - map build frame vs localization frame mismatch |
| 137 | + - initial pose yaw error |
| 138 | + - check map origin and `/initialpose` seed |
| 139 | +2. **Drift over time** |
| 140 | + - tuning / environment issue; see public benchmark limits in [benchmarking.md](benchmarking.md) |
| 141 | +3. **Jumps after rejects** |
| 142 | + - inspect `/alignment_status` reject streak before the jump |
| 143 | + |
| 144 | +Collect before filing an issue: |
| 145 | + |
| 146 | +- map format and `map_path` |
| 147 | +- `/initialpose` used |
| 148 | +- 3–5 `/alignment_status` samples around failure |
| 149 | +- `ros2 run tf2_ros tf2_echo map base_link` |
| 150 | + |
| 151 | +## Sensor-Specific Notes |
| 152 | + |
| 153 | +| Sensor / setup | Check | |
| 154 | +| --- | --- | |
| 155 | +| Livox MID-360 | [mid360_legged_jetson.md](mid360_legged_jetson.md), `check_mid360_legged_bringup.py` | |
| 156 | +| Ouster / Velodyne / RoboSense | set `cloud_topic` and lidar `frame_id` in launch YAML | |
| 157 | +| Nav2 full stack | need 3D map + 2D `map_yaml` + `odom -> base_link`; see README Nav2 section | |
| 158 | + |
| 159 | +## Crash / TF Issues (Sprint 1 fixes) |
| 160 | + |
| 161 | +| Symptom | Doc | |
| 162 | +| --- | --- | |
| 163 | +| RViz "No map frame" / 2D pose crash | [frame_contract.md](frame_contract.md) — TF now published on `/initialpose` | |
| 164 | +| `use_odom:=true` crash at startup | set `/initialpose` before odom integrates; use current `main` | |
| 165 | +| Strange odom TF tree | pick Mode A (`map->base_link`) or Mode B (`map->odom` + external odom) | |
| 166 | + |
| 167 | +## Still Stuck? |
| 168 | + |
| 169 | +1. run the public demo to verify your environment can reproduce a known-good path: |
| 170 | + |
| 171 | + ```bash |
| 172 | + source scripts/setup_local_env.sh |
| 173 | + scripts/run_public_demo.sh |
| 174 | + ``` |
| 175 | + |
| 176 | +2. open a GitHub issue with: |
| 177 | + - ROS distro |
| 178 | + - launch command |
| 179 | + - `/alignment_status` message and key values |
| 180 | + - whether `map_received` and `initialpose_received` are `true` |
0 commit comments