Obstacle avoidance is the set of strategies robots use to detect objects and move without crashing. This cheat sheet helps students compare sensor-based reactions, planned paths, and safety rules used in mobile robotics. It is useful for building robots with ultrasonic sensors, infrared sensors, cameras, bump switches, or LiDAR.
Students need these ideas to make robots move reliably in classrooms, competitions, and real-world spaces.
The core idea is to measure distance, decide whether the path is safe, and choose a new motion when an obstacle is too close. Simple robots often use threshold rules such as stop, turn, or slow down when distance falls below a set value. More advanced robots combine attractive forces toward a goal with repulsive forces away from obstacles.
Good obstacle avoidance also depends on sensor limits, update rate, turning radius, and safe stopping distance.
Key Facts
- A basic threshold rule is: if distance <= safe distance, then stop or turn; if distance > safe distance, then continue forward.
- Safe stopping distance can be estimated with d_stop = v x t_reaction + v^2 / (2a), where v is speed, t_reaction is response time, and a is braking deceleration.
- Sensor update rate matters because a robot moving at speed v travels distance = v x time between readings before it can react.
- A simple turn-away rule is: if left distance > right distance, turn left; if right distance > left distance, turn right.
- Potential field navigation uses F_total = F_goal + F_obstacles, where the goal attracts the robot and obstacles repel it.
- A bug algorithm follows a simple pattern: move toward the goal, trace around an obstacle when blocked, then leave the obstacle boundary when the goal path is clear.
- Path planning methods such as grid search choose a route through safe cells while avoiding cells marked as blocked or too close to obstacles.
- A safety margin should be larger than sensor error, robot width error, and stopping distance so the robot has room to avoid collisions.
Vocabulary
- Obstacle avoidance
- Obstacle avoidance is a robot behavior that detects objects and changes motion to prevent collisions.
- Safe distance
- Safe distance is the minimum allowed space between the robot and an object before the robot must slow, stop, or turn.
- Sensor noise
- Sensor noise is random or inaccurate variation in measurements that can make an object seem closer or farther than it really is.
- Reactive control
- Reactive control is a fast decision method where the robot responds directly to current sensor readings.
- Path planning
- Path planning is the process of finding a safe route from a starting point to a goal before or during movement.
- Potential field
- A potential field is a navigation method that treats the goal like an attractive force and obstacles like repulsive forces.
Common Mistakes to Avoid
- Setting the safe distance too small is wrong because the robot may not have enough space to stop after sensing an obstacle.
- Ignoring sensor blind spots is wrong because a robot can collide with objects that its sensors cannot detect from certain angles or distances.
- Using only one sensor reading is risky because sensor noise can cause false stops or false clear paths; averaging or checking repeated readings improves reliability.
- Driving too fast for the sensor update rate is wrong because the robot may travel a large distance before it receives and processes the next measurement.
- Turning randomly without checking open space is inefficient because the robot may turn toward another obstacle instead of choosing the clearer direction.
Practice Questions
- 1 A robot moves at 0.50 m/s and its control loop updates every 0.20 s. How far does the robot travel between sensor readings?
- 2 A robot has v = 1.2 m/s, t_reaction = 0.25 s, and braking deceleration a = 2.0 m/s^2. Use d_stop = v x t_reaction + v^2 / (2a) to estimate its stopping distance.
- 3 An ultrasonic sensor reads 42 cm on the left and 25 cm on the right. If the robot uses the rule turn toward the larger distance, which way should it turn and why?
- 4 Explain why a robot that always turns right when blocked might get stuck in some environments, and name one strategy that could improve its behavior.