Flying training droid that interacts with its opponent.
So first of all you can find the c# code of the project here:
So for the last part we needed a way to get an x,y,z coordinate. We had some idea's how but we ended with Stereo vision.
With just 2 motes we could calculate an x,y,z coordinate, since 2 lines in space intersect only trough one point.
This seemed to work great, we could track the copter easily when moved him slow, but when we triend it with the flying copter we saw that the motes where sometimes giving incorrect values causing our copter to crash.
With stereo vision there are 4 zones:
- First is outside everyones range, you don't want to be there
- Seccond is the blind spot (marked black). Like the first, you don't want to be there.
- Third is the gray area. This is the field where you are seen by only one mote. This could be used to get you back to forth place, since we have a clue of where you are.
- Last is the light gray area, this is where we have stereo vision.
Since the motes are on one line we can say that the y value are the same, practical we take the average.
For the z and x value we use the x value off the motes and draw a mental line between the mote center and the point they see.
Those two lines intersect eachother and that intersection is our x and z value.
After some fine tuning of the PID's we could finally do some test with 2 axis control by the computer.
but first something about the progress of connecting everything.
1. connect the available WiiMotes.
Once there is a WiiMote connected you get the 2-axis representation of de the detected IR-lightsource on the right (the red dot). You also can put the wanted location on de grid by clicking it (the blue dot).
2. Connect to the RCremote.
On the left upper corner there is the connection panel to connect to the arduino that sends the pwm signal to the rc-remote.
3. adjusting pid gain value's
you can adjust the PID gains and min, max values realtime with the text boxes. The current output is also visible (value between 0 and 255).
So with 1 WiiMote we can determine the position of the quadcopter in 2-axis.
the other axes can still be controlled by the RC remote in the classic way.
Time for a little demo:
Wat is happening here is that the computer is adjusting the throttle (height) and the roll. (the orange propellers are the front.)