Getting started with programming

Discussions about quadcopters/multi-rotors
Posts: 328
Joined: Mon Oct 27, 2014 2:55 am

Re: Getting started with programming

Post by whoenig »

Pixy seems to give you x and y coordinates for a trained object (like a crazyflie or a crazyflie equipped with a low-weight marker). However, for the full 3D position you would need to take the size into account (fairly inaccurate) or have two cameras.
Once you do get the 3D position of the flie it is really easy to hook that up to control it automatically. You essentially write a PID controller for roll, pitch, and thrust (assuming yaw stays constant). This would be less than 100 lines of python code.
For the thrust you could also rely on the on-board barometer (if you have the 10DOF version) and place the camera on the floor facing upwards or ceiling facing downwards. That way, you would only need one camera and limit the controlling to roll and pitch.
Post Reply