Defines |
#define | LOG 0 |
| Easy way to turn logging on (1) and off (0)
|
#define | TELEMETRY 1 |
| Easy way to turn telemetry on (1) and off (0)
|
#define | CONTROLS 1 |
| Easy way to turn controls on (1) and off (0) - if off, Payload release is ON.
|
#define | NAVIGATION 0 |
| Turn outer loop navigation on (1) and off (0)
|
#define | GRAVITY 9.81 |
| acceleration due to gravity
|
#define | K_DRIFT 0.2564 |
#define | OFFSET_DRIFT 6.4577 |
#define | DEG2RAD(x) (x*0.0174532925) |
| Macro to convert degrees to radians.
|
#define | RAD2DEG(x) (x*57.2957795) |
| Macro to convert radians to degrees.
|
#define | DELT_M2GPS_LAT(x) (x*105.37407797) |
| Macro to convert a delta of meters to a delta of GPS decimal*10^7 (latitude)
|
#define | DELT_M2GPS_LON(x) (x*74.51564828) |
| Macro to convert a delta of meters to a delta of GPS decimal*10^7 (longitude)
|
#define | DELT_GPS_LAT2M(x) (x*0.00949) |
| Macro to convert a delta of GPS decimal*10^7 to a delta of meters (latitude)
|
#define | DELT_GPS_LON2M(x) (x*0.01342) |
| Macro to convert a delta of GPS decimal*10^7 to a delta of meters (longitude)
|
#define | SYSTEM_CLOCK 16000000 |
| ATmega 2560 clock speed in Hz.
|
#define | SLOW_LOOP_CLOCK 5 |
| Slow loop clock speed in Hz.
|
#define | MED_LOOP_CLOCK 25 |
| Medium loop clock speed in Hz.
|
#define | FAST_LOOP_CLOCK 50 |
| Fast loop clock speed in Hz.
|
#define | TELEMETRY_CLOCK 5 |
| Telemetry transmit speed in Hz.
|
#define | LOGGING_CLOCK 15 |
| Logging speed in Hz (except for GPS and barometer, which are in the slow loop)
|
#define | A_LED 37 |
| set this pin to output to control LED A on the shield
|
#define | B_LED 36 |
| set this pin to output to control LED B on the shield
|
#define | C_LED 35 |
| set this pin to output to control LED C on the shield
|
#define | SLIDE_SWITCH 40 |
| set this pin to input to read the state of the sliding switch on the shield
|
#define | RELAY_SWITCH 47 |
| set this pin to output to control the Relay Switch on the shield
|
#define | LOGGING_SWITCH 6 |
| switch attached to analog 6 to control whether or not to log
|
#define | PITOT_CH 7 |
| The external ADC channel for the pitot probe.
|
#define | PITOT_RATIO 1.0 |
| Conversion between pitot probe voltage and kPa: once the offset (PITOT_OFFSET) is subtracted, 2V -> 2 kPa.
|
#define | PITOT_OFFSET 2.8 |
| This voltage reading from the pitot probe corresponds to 0 pressure difference between static and dynamic.
|
#define | RHO 1.2 |
| The density of air at sea level.
|
#define | ELEVATOR_CH 0 |
| Elevator Channel definition.
|
#define | RUDDER_CH 1 |
| Rudder Channel definition.
|
#define | THROTTLE_CH 2 |
| Throttle Channel definition.
|
#define | RC4_CH 3 |
| Payload Drop Channel Switch: Ouput #9 on Receiver - Input #4 on APM.
|
#define | DROP_SERVO 3 |
| Drop servo on APM output #4.
|
#define | RC5_CH 4 |
| RC ch5 definition.
|
#define | RC6_CH 5 |
| RC ch6 definition.
|
#define | RC7_CH 6 |
| RC ch7 definition.
|
#define | RC8_CH 7 |
| RC ch8 definition.
|
#define | SEC_PER_DAY 86400 |
| Number of seconds in a day.
|
#define | SEC_PER_HOUR 3600 |
| Number of seconds in an hour.
|
#define | SEC_PER_MIN 60 |
| Number of seconds in a minute.
|
#define | HEAD_BYTE1 0xA3 |
| Header byte for flash memory writing (Decimal 163)
|
#define | HEAD_BYTE2 0x95 |
| Header byte for flash memory writing (Decimal 149)
|
#define | END_BYTE 0xBA |
| End byte for flash memory writing (Decimal 186)
|
#define | LOG_INDEX_MSG 0xF0 |
| Index header byte for flash memory writing (for determining log numbering)
|
#define | LOG_ATTITUDE_MSG 0x01 |
| Attitude header byte for flash memory writing (used by ArduPilot Mega, here to keep track of what's used)
|
#define | LOG_GPS_MSG 0x02 |
| GPS header byte for flash memory writing.
|
#define | LOG_MODE_MSG 0X03 |
| Mode header byte for flash memory writing (used by ArduPilot Mega, here to keep track of what's used)
|
#define | LOG_BAROMETER_MSG 0X04 |
| Barometer header byte for flash memory writing.
|
#define | LOG_IMU_MSG 0X05 |
| IMU header byte for flash memory writing.
|
#define | LOG_RC_MSG 0X06 |
| RC header byte for flash memory writing.
|
#define | LOG_AIRSPEED_MSG 0x07 |
| Airspeed header byte for flash memory writing.
|
#define | LOG_MAG_MSG 0x08 |
| Magnetometer header byte for flash memory writing.
|
#define | LOG_CONTROLS_RUDDER_MSG 0x09 |
| Controls roll comp header byte for flash memory writing.
|
#define | LOG_CONTROLS_ELEVATOR_MSG 0x0A |
| Controls elevator header byte for flash memory writing.
|
#define | LOG_CONTROLS_THROTTLE_MSG 0x0B |
| Controls throttle header byte for flash memory writing.
|
#define | LOG_STATE_MSG 0x0C |
| State header byte for flash memory writing.
|
#define | LOG_NAVIGATION_MSG 0x0D |
| Navigation header byte for flash memory writing.
|
#define | TYPE_AIRSTART_MSG 0x00 |
| Airstart header byte for flash memory writing (used by ArduPilot Mega, here to keep track of what's used)
|
#define | TYPE_GROUNDSTART_MSG 0x01 |
| Groundstart header byte for flash memory writing (used by ArduPilot Mega, here to keep track of what's used)
|
#define | MAX_NUM_LOGS 50 |
| Maximum number of logs allowed in flash memory.
|
#define | GYRO_INT_TIME 0.02 |
| Gyro integration time for the DCM.
|
Functions |
| FastSerialPort0 (Serial) |
| setup fast serial port (for FTDI)
|
| FastSerialPort1 (Serial1) |
| setup fast serial port (for GPS) to make gps library happy
|
| FastSerialPort3 (Serial3) |
| setup fast serial port for telemetry communication
|
Variables |
unsigned long | fast_timer |
unsigned long | medium_timer |
unsigned long | slow_timer |
unsigned long | telemetry_timer |
unsigned long | logging_timer |
int | rc_elevator = 0 |
| RC Elevator Input.
|
int | rc_rudder = 0 |
| RC Rudder Input.
|
int | rc_throttle = 0 |
| RC Throttle Input.
|
int | rc_4 = 0 |
| RC Payload Drop Input & ELE_control on/off.
|
int | rc_5 = 0 |
| RC switch for turning controls on/off.
|
int | rc_6 = 0 |
| RC knob for adjusting controls gain.
|
int | rc_7 = 0 |
| RC knob for adjusting controls gain.
|
int | rc_8 = 0 |
unsigned long | drop_timer |
| makes sure the rc input wasnt just a fluke, keeps track of how long the input is high to make sure you want to drop
|
float | airspeed |
| stores current airspeed reading
|
float | pitot_pressure_offset |
| stores an offset for zeroing the pitot pressure measurements
|
boolean | get_wind_profile = true |
float | sum_wind_ns = 0 |
| running sum of wind samples in North South direction during ascent
|
float | sum_wind_ew = 0 |
| running sum of wind samples in East West direction during ascent
|
int | total_ns = 0 |
| total number of wind samples in NS direction during ascent
|
int | total_ew = 0 |
| total number of wind samples in EW direction during ascent
|
float | avg_wind_ns = 0 |
| average wind in NS direction during ascent
|
float | avg_wind_ew = 0 |
| average wind in EW direction during ascent
|
float | drift_ns = 0.0 |
float | drift_ew = 0.0 |
int | slide_sw = LOW |
| state of hardware switch on shield ( either LOW (0) or HIGH (1) )
|
int | logging_sw = 0 |
| state of the logging switch on analog 6 (see LOGGING_SWITCH)
|
boolean | drop_state = false |
| state of the drop servo
|
boolean | use_gps = false |
| whether or not to use gps, based on reading the slide_switch at power-on
|
Vector3f | accel |
Vector3f | gyro |
long | gps_start_lat = 0 |
long | gps_start_lon = 0 |
AP_GPS_Auto gps_driver & | Serial1 |
| Initialize GPS (has to be outside of a function for some reason)
|
APM_BMP085_Class | barometer |
| declare an instance of the Barometer class
|
AP_Compass_HMC5843 | compass |
| declare an instance of the Magnetometer class
|
AP_DCM dcm & | imu |
| declare an instance of the DCM class
|
Main header file, contains global variables, includes, macros, etc.
- Author:
- Michael Posner (CIS, MEAM '12)
-
Timothy Hennelly (ESE '12)
-
Jacob Orloff (MEAM '12)
Definition in file storc.h.