Recovery behavior

On this page 8

A recovery behavior is a predefined fallback maneuver that a mobile robot executes when its normal navigation pipeline can no longer make progress, for example when the planner finds no valid path or the robot stops moving for too long. In robotics, recovery behaviors belong to the Navigation stack and act as a safety net between routine motion and a call for human help.

Typical recovery behaviors include clearing the costmap, rotating in place, backing up a short distance and waiting for a dynamic obstacle to leave. They do not replace good planning; they handle the transient failures that every real robot meets in cluttered, changing environments.

How recovery behaviors are triggered

A recovery behavior starts when a failure detector concludes that the robot is stuck or that a planner has failed. The navigation system monitors several signals continuously and compares them with configured thresholds and timeouts, so that a brief hesitation does not trigger an unnecessary maneuver.

The most common trigger is a progress checker: if the robot has not moved more than a set distance, often 0.25 to 0.5 m, within a time window of 5 to 15 seconds, the controller reports failure. Other triggers are a global path planner failure, a local planner unable to compute velocity commands, and an oscillation detector that notices the robot turning back and forth without advancing.

The following table summarizes the usual failure signals and what each one usually indicates.

TriggerTypical conditionLikely cause
No progressLess than 0.5 m moved in 10 sBlocked corridor or narrow gap
Global planning failureNo path found to the goalPhantom obstacles in the costmap
Local control failureNo admissible velocity commandRobot footprint touching inflated cost
OscillationRepeated heading reversalsConflicting planner objectives
Localization doubtHigh pose covarianceFeatureless or changed surroundings
Common triggers for recovery behaviors

Standard types of recovery behavior

Most navigation frameworks ship a small library of simple, reversible maneuvers that are cheap to execute and unlikely to cause harm. Each one targets a specific failure mechanism, so a well-designed sequence tries them from the least to the most disruptive.

BehaviorWhat it doesProblem it addresses
Costmap clearingErases stale obstacle cells around the robotGhost obstacles from sensor noise
Spin in placeRotates the robot, often 90 to 360 degreesRefreshes sensor view and localization
Back upDrives straight backward 0.15 to 0.3 mFootprint too close to an obstacle
WaitPauses for a few secondsPeople or carts temporarily blocking the way
Assisted teleoperationHands control to a remote operatorSituations autonomy cannot resolve
Recovery behaviors and the problems they address

Costmap clearing is the most frequently used recovery, because many failures come from stale or false obstacle data rather than real blockages. Spinning helps a robot with a narrow sensor field of view rebuild its local map, and it also gives AMCL fresh scan data for re-localization.

Recovery logic in Nav2 and behavior trees

In modern frameworks, recovery behaviors are orchestrated by a behavior tree rather than hard-coded logic. In Nav2, the default navigation tree wraps path computation and path following in a RecoveryNode, which retries the main task after each recovery attempt and gives up after a configured number of retries, often six.

This structure provides escalation: the tree first clears the local and global costmaps, then spins, then waits, then backs up, and finally reports navigation failure to the application. The older ROS 1 move_base package followed a similar fixed sequence of conservative clearing, aggressive clearing and rotation.

  1. Retry planning after clearing local costmap data.
  2. Clear the global costmap and replan the full route.
  3. Spin to collect fresh sensor data around the robot.
  4. Wait for dynamic obstacles to move away.
  5. Back up and retry, then abort if all attempts fail.

A behavior tree makes the policy inspectable and configurable: engineers can reorder nodes, add context-specific recoveries or attach conditions, such as allowing a backup only when the rear sensors report free space.

Recovery behaviors are easy to confuse with obstacle avoidance and replanning, yet they operate at a different level. Obstacle avoidance adjusts motion continuously during normal operation, whereas a recovery behavior interrupts normal operation after a failure has been declared.

MechanismWhen it actsScope
Recovery behaviorAfter a declared failureDiscrete fallback maneuver
Obstacle avoidanceContinuously while movingLocal velocity adjustment
ReplanningPeriodically or on map changeNew global or local path
Emergency stopOn imminent collision or faultImmediate halt of all motion
Re-localizationWhen pose estimate is lostCorrection of robot position
How recovery behavior differs from neighboring concepts

The emergency stop is a safety function, often certified and implemented in hardware, while recovery behaviors are software heuristics with no safety rating. A recovery maneuver must therefore never be treated as a substitute for functional safety measures such as safety-rated laser scanners.

Designing and tuning recovery behaviors

Effective recovery design starts with failure data from real deployments. Logging every trigger, the recovery attempted and its outcome reveals which failures recur and which maneuvers actually resolve them, so that parameters are tuned on evidence rather than guesswork.

SituationRecommended settingReason
Crowded public spacesLong wait before other recoveriesPeople usually move away on their own
Narrow warehouse aislesShort backup with rear sensingSpinning may hit racks
Noisy depth sensorsFrequent local costmap clearingRemoves false obstacle marks
Differential drive robotSpin as early recoveryRotation in place is safe and cheap
Car-like robotBackup instead of spinIt cannot rotate in place
Tuning decisions for recovery behaviors

The robot kinematics strongly limit which recoveries are possible: an Ackermann vehicle planned with Hybrid A* cannot spin, so it relies on reversing maneuvers. Designers should also set a retry limit and a clear escalation path to robot fleet management or a human operator.

Limitations and common mistakes

Recovery behaviors mask underlying problems when they run too often. A robot that clears its costmap every few minutes probably has poorly tuned inflation, sensor noise or a bad map, and the correct fix lies in the root cause, not in more recoveries.

  • Blind backing up without rear sensors can cause collisions with people or objects.
  • Aggressive costmap clearing can erase real obstacles that sensors cannot currently see.
  • Endless retry loops waste battery and block other robots in shared spaces.
  • Spinning near shelves or walls can collide when the footprint is not circular.
  • Missing failure reporting hides recurring issues from operators and developers.

Recovery behaviors also cannot solve structural blockages, such as a closed door or a permanently relocated pallet. In such cases the robot should report failure promptly so that the global planner, a fleet manager or a person can choose a different route.

The short version

A recovery behavior is what a robot does when it gets stuck. Imagine walking into a crowded hallway and finding your way blocked. You might pause for a moment, look around, or step back to see another way through.

Robots do the same thing with a short list of simple escape moves: forget old obstacle data, turn around to look again, wait a few seconds, or reverse a little. If none of these moves works, the robot stops trying and asks for help instead of struggling forever.

Where it makes a difference

A hospital uses a differential drive delivery robot to carry medication between wards at night. In a corridor near the elevators, a cleaning cart and its operator often stand in the robot’s path, and the local planner reports no valid velocity command after about 10 seconds without progress.

The behavior tree first clears the local costmap, which removes stale marks left by the passing operator, and then waits 15 seconds because the deployment logs showed that most blockages in that corridor clear on their own. If the corridor is still blocked, the robot spins 180 degrees to refresh its view and replans.

After tuning the sequence this way, the team found that most stuck events resolved without human intervention, and the remaining cases were reported to the nursing station within two minutes instead of leaving the robot motionless and unnoticed.