Path planning, flow estimation, and dynamic control for underwater vehicles