The following steps are used to create a development environment:
- Install Debian Stretch to a Virtual Machine (VM) or development computer.
- Ensure that build-essential and crossbuild-essential-armhf are installed.
- Clone this repository to your VM or development computer.
- Install Arudino and Teensyduino
$ xz -d SOC.img.xz
- Insert a micro-sd and write the image to the micro-sd card, where /dev/sdX is the drive for your micro-sd. You can use a utility like GParted to inspect your machine's drives and ensure that you are writing to the correct location.
$ sudo dd if=SOC.img of=/dev/sdX
- Insert the micro-sd in the BeagleBone Black and power on the device while holding down the "User Boot" button. Power can be supplied by plugging the BeagleBone Black into your computer with a USB micro plug. You should see all 4 LEDs lightup before lighting sequentially. This is flashing the image to the BeagleBone Black EMMC non-volatile memory. When the lights all turn off, you can remove the micro-sd and boot the BeagleBone Black.
- Once the BeagleBone Black has booted, you should see it connect to your development computer as a network device. SSH to the BeagleBone Black using a terminal using its default user name, debian, and IP address, 192.168.7.2. The default password is: temppwd.
$ ssh debian@192.168.7.2
Use the makefile in /RAPTRS/software to build flight software binaries, which are built to /RAPTRS/software/bin. The following commands are available:
- make: builds all of the available binaries
- make clean: deletes all binaries and deletes cached object files
- make flight: builds the flight software for the BeagleBone Black
- make datalog: builds the BeagleBone Black datalog-server software
- make telem: builds the soc telem-server software
- make fmu: builds the fmu software
- make node: builds the node software
- make upload_fmu: uploads the fmu software
- make upload_node: uploads the node software
Additionally, within /RAPTRS/software/src there is an Arduino program called write-addr, which writes the BFS-Bus address for the FMU and Nodes using the Arduino serial monitor and following the prompts. This must be run prior to uploading FMU or Node software.
While the FMU and Node software is flashed by make upload_fmu and make upload_node, the flight and datalog-server software should be transfered to the BeagleBone Black using SFTP or SCP.
Aircraft configuration is done via a JSON file that is read by the BeagleBone Black and used to configure the aircraft sensors, sensor-processing and estimation algorithms, control laws, mission manager, and effectors. Details are provided, for each of the configurable items. A couple of examples are also provided for an Ultra Stick 25e and a quadrotor UAS.
On the BeagleBone Black:
- Setup the UARTS by running this script
- Start the datalog server and telemetry; ignored hangup (nohup), start in background
$ nohup ./datalog-server &
$ nohup ./telemetry-server &
- Start the flight code; ignored hangup (nohup), start in background, send output to out.txt
$ nohup ./flight config.json > out.txt &
- You can check the output of flight
$ tail -f out.txt
- You can check that the datalog file (dataX.bin) is growing and disconnect from the BeagleBone Black.
- After the flight, download the datalog file and convert to HDF5 using 'bin2hdf.py' in /RAPTRS/analysis-tools. Note that this script requires python3 and h5py installed.
$ python3 bin2hdf.py data0.bin
The hdf5 log data can also be loaded in MATLAB, or converted to .mat format from MATLAB using /RAPTRS/analysis-tools/hdfLoad.m and /RAPTRS/analysis-tools/hdf2mat.m.
fileLoad = 'data000.hdf5';
hdf2mat(fileLoad);
[data, desc] = hdfLoad(fileLoad);
Pull requests improving our software or documentation are always appreciated.