Avoiding collisions is an essential goal of the control system of autonomous vehicles. This paper presents a reactive algorithm for avoiding obstacles in a threedimensional space, and shows how the algorithm can be applied to an underactuated underwater vehicle. The algorithm is based on maintaining a constant avoidance angle to the obstacle, which ensures that a guaranteed minimum separation distance is achieved. The algorithm can thus be implemented without knowledge of the obstacle shape. The avoidance angle is designed to compensate for obstacle movement, and the flexibility of operating in 3D can be utilized to implement traffic rules or operational constraints. We exemplify this by incorporating safety constraints on the vehicle pitch and by making the vehicle seek to move behind the obstacle, while also minimizing the required control effort. The underactuation of the vehicle induces a sway and heave movement while turning. To avoid uncontrolled gliding into the obstacle, we account for this movement using a Flow frame controller, which controls the direction of the vehicleʼs velocity rather than just the pitch and yaw. We derive conditions under which it is ensured that the resulting maneuver is safe, and these results are verified trough simulations and through full-scale experiments on the Hugin HUS autonomous underwater vehicle. The latter demonstrates the performance of the proposed algorithm when applied to a case with unmodeled disturbances and sensor noise, and shows how the modular nature of the collision avoidance algorithm allows it to be applied on top of a commercial control system. 1 | INTRODUCTION Unmanned vehicles are often intended to operate with limited, delayed, or no human supervision. The environment they operate in can be dynamic or unknown, with only incomplete or partially erroneous a priori information available. This is often the scenario for autonomous underwater vehicles (AUVs), charged with exploration and mapping of the worldʼs oceans. The autonomous nature of AUV missions necessitates the ability to react to the environment, for example, to avoid collision with obstacles. The collision avoidance problem becomes particularly challenging if the vehicle is underactuated, as indeed many AUVs are. An underactuated vehicle is not able to control all degrees of freedom independently, and generally has second-order nonholonomic constraints, making it necessary to include the vehicle dynamics in the design and analysis of the control system (Pettersen & Egeland, 1996). In this paper, we present and analyze a collision avoidance algorithm called the constant avoidance angle algorithm, which we have implemented on a class of underactuated underwater vehicles.