You give it some kind of sensor. When it finds something bigger than 3 m at a depth of more than 500 m you start following it. I'm not saying that's easy, but we have self-driving cars and we send robots to Mars (average distance 200 million km). I'm sure we could do it, if there was interest.