Using my device to estimate distance (something like MagicPlan)

Hi,
I want to develop an application that allows you to do the following:
1 - Hold your mobile camera in front of a wall (say we will ask the user to stand about 1 meter from the wall).
2 - Using the app you can draw some markers on the wall and be able to estimate the distance between them.

You can see this video to gain more clear idea: http://www.youtube.com/watch?v=0X-kmUhPC4Q
I want to do something just like the cones drawn on the floor and lines drawn between them.
Please note that the key problem here is the estimation of the distance between the cones (the app actually does that despite not being clear in the video).

I am using the GyroDroid plugin to get access to the device sensors.

So far I have done the following:

	void Update () {
// get the current rotation vector of the device
		currentRotation = SensorHelper.rotation;

		//float angle;
		//Vector3 axis;

// get the difference between the current rotation and the rotation recorded in the last frame
		Quaternion difference = Quaternion.Inverse(lastRotation) * currentRotation;
		//difference.ToAngleAxis(out angle, out axis);
		//Debug.Log("Difference: " + angle + ", " + axis.ToString());
// record current rotation to be used in the next frame
		lastRotation = currentRotation;
	}

Can I use the difference quaternion to estimate the distance covered by the camera?
Again I assume that the user stand about 1 meter in front of the wall.

I was thinking that getting the difference between 2 rotations I can get the angle offset between them. After getting the angle offset I can estimate the length of the triangle edge on the wall.

Any suggestions how to do this?

There are a few things you will have to keep in mind for solving your problem:
you need one known measurement to estimate all the other lines. E.g. one meter in the beginning or something like that; you can’ measure distances without at least one reference. Maybe “standing a meter away from the wall” will work, but I think it’s too rough.
After that, you can measure lines by assuming that all points lie on a plane (in MagicPlan: on the ground plane, for your problem: on a wall plane).

Mathematically you don’t need to calculate angle differences. You can just raycast to an imaginery plane (the virtual wall), set points there, and measure the actual distances between them. As I said, you need some point of reference (e.g. the height the mobile phone is hold, the distance of the first set point, …). I would probably go with: the user stands directly perpendicular to the wall, creates a first point, tells the program the distance to that point, and can afterwards create new points on the wall. Then the distance measurements should be as accurate as the reference measurement.