— Autonomous navigation of an unmanned aerial vehicle (UAV) can be achieved with a reactive system which allows the robot to overcome all the unexpected changes in its environment. In this article, we propose a new approach to avoid frontal obstacles using known properties of the optical flow and by taking advantage of the capability of stationary flight of the rotorcraft. A state machine is proposed as a solution to equip the UAV with all reactions necessary for indoor navigation. We show how smooth transitions can be achieved by decreasing the speed of the vehicle proportional to the distance to an obstacle and by brief instants of hovering flight. Each stage of our algorithm has been tested in a mobile robot.