main.h
Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (c) 2011, Ascending Technologies GmbH
00004 All rights reserved.
00005 
00006 Redistribution and use in source and binary forms, with or without
00007 modification, are permitted provided that the following conditions are met:
00008 
00009  * Redistributions of source code must retain the above copyright notice,
00010    this list of conditions and the following disclaimer.
00011  * Redistributions in binary form must reproduce the above copyright
00012    notice, this list of conditions and the following disclaimer in the
00013    documentation and/or other materials provided with the distribution.
00014 
00015 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
00016 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00017 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00018 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
00019 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00020 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00021 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00022 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00023 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00024 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00025 DAMAGE.
00026 
00027  */
00028 
00029 #ifndef MAIN_H_
00030 #define MAIN_H_
00031 
00032 extern void mainloop(void);
00033 extern void timer0ISR(void);
00034 
00035 
00036 volatile unsigned int GPS_timeout;
00037 volatile char SYSTEM_initialized;
00038 
00039 #define BATTERY_WARNING_VOLTAGE 10600   //10.6V
00040 #define BAT_DIV 6//(BATTERY_WARNING_VOLTAGE-10000)/100
00041 
00042 //#define GPS_BEEP      //warning if GPS has no lock
00043 #define ERROR_BEEP  //sensor calibration errors signaled by buzzer
00044 #define INIT_BEEP       //double beep during system initialization
00045 
00046 #define ControllerCyclesPerSecond       1000
00047 
00048 #define OFF 0
00049 #define ON  1
00050 
00051 #define NORMAL 0
00052 
00053 
00054 //packet descriptors
00055 #define PD_IMURAWDATA       0x01
00056 #define PD_LLSTATUS             0x02
00057 #define PD_IMUCALCDATA      0x03
00058 #define PD_HLSTATUS             0x04
00059 
00060 #define PD_CTRLOUT                      0x11
00061 #define PD_FLIGHTPARAMS     0x12
00062 #define PD_CTRLCOMMANDS         0x13
00063 #define PD_CTRLINTERNAL         0x14
00064 #define PD_RCDATA               0x15
00065 #define PD_CTRLSTATUS           0x16
00066 
00067 #define PD_WAYPOINT             0x20
00068 #define PD_CURRENTWAY           0x21
00069 #define PD_NMEADATA             0x22
00070 #define PD_GPSDATA                      0x23
00071 
00072 #define PD_CAMERACOMMANDS       0x30
00073 #define PD_RO_ALL_DATA          0x90
00074 
00075 
00076 //system status defines for buzzer handling
00077 #define FM_COMPASS_FAILURE                      0x10
00078 #define FM_CALIBRATION_ERROR            0x100
00079 #define FM_CALIBRATION_ERROR_GYROS      0x200
00080 #define FM_CALIBRATION_ERROR_ACC        0x400
00081 #define FM_ADC_STARTUP_ERROR        0x800
00082 #define FM_MAG_FIELD_STRENGTH_ERROR 0x4000
00083 #define FM_MAG_INCLINATION_ERROR        0x8000
00084 
00085 
00086 
00087 struct IMU_CALCDATA {
00088 //angles derived by integration of gyro_outputs, drift compensated by data fusion; -90000..+90000 pitch(nick) and roll, 0..360000 yaw; 1000 = 1 degree
00089     int angle_nick;
00090     int angle_roll;
00091     int angle_yaw;
00092 
00093 //angular velocities, 16 bit values, bias free, 1 LSB = 0.0154 °/s (=> 64.8 = 1 °/s)
00094     int angvel_nick;
00095     int angvel_roll;
00096     int angvel_yaw;
00097 
00098 //acc-sensor outputs, calibrated: -10000..+10000 = -1g..+1g, body frame coordinate system
00099     short acc_x_calib;
00100     short acc_y_calib;
00101     short acc_z_calib;
00102 
00103 //horizontal / vertical accelerations: -10000..+10000 = -1g..+1g
00104     short acc_x;
00105     short acc_y;
00106     short acc_z;
00107 
00108 //reference angles derived by accelerations only: -90000..+90000; 1000 = 1 degree
00109     int acc_angle_nick;
00110     int acc_angle_roll;
00111 
00112 //total acceleration measured (10000 = 1g)
00113     int acc_absolute_value;
00114 
00115 //magnetic field sensors output, offset free and scaled; units not determined, as only the direction of the field vector is taken into account
00116     int Hx;
00117     int Hy;
00118     int Hz;
00119 
00120 //compass reading: angle reference for angle_yaw: 0..360000; 1000 = 1 degree
00121     int mag_heading;
00122 
00123 //pseudo speed measurements: integrated accelerations, pulled towards zero; units unknown; used for short-term position stabilization
00124     int speed_x;
00125     int speed_y;
00126     int speed_z;
00127 
00128 //height in mm (after data fusion)
00129     int height;
00130 
00131 //diff. height in mm/s (after data fusion)
00132     int dheight;
00133 
00134 //diff. height measured by the pressure sensor [mm/s]
00135     int dheight_reference;
00136 
00137 //height measured by the pressure sensor [mm]
00138     int height_reference;
00139 };
00140 extern struct IMU_CALCDATA IMU_CalcData, IMU_CalcData_tmp;
00141 
00142 
00143 
00144 #endif /*MAIN_H_*/
00145 


asctec_hl_firmware
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Tue Dec 17 2013 11:39:27