I think that if you are trying to do distance calculations, the PulsedLight LIDAR-Lite module would be best. In our experiences it has been more accurate than an ultrasonic sensor, since it uses infrared lasers for distance measurement which are less susceptible to noise/environment variables than ultrasonic sensors.
http://www.robotshop.com/en/lidar-li...lsedlight.html
Here is our LIDAR code in java. We connected the sensor to the I2C port on the MXP since at the time, the RoboRio I2C port was broken. We borrowed the base of the code from
here and modified it a little.
HTH.