In response to your recent blog posts on creating new step-by-step user guides, I would like to add some suggestions. The new user guides have been very helpful, and I look forward to seeing them expand, but it would be great to have a page with a general overview of everything.
For some background, I am studying mechanical engineering in college and before starting a project using the Crazyflie 2.1 did not have much prior knowledge in robotics, aerospace, electronics or programming. It has taken me many hours to understand what the role of each software/program is and how they connect with each other by reading the Bitcraze guides, github, forums, and the blog. Specifically, I was trying to understand what the cflib and client are, what capabilities the virtual machine provides, and where different tasks should be accomplished, such as programming the drone versus developing software and firmware. I am still trying to figure out what capabilities ROS and ZMQ have and whether I can use it for the project.
The problem is, there is a lot of information out there, but it is scattered all over the place, or even in the case of Bitcraze guides, I do not know that the information is there until I search for it (specifically in the case with autonomous flight, ROS, and ZMQ). Some more specific examples: Some information included in updates about new releases in blog posts should be included in the general information for that software. On Github, it is confusing whether the instructions are for developing the software or for simply using the software. Information and products required for autonomous flights are not directly found.
I've been keeping a guide for myself and others who will join my project to save time on gathering all information. Below is some information from my guide as an example of the approximate format I would like to see for a general summary/overview of all Bitcraze/Crazyflie possibilities (pardon the informal language and grammatical/punctuation errors).
- Python/C++: sending commands to the drone through the cflib, as well as developing the cflib or the client can be done in the language of your choice, but developing the firmware/bootloaders must be done in C.
- Python: text editor or IDE? Text editor is enough if you want to send commands to the drone, but you’ll need an IDE to develop the cflib or the client themselves.
- Bitcraze Virtual Machine: this is kind of like downloading a zipped folder containing all the files you need, except that instead of unzipping the folder to access the files, the folder is a mini computer/operating system that you can use the files within. The files included are: (1) all user guides, examples in Python, and firmware in C from Bitcraze and github, (2) the CF Client, (3) Eclipse set-up for programming environment in C/C++ to develop the firmware/bootloaders which are written in C/C++ (4) a web browser, so you can download things too and (5) a command prompt like any other operating system has. The operating system used is Ubuntu (from Linux). So, you can do everything besides programming in Python, which you’d need to use the cflib to send commands to the drone, but you can set up Python in the VM, although it’s recommended that you download it to your computer and use it that way.
How to get/use it: Follow instructions on Bitcraze.
- Crazyflie Client: this is a GUI (graphical user interface) and has nothing to do with coding. The GUI is built using the CFlib. One can do a lot of things on it like monitor the battery and connection status of the drone, see parameters of flight, see graphs of how the motion is changing, etc. The client, however, is only for manual flight mode (i.e. with a game controller, or with your keyboard if you can set that up…). You CANNOT use it for autonomous flight, which would require to code commands and execute the code to send to the drone.
How to get it: it is included in the Bitcraze Virtual Machine; otherwise you can download it separately to your computer along with cflib, following Bitcraze instructions.
How to use it: once you download it, it will be an application/program on your computer, like any other app such as your camera app. You can double click on it and a GUI will appear with which you can interact like with any app/program by clicking on tabs/buttons.
How to build/develop it (AKA modify the GUI to for example create new buttons and tabs, modify the font, etc): You’d have to modify the code behind it, which you can find and find instructions for on Bitcraze and github.
- CFlib: this is an API; it is a collection of programming classes and commands used by Crazyflie so that you do not have to write every command from scratch. The official Bitcraze cflib is using Python, but APIs with other programming languages can also be found. This is the thing you use to program the crazyflie by sending commands to it and to autonomously control it.
How to get it: it is /not/ included in the Bitcraze Virtual Machine (VM). The VM has Eclipse with C/C++ set up, so unless you are using cflib in C/C++, you can download the Python extension for Eclipse, or download a different Python text editor or IDE.
How to use it: for the programming language of your choice, download the text editor (IDE also works but is not necessary). Now you can write programs using the /classes/commands in the cflib (after calling cflib in the code first of course). The executed programs can send commands to the drone.
How to develop/build it (AKA modify or add new classes and commands): You’ll need an IDE to modify the code behind it and you can follow instructions on Bitcraze/github.
- Crazyflie/Crazyradio Firmware/bootloaders: this has to do with embedded systems. These are the programs uploaded onto the electronics on the crazyflie/crazyradio. This is what helps receive information from the computer on the Crazyflie itself, this is how crazyflie can stabilize itself, etc. All of it is written in C/C++. You can write commands and flash it to the Crazyflie to also autonomously control it (a different way from sending commands from your computer using the cflib from a text editor/IDE).
How to Program and Control The Crazyflie
Intro: Control can be manual and autonomous. Manual is when you’re telling the drone what to do as it's doing it (synchronous/live/immediate), like using joysticks on a game controller or your keyboard or an app on your phone. Autonomous is when you first write all the code/commands in a program and the drone then executes it (asynchronous control). Both can be done differently.
- Manual Control
The official and most developed ways promoted by Bitcraze are using an actual game controller like PX3 alongside the PC CF client, and using the mobile app. Other ways are developed by the community and usually require more work and modifications.
- Using a physical game controller: this is in detail explained in all user guides on Bitcraze; it involves using the cf client and connecting the controller to the client along with the crazyradio. You can use the joysticks to control the take off, motion, and landing of the drone and use other useful features like data logging and parameter monitoring in the client.
- Using the mobile app: this is also explained in Bitcraze guides and involves downloading an app to your mobile device (smart phone). Not sure if this can be used in conjunction with the client.
- Using a simulated game controller: some people have proposed downloading a game controller simulator to your computer and connecting that to the cf client, so you can use the controller window on your computer; not well tested.
- Using your computer keyboard: some people have created programs to avoid the simulated game controller that will allow you to use your computer keyboard; not well tested.
- Autonomous Control
There are two different ways the drone can be programmed to achieve autonomous control:
- Sending commands from the computer: a program can be written using the cflib in the language of your choice and executed using the text editor/IDE. The drone must be disconnected from the cf client. This would send the commands within the program to the drone through the radio connection (crazyradio), and the drone would follow the commands.
- Programming the commands onto the drone: the crazyflie firmware (software contained in the drone’s electronic parts), which is written in C, can be accessed and downloaded online (github) or from Eclipse in the Virtual Machine. The code can be modified to include the code for autonomous flight.
- Crazyflie as is with no additional onboard and/or external sensors: the way crazyflie arrives on its own, it can only perform very basic autonomous operations such as lifting off, hovering, and landing. Great drift will prevent any other type of motion besides straight up and down. The ramp.py example is a good start for trying a lift/hover program. This can be done using either of the two auto control ways mentioned above.
- Crazyflie with the flow STEM ranging bundle: This additional deck that is mounted on the drone provides the necessary sensors for autonomous control without any other external sensors. It costs money, but is affordable. This was used by the A Visionless Autonomous Landing paper from the Rutgers GSET group. This uses the first, sending commands from computer, method. There is a lot of documentation and instruction on this method.
- Crazyflie plus positioning systems. There are three types: Loco provided by Bitcraze, Lighthouse provided by Bitcraze and outside vendors, and Motion Capture provided by outside vendors. All use external sensors mounted in the environment and sensors mounted on the drone. If using the lighthouse positioning system, the firmware will need to be modified, so second method is used.
- Crazyflie plus onboard camera: not sure how this one works yet.