Add a method to compute distances to obstacles.