The autonomous underwater vehicle (AUV), due to its flexibility, safety, and other characteristics, has been widely used in various marine applications such as underwater mapping, marine ecological monitoring and marine scientific. When navigating in complex and ever-changing ocean currents, one of the key challenges in AUV control is how to effectively avoid unknown obstacles such as sunken ships and reefs, and plan the route to reach the target point. In this paper, based on partially measured ocean current velocities, the Navier–Stokes equations (N–S equations) are used to characterize the ocean current velocities within a small-scale region. Furthermore, the improved artificial potential field method is used for path planning after integrating the velocity information. Simulation and experiments indicate that the proposed algorithm is better suited to complex marine environments.