Camera controlled crazyflie

Firmware/software/electronics/mechanics
peterh
Beginner
Posts: 11
Joined: Sun Apr 12, 2015 8:21 am

Camera controlled crazyflie

Post by peterh »

Hi all,

Just wanna share with you guys, I have done a project using iMac's camera with OpenCV to control crazyflie's hovering(Thrust/Pitch/Roll). There are only three degree of freedom being controlled at the moment but the result is satisfying. check this out.https://www.youtube.com/watch?v=gfc48-1UA7w
niklas
Beginner
Posts: 2
Joined: Fri Apr 10, 2015 9:48 am

Re: Camera controlled crazyflie

Post by niklas »

Looks great !!!

Do you want to share the source code? would love to test it.
Do you try to control the z-depth from the camera somehow? Kinect 2 gives would give a good reading on the depth?
peterh
Beginner
Posts: 11
Joined: Sun Apr 12, 2015 8:21 am

Re: Camera controlled crazyflie

Post by peterh »

The code is not ready to be public yet, as I am still working on a better algorithm to track the file other than color detection. But I will definitely share my code once it is ready. Yes, I only use One camera to track it including depth calculation. I think kinecct will definitely give you better depth detection than I did. I think it is actually using two cameras.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Camera controlled crazyflie

Post by arnaud »

This is so great!

I have been meaning to try that for a while but never got the time. I can't wait for the code and to play with it.

I like the idea of the two camera: it would be cheaper and easier than a kinect (well easier for the hardware part, for the software you will need to calibrate a bit the setup I guess).

What is the framerate of the webcam, 30fps?
peterh
Beginner
Posts: 11
Joined: Sun Apr 12, 2015 8:21 am

Re: Camera controlled crazyflie

Post by peterh »

yes, fps is 29.97, I think higher frame rate is really significant to the performance of stabilization as the higher sampling rate gives better tracking result and responsive command sending to the flie
peterh
Beginner
Posts: 11
Joined: Sun Apr 12, 2015 8:21 am

Re: Camera controlled crazyflie

Post by peterh »

Here you go, for those whoever interested in this project I am sharing my code: https://bitbucket.org/flightdynamics/detection.git
and the latest video on youtube https://www.youtube.com/watch?v=gsH1JjfWzX0
deathbrad
Beginner
Posts: 4
Joined: Tue May 19, 2015 6:40 pm

Re: Camera controlled crazyflie

Post by deathbrad »

Hi,

I am trying to build project but I encounter some problems
Could you say what are your Xcode and Osx version ?

Thanks
peterh
Beginner
Posts: 11
Joined: Sun Apr 12, 2015 8:21 am

Re: Camera controlled crazyflie

Post by peterh »

Hi, I run it on Mac10.10 and Xcode 6.
deathbrad
Beginner
Posts: 4
Joined: Tue May 19, 2015 6:40 pm

Re: Camera controlled crazyflie

Post by deathbrad »

Hi

I get this error :

CFRadioController.h :
Lexical or Processor issue
"thread not found"
In the file include from /Users/.../flightdynamics/CameraDetection/CFRadioController.cpp:10:

I am running on OSX 10.10 and xcode 6.3.2
peterh
Beginner
Posts: 11
Joined: Sun Apr 12, 2015 8:21 am

Re: Camera controlled crazyflie

Post by peterh »

I think its to do with your firmware, This radio C+= library looks like it is not being actively maintained, if you are using crazyflie1.0 maybe fall back to old version firmware, I use late 2014 or early 2015 without problem.
Post Reply