We decided to use Ubuntu on our Gumstix. We chose this operating system because we all knew it, packages are well managed and it remains light since we created, thanks to debootstrap, an image with only what we needed.
The first step to use Ubuntu on the Gumstix was to create a bootable MicroSD Card. There are two partitions:
- a Fat partition: with the bootstrap loader, the boot loader, the initRD and the kernel image.
- a nilfs2 partition: with the rootFS
We settled for nilfs2 because we are using a micro SD card (that is to say Flash). Since nilfs2 is a full log-structured file system, data are written harmoniously on all the card, nothing is deleted, except whenever the garbage collector purges the log. It is also very efficient against untimely shutdown (because of power issue for instance) for it restores the last correct snapshot.
We used a 2.6.34 kernel patched to handle the Caspa video camera and compiled with, of course, nillfs2 support.
Software on Ubuntu
There are four major software running on the Gumstix:
- The one handling the UART. It communicates with the STM32, receives data packets from the sensors and the remote control, checks whether they are corrects and dispatches them to the suitable programs. It also sends back packets of commands for the motors.
- One other computes the Yaw, Pitch and Roll angles thanks to FQA and Kalman algorithms.
- Another one, update the setpoint of the PID and the thrust of the motors according to the data received from the remote control.
- Finally, the last one computes thanks to several PID the eight commands sent to the motors
Here is a schematic showing the interactions between these programs: