localization-recovery

Diagnose and recover AMCL localization failures in ROS2 Nav2 robots.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill localization-recovery-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: localization-recovery
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/localization-recovery
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill localization-recovery-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rclpy.

What problem does it solve? Autonomous robots using AMCL can lose localization due to kidnapping, odometry spikes, symmetric environments, or map changes, causing navigation failures and collisions. This Skill provides systematic detection symptoms, root-cause analysis, and concrete recovery procedures to restore accurate pose estimation. ## Core Features & Use Cases - Failure Diagnosis: Identify localization loss from observable symptoms like erratic RViz jumps, costmap mismatches, TF timeouts, and rising AMCL covariance. - Three Recovery Strategies: Global re-localization via the /reinitialize_global_localization service, manual initial pose via RViz or the /initialpose topic, and navigating to geometrically distinctive landmarks. - Automated Monitoring: A Python covariance-monitoring node that watches /amcl_pose and triggers global re-localization when variance exceeds a threshold, plus Behavior Tree integration with spin-and-wait recovery subtrees. - Use Case: A warehouse robot's AMCL particles diverge after a wheel slip; the monitor node detects covariance above 0.5, calls global re-localization, spins the robot to gather scans, and navigation resumes once the filter reconverges. ## Quick Start Ask the AI to diagnose why the robot's position jumps erratically in RViz and set up automated AMCL covariance monitoring with global re-localization recovery.

Frequently Asked Questions about localization-recovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix AMCL localization failure in ROS2?

Call the /reinitialize_global_localization service to spread particles across the map, then move the robot for 10-30 seconds so AMCL reconverges from scan data. Alternatively, publish a known pose to /initialpose if you know the robot's approximate location.

How to detect when AMCL localization is lost?

Monitor the /amcl_pose topic's covariance matrix; large diagonal values at indices 0, 7, and 35 (x, y, yaw variance) indicate poor localization. Observable symptoms include erratic position jumps in RViz, costmap misalignment with walls, and TF timeout errors.

Why does AMCL lose localization in corridors?

Symmetric environments like parallel corridors produce identical laser scans at multiple locations, so particles split between competing hypotheses. Navigating to geometrically unique locations like corners or doorways forces particles to converge on the true pose.

How do I set the initial pose for AMCL programmatically?

Publish a PoseWithCovarianceStamped message to the /initialpose topic with frame_id 'map' and your estimated x, y, and orientation. The covariance values control particle spread; larger covariance means wider spread and slower but more robust convergence.

Can AMCL pose be restored after a robot reboot?

Yes, save the last known pose to a file on shutdown and load it on startup using AMCL's set_initial_pose and initial_pose parameters. This avoids cold-start global localization entirely, assuming the robot was not moved while powered off.