Stability criterion for a wall-following AUV