Automatic guidance of ships as a control problem