Obstacle avoidance is the navigation capability that lets a mobile robot detect objects in or near its path and change its motion in real time to prevent collisions, while still making progress toward its goal. In robotics navigation, it is the reactive, local layer that sits below global path planning: the planner chooses a route through the known map, and obstacle avoidance handles people, carts, doors and anything else the map did not contain.
The capability spans a spectrum from simple stop-and-wait behavior to methods that predict how moving obstacles will behave. Its quality decides whether a robot can operate smoothly in shared spaces or constantly halts, oscillates and blocks traffic.
How obstacle avoidance works in a navigation stack
Obstacle avoidance runs as a fast control loop, typically at 10 to 50 Hz, that turns current sensor data into a safe velocity command. Each cycle repeats the same three steps.
- Perceive: sensors such as 2D or 3D LiDAR, depth cameras, ultrasonic rangers or bumpers report nearby obstacles.
- Represent: detections are inserted into a local occupancy grid or costmap around the robot, often with obstacles inflated by the robot radius plus a safety margin.
- Decide and act: a local planner evaluates candidate motions against that representation and sends the best collision-free velocity to the motor controllers.
Obstacle avoidance depends on accurate localization, because the local representation must align with the global route, and it feeds back to path planning when the way is blocked long enough that a new global route is needed.
Main obstacle avoidance methods
Avoidance algorithms differ in how they model obstacles and how far ahead they look. Reactive methods are fast but short-sighted, while optimization-based methods look ahead at higher computational cost.
| Method | Core idea | Strength | Weakness |
|---|---|---|---|
| Bug algorithms | Follow obstacle boundaries until the goal line is clear | Simple, provably complete in 2D | Inefficient paths |
| Potential fields | Goal attracts, obstacles repel | Smooth and cheap | Local minima and oscillation in narrow passages |
| Vector field histogram | Choose open sectors in a polar histogram | Robust to sensor noise | Limited look-ahead |
| Dynamic window approach | Simulate reachable velocities over a short horizon | Respects acceleration limits | Can be trapped in U-shaped obstacles |
| Timed elastic band | Optimize a time-parameterized local trajectory | Smooth, time-aware paths | Higher computation and tuning effort |
| Model predictive control | Optimize motions with explicit constraints and predictions | Handles dynamics and moving obstacles | Needs a good model and solver |
Velocity-obstacle methods such as ORCA extend avoidance to moving agents by excluding velocities that would lead to a collision within a time horizon, which makes them popular for crowds and multi-robot fleets.
Key parameters and their trade-offs
Most avoidance behavior is controlled by a few parameters whose values reflect a trade-off between safety margin and mobility. Settings that feel safe in an open lab often make a robot unable to pass through real doorways.
| Parameter | Typical range | Effect of increasing it |
|---|---|---|
| Inflation radius | Robot radius plus 0.05 to 0.5 m | Safer clearance, but narrow passages close |
| Prediction horizon | 0.5 to 3 s | Earlier reactions, more computation |
| Control frequency | 10 to 50 Hz | Faster response to sudden obstacles |
| Maximum speed | 0.3 to 2 m/s indoors | Higher throughput, longer stopping distance |
| Obstacle clearing timeout | 0.5 to 5 s | Fewer ghost obstacles removed too early |
Stopping distance grows with the square of speed, so the sensor range and the processing latency must allow the robot to brake fully within the distance it can perceive. A slower robot with reliable sensing is often more productive than a fast one that stops constantly.
Obstacle avoidance compared with related navigation functions
Obstacle avoidance is frequently confused with path planning and with safety functions. The distinction lies in scope, time scale and certification.
| Function | Scope | Time scale | Purpose |
|---|---|---|---|
| Global path planning | Whole known map | Seconds to minutes | Find an efficient route to the goal |
| Obstacle avoidance | A few meters around the robot | Tens of milliseconds | Move safely along the route |
| Safety-rated stop | Protective fields near the robot | Milliseconds | Guarantee a stop, certified hardware |
| Collision detection | Contact or impact | After contact | Limit harm when avoidance fails |
For industrial mobile robots, safety-rated laser scanners and stop functions are separate from the navigation software and follow standards such as ISO 3691-4. Obstacle avoidance improves efficiency and comfort, but it is not a substitute for the certified safety layer.
Common problems and how to address them
Field problems in obstacle avoidance usually trace back to perception gaps or poorly matched parameters, not to the core algorithm.
- Invisible obstacles: glass doors, table tops and overhangs escape a planar LiDAR; add depth cameras or 3D sensing.
- Oscillation in corridors: opposing repulsive forces cause swaying; reduce gains or use trajectory optimization.
- Freezing robot problem: dense crowds leave no safe motion; prediction and social navigation models help.
- Ghost obstacles: stale costmap cells block paths; tune clearing and decay behavior.
- Local minima traps: dead ends need recovery behaviors or replanning by the global planner.
A non-technical view
Obstacle avoidance is what keeps a robot from bumping into things. The robot already knows its general route, like a person following directions to a meeting room. Obstacle avoidance handles the surprises along the way, such as a person stepping out of an office or a cart left in the hallway.
The robot looks around many times per second, notices anything in its way and slows down, steers around it or waits. Good avoidance feels smooth and polite, while poor avoidance makes a robot stop and hesitate all the time.
A concrete example
A hospital uses autonomous delivery robots to carry medication carts between the pharmacy and the wards. Each robot has a planar safety LiDAR, two depth cameras facing forward and downward, and a local planner running at 20 Hz with a 2-second prediction horizon.
Corridors are busy with staff, beds and wheelchairs. The team sets a maximum speed of 1 m/s in corridors and 0.5 m/s near ward entrances, and an inflation margin of 0.15 m so the robot can still pass through standard doorways. The depth cameras catch the overhanging edges of beds that the planar scanner misses. The robots complete their routes with few blocked trips, and when a corridor stays blocked for more than 30 seconds, the global planner selects an alternative route through a parallel hallway.