This is an old revision of the document!
Table of Contents
Software
Onboard
The on board software is written entirely in C. Non-realtime IPC is done with a TCP server that repeats back any information sent to it. This makes debugging/monitoring/controlling over a network very simple. Realtime data is stored in shared memory.
Note: this is mainly for our reference!
Processes
There are 5 major processes:
main.c
Forks, controls and handles errors from other processes. This also controls the shared memory,
flight.c
This process manages the flight (ie, keeps track of when it is ascending/descending/landed, sends text messages etc) and keeps a list of waypoints. The main waypoint tasks:
- Keeping a list of waypoints. Waypoints consist of a position and an optional required altitude.
- Calculating “sub waypoints” for circling around to get to required altitudes etc.
- Calculating when a waypoint is reached based on GPS position and thresholds
- Calculating headings to go in based on the current position and the next waypoint (continuous so it will not drift off course)
Currently for development, there is a very simple waypoint manager that cycles around a set of waypoints in an array.
roll.c
- Maintaining straight/level flight.
- Calculate current heading
- Bank and turn based on heading to next waypoint and current heading
pitch.c
- Maintain constant airspeed, maybe based on stall speed at current altitude or fixed pitch. Without a pressure sensor, this will have to be done purely with ground speed, so a fixed pitch may be necessary. I shall have to look into attaching a pitot pressure sensor.
Currently for powered flight development, this process is just maintaining a certain altitude.
gps_reader.c
- Reads GPS data from gpsd using libgps and sticks it in shared memory.
Libraries
attitude.c
- Calculates roll and pitch attitude (in degrees) from thermopile inputs.
calculations.c
- Various calculations, currently converts two sets of GPS coordinates to bearings and distances.
client.c
See client
- Client for server.
logger.c
- Logs errors and messages.
servos.c
- Controls servos via i2c.
Possible ground station
To display:
- Readings from sensors.
- Flight plan and waypoints
- Attitude/artificial horizon
- Altitude.
- GPS position.
- Speed.
- Rate of descent/ascent.
- Payload status (ascending, descending, landed etc).
- Raw output from log.
- Battery voltages.
- Space remaining on disk.
- Number of photos taken and, depending on bandwidth, a compressed version of the last image.
To send:
- Cut down.
- Take photo.
- Change/add to flight plans.
- Edit/add to waypoints.
- Manual control for emergencies.
- Release parachute.