Lesson / Robotics

How Can a Robot Patrol Without Getting Stuck?

The patrol route works until somebody moves a box into it. Add a distance check, choose a recovery action, and make the robot test the route again instead of turning forever.

Lesson plan

  1. Make the normal route work

    Define a short patrol with a known start and stop rule.

  2. Add the obstacle question

    Choose the signal and condition that interrupt the patrol.

  3. Build recovery

    Record the new state, act, and read the sensor again.

  4. Set traps

    Test a corner, repeated obstacle, and recovery that might loop forever.

  5. Trace the feedback

    Show the sense-decide-act cycle and state one limit.

Learning goals

  • Combine a repeated patrol with sensor readings.
  • Use a condition to choose a correction.
  • Record the patrol's current state.
  • Test an obstacle at an awkward point in the route.
  • Trace the sense-decide-act loop.

Small examples

repeat patrol

continue along the route

if obstacle near

decide when the plan must change

turn and check again

measure after the correction

state = RECOVERING

record the current mode

Guided project

Robot Patrol Challenge

Patrol a route until an obstacle appears, then choose a response that does not involve turning forever in a corner.

Build This Project
Students build

A repeatable patrol, An obstacle signal, At least one response state, A correction and recheck.

Ideas in use

Loops, Sensors, Conditions, State, Feedback.

Finish line

A working version with a tested change, one repaired problem, and a clear explanation.

Teacher checkpoints

  1. 1The normal patrol route works.
  2. 2An obstacle causes a different action.
  3. 3The robot reads the sensor again after correcting.
  4. 4Recovery cannot become an endless turn.
  5. 5The student traces the sense-decide-act cycle.

Common mistakes

  • The patrol loop never reads the sensor.
  • One obstacle leaves the robot permanently in recovery mode.
  • The robot keeps turning without a new reading.
  • There is no rule for ending the patrol.

Optional challenges

LEVEL 1

Builder

  • Stop and signal at an obstacle.
LEVEL 2

Inventor

  • Try a second route after turning.
LEVEL 3

Boss Level

  • Track failed directions and choose a recovery state.

End-of-class demonstration

  1. What repeats during patrol?
  2. What does the system sense?
  3. Which condition changes the plan?
  4. How does it check the correction?
  5. What limit remains?