Controlling crazyflie through firmware

Discussions about all things Bitcraze
Post Reply
Pdotdeep
Beginner
Posts: 9
Joined: Sun Oct 13, 2019 3:58 pm

Controlling crazyflie through firmware

Post by Pdotdeep »

Hi i am a student and i just started playing around with the crazyflie. I have used the python api and it has been great but for a certain use case i need certain logic to run on the firmware itself. i need to be able to control the movements of the crazyflie (Eg: turn right 90degrees, move forward 1 m ) through the firmware itself . I would greatly appreciate it if someone can guide me through how i can achieve such movements in the firmware code. looking through the firmware code, i have come accross some functions like commanderSetSetPoint() , positionController and others but i am unsure if these are the functions i should be making use of to achieve wad i wish to achieve. Thanks alot in advance! any hints or nudge in the correct direction is greatly appreciated!!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Controlling crazyflie through firmware

Post by arnaud »

Hi,
Currently, the easiest way to get your code to run in the firmware is to make a deck driver. This is documented on our website and there is a short howto page that you can follow to get your code running in the Crazyflie.

For an example of how to use the flow deck from inside the Crazyflie you can look at our onboard push demo: https://github.com/bitcraze/crazyflie-f ... src/push.c

This was the stable answer. Now for more experimental one, I have been working on building the Crazyflie out of tree, this allows to "include" the Crazyflie in your project and makes it much easier to add code to it. I have an example with the push demo I linked above: https://github.com/ataffanel/crazyflie-push-demo. This is not yet in the official Crazyflie firmware but I am going to merge my changes early this week and update the push demo repos to use the official Crazyflie firmware.

Eventually we are looking at making an "app layer" that would allow to run code in the Crazyflie without having to make a deck driver. Most likely this will also create a task for you so that you code can just run. Though I am not sure how it will look like and when it is going to be done, for sure it is going to be based on the out-of-tree build functionality.
Pdotdeep
Beginner
Posts: 9
Joined: Sun Oct 13, 2019 3:58 pm

Re: Controlling crazyflie through firmware

Post by Pdotdeep »

Thanks alot for your help. It worked! Looking forward to the new update in the firmware. It would really helpful for my project
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Controlling crazyflie through firmware

Post by arnaud »

A quick update: a lot has happened in this field last week. I have added an app entry-point to make it easy to get started. I updated the example to use the app entry-point and we made a blog post about the new functionalities: https://www.bitcraze.io/2019/10/app-lay ... unication/.
Post Reply