Adaptive ship course-keeping system