Added distance calculation for obstacles detected