A thermostat controls a whole house's temperature with no map, no plan, no memory. It follows one rule: too cold, turn on; warm enough, turn off — it just reacts to the reading in front of it, over and over. That's a reactive controller, and it's enough to hold a house steady for years.
Give the rover the same idea: if something's close ahead, steer; otherwise head for the goal. It never plans a route around the wall — it keeps reacting, and the route emerges. Later you'll teach it to plan; not yet. Master the reflex first.
A rule (if / else) reacts to what the sensor sees.