How to mesure the height of an object ?

Hello ;

I’m a part of an engineering project called mars rover (not really a mars rover but just a prototype, it wont go to mars )

so i need a way to mesure the height of an obstcale using sensors (IR or Ultrasonic) ?

if this osbstacle was above 10 cm the mars rover will look for another route , if it is under 10 cm it will climb this obstacle.

i found that using a camera and an obstcale sensor could be a solution ,but the problem is how i’m gonna
work this solution using an arduino board.

thanks ;

Use ping sensor on a servo that pans up & down. If you have distance from the ping sensor and the angle of measurement, you can calculate height. SOH-CAH-TOA, basic geometry. Just use the camera to determine where ping sensor is pointing. Laser sensor for airless environments.

Or simply a bumper on the from of the rover at 10cm. If it hits something it stops and finds another route.

There aren't landmines on mars, gently bumping into obstacles won't hurt your rover.

thanks for your replies i will try using the 2 methodes

ultrasonic on a servo
set it straight forward, when detecting an object move serv up, until object is gone, then use triangulation to measure the height.

OpenKinect library and a Kinect XBox 360?