Quote:
|
Originally Posted by sparksandtabs
Why do you need the range finder?
If it is to find how far from the goal you are then there is an easier method. If you plan on using the CMU cam then have a constant in the program for the height of the light and then just derive the angle from the PWM signal of the servo. THen all you need is to do some trig 
|
Having the RC do trig calculations takes up a lot of time and might make the program very slow. Whats most of the time done to get around that is to store a table of essential trig values and just have the RC look the values whenever you need them. Now it becomes an O(1) operation and speeds up the code a lot.
But as you've probably guessed by now, you can't possibly store the sin/cos values of every angle so you must round your angles to the nearest 5 or 10 degrees, adding more error on top of whatever calculation you're already doing.
The ultra sound provides for a more accurate range measurement with minimal error.