State Diagram: TOP:checkforobstacle