Getting started with programming

Discussions about quadcopters/multi-rotors
szlztt
Beginner
Posts: 14
Joined: Thu Oct 30, 2014 8:10 pm

Getting started with programming

Post by szlztt »

Hello,

This is my very first post. I just assembled my Crazyflie and established a link ect. cf client works but I don't have a controller so I can't actually fly the quad yet.

I bought this project with the specific intent on learning to operate it using only programming script on my computer.n I just need to be pointed in the right direction.

Can someone please help me to do the following:

1) Where do I actually do the programming? I am pretty good with Arduino programming and I understand the IDE. I think I read that I need to load a Virtual machine or VM? Is the VM the actual Python programming environment?

2) Are there any example scripts that show the structure of the program that sends commands to the quad copter?

3) Probably most important; from where do I execute / upload that script? Is it through the cf client somehow or is it more complicated?

Thank you for your help.
beeedy
Beginner
Posts: 1
Joined: Mon Sep 15, 2014 6:19 pm

Re: Getting started with programming

Post by beeedy »

I am extremely interested in all this myself, and hope that someone is able to point us in the correct direction
whoenig
Expert
Posts: 328
Joined: Mon Oct 27, 2014 2:55 am

Re: Getting started with programming

Post by whoenig »

1) On your PC. You can write the code in any text editor - python does not need a compiler. There are also IDEs for python, e.g. PyCharm.
2) https://github.com/bitcraze/crazyflie-c ... r/examples
3) You run it using python, e.g. from a command prompt you can use "python script.py"
szlztt
Beginner
Posts: 14
Joined: Thu Oct 30, 2014 8:10 pm

Re: Getting started with programming

Post by szlztt »

whoenig

Thank you!

I will try to get started. I hope you can help with this if I get crossed up.

Which version of python should I download? 3.4.2 or 2.7.8?
whoenig
Expert
Posts: 328
Joined: Mon Oct 27, 2014 2:55 am

Re: Getting started with programming

Post by whoenig »

2.7.8
szlztt
Beginner
Posts: 14
Joined: Thu Oct 30, 2014 8:10 pm

Re: Getting started with programming

Post by szlztt »

OK Great!!

Got the the sample program "ramp" to work !

Thanks for your help.

Where now do I find the documentation that lets me learn how to implement the commands to get the crazyflie to fly??
whoenig
Expert
Posts: 328
Joined: Mon Oct 27, 2014 2:55 am

Re: Getting started with programming

Post by whoenig »

Cool! The API is documented in the wiki: http://wiki.bitcraze.se/projects:crazyf ... tils:pylib

Basically what you can do is setting roll, pitch, yaw, and thrust. If you want to do something more advanced (e.g. following waypoints) you will need external tracking (outdoors: GPS; indoors: Kinect-style camera).
szlztt
Beginner
Posts: 14
Joined: Thu Oct 30, 2014 8:10 pm

Re: Getting started with programming

Post by szlztt »

Excellent.

Between self teaching Python and using the "motor ramp" example that you have on line I was able to attache to the CF and get the motors to ramp. I also experimented with the thrust value and was able to get the CF to "hop" . I feel I can learn at a much faster pace if I could get some more comprehensive examples to study and some" one on one" help. Could you possibly direct me to a forum thread or an example of getting the CF to hover so I can lean the "control" aspects of writing the code? Has anyone out there written code that actually gets the CF to maneuver?
Thanks
whoenig
Expert
Posts: 328
Joined: Mon Oct 27, 2014 2:55 am

Re: Getting started with programming

Post by whoenig »

You need external feedback for any maneuvers, otherwise the flie will just start to drift anywhere (and it does that really fast!). Options include high speed cameras (PS3 Eye) or Depth Sensors (Kinect/ Xtion Pro). For the later one you can take a look here: forum.bitcraze.se/viewtopic.php?f=6&t=800. However, this is rather involved and not ideal to start learn programming.
szlztt
Beginner
Posts: 14
Joined: Thu Oct 30, 2014 8:10 pm

Re: Getting started with programming

Post by szlztt »

I recently purchased a camera called Pixy which is easy to get up and running. I have only "taught" it one or two colors then got side tracked with other projects. I will get back into it and give you an update. I am fairly sure that it is pretty easy to get x,y,z position information from the Pixy. vHow to get thast information to the API will be my big hurdle. I suspect you would be able to know exactly how it's done.

Pixy information can be seen here http://charmedlabs.com/default/?page_id=211

I am not a programmer by trade so I am trying to get up to speed as quickly as possible.
Thank you again for your help.
Post Reply