Page 1 of 1

Start from scratch...Help

Posted: Mon Nov 02, 2015 10:23 am
by EtienneP
Hello,

I have just received my new crazflie and I cannot wait to start programming my own custom firmware. However, I am kind of lost with all the directories in the source code. Can anyone give me an empty project with only the required drivers to start from scratch or tell me what should I keep and delete to do so ?

Regards,

Etienne

Re: Start from scratch...Help

Posted: Mon Nov 02, 2015 12:21 pm
by Che.
Hi Etienne,

I was starting at the same point as you do now.
In my opinion its best for you to start working through the code to see where the magic happens and whats not so interesting for you.
It depends on your project...
Unfortunately there is no universal documentation.

Have you downloaded the Virtual Machine already?

Greets, che

Re: Start from scratch...Help

Posted: Mon Nov 02, 2015 7:49 pm
by EtienneP
Yes this is what I have been doing so far, reading and trying to understand what's being done. But I would like to start on my own and make my Crazyflie autonomous.

Yes I have been through all the tutorials to download and start using the VM !

Re: Start from scratch...Help

Posted: Mon Nov 02, 2015 8:32 pm
by Che.
Try to edit some code, add some of your own and look what happens, experiment maybe?
Do you know how to add your own code to the system and how to flash it?

I dont know where exactly your problem is.

Re: Start from scratch...Help

Posted: Mon Nov 02, 2015 9:14 pm
by EtienneP
Well, I just wanted to start from an empty file, an empty main, an empty project. I want to have all the command lines for the motors and sensors and start writing my own program.
Maybe I should ask what is absolutely necessary to get the crazyflie fly ? What are the files I cannot remove from the project ? For example, in the main.c file, are all the .h files absolutely necessary to do something really easy like turning the motors on ?



Well, I guess I know how to edit the already existing .c and .h files but I had trouble flashing it when I tried yesterday. I unfortunately didn't have time to try to figure out why. I had errors in some random files, it compiled though. But I couldn't flash it.

Re: Start from scratch...Help

Posted: Mon Nov 02, 2015 11:06 pm
by Che.
now i know where you are heading.
i think starting from scratch is really much work to do.

the system is relatively complex. there is working a Real Time Operatin System (RTOS) for example, that handles all the tasks of the flie like gaining and keeping balance in the air.

I'd suggest to keep the system like it is and just to modify it, that will save you a lot of work.
First you'll need to figure out how the system works, which Tasks are important and what they do.

When looking at the main you can see that really few functions are called. The system is stacked in many levels where more and more functions get called. When pushing CTRL on your keyboard and clicking on the function call in the code (which is underlined when pressing CTRL), the view switches to the lower level.

So you can crawl through the whole system fast and see how everything works. When you have a clear view on anything, you can start coding.
It may sound demotivating at first, but thats the work you have to do before start serious developing.

Re: Start from scratch...Help

Posted: Tue Nov 03, 2015 4:38 pm
by EtienneP
Thank you for your detailed answer and your tips.

My final objective is to find out how to make it stable in the air on my own. I know they have done a great job so far, but I just wanted to try myself and do as great as them.

I guess I will start as you suggested then. That would have been great to have all the functions to control motors and get sensors values in a "read me" file. Would have saved time !