Rev 532 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | ingob | 1 | /*#######################################################################################*/ |
41 | ingob | 2 | /*#######################################################################################*/ |
3 | |||
4 | // IMPORTANT NOTE: |
||
5 | |||
6 | // This is only a dummy implementation for errorfree compiling of the NaviCtrl sources. |
||
7 | |||
8 | // The GPS navigation routines are NOT included ! |
||
9 | |||
10 | /*#######################################################################################*/ |
||
11 | /*#######################################################################################*/ |
||
1 | ingob | 12 | /* !!! THIS IS NOT FREE SOFTWARE !!! */ |
13 | /*#######################################################################################*/ |
||
14 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
15 | // + Copyright (c) 2008 Ingo Busker, Holger Buss |
||
171 | ingob | 16 | // + Nur für den privaten Gebrauch / NON-COMMERCIAL USE ONLY |
1 | ingob | 17 | // + FOR NON COMMERCIAL USE ONLY |
18 | // + www.MikroKopter.com |
||
19 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
41 | ingob | 20 | // + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
21 | // + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
||
22 | // + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
||
23 | // + bzgl. der Nutzungsbedingungen aufzunehmen. |
||
1 | ingob | 24 | // + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
25 | // + Verkauf von Luftbildaufnahmen, usw. |
||
26 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
41 | ingob | 27 | // + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
1 | ingob | 28 | // + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
29 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
30 | // + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
||
31 | // + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
||
32 | // + eindeutig als Ursprung verlinkt werden |
||
33 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
34 | // + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
||
35 | // + Benutzung auf eigene Gefahr |
||
36 | // + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
||
37 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
171 | ingob | 38 | // + Die Portierung oder Nutzung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
1 | ingob | 39 | // + mit unserer Zustimmung zulässig |
40 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
41 | // + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
||
42 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
41 | ingob | 43 | // + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
1 | ingob | 44 | // + this list of conditions and the following disclaimer. |
45 | // + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
||
46 | // + from this software without specific prior written permission. |
||
41 | ingob | 47 | // + * The use of this project (hardware, software, binary files, sources and documentation) is only permitted |
1 | ingob | 48 | // + for non-commercial use (directly or indirectly) |
41 | ingob | 49 | // + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
1 | ingob | 50 | // + with our written permission |
41 | ingob | 51 | // + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
52 | // + clearly linked as origin |
||
171 | ingob | 53 | // + * porting the sources to other systems or using the software on other systems (except hardware from www.mikrokopter.de) is not allowed |
1 | ingob | 54 | // |
55 | // + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
||
56 | // + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||
57 | // + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||
58 | // + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||
59 | // + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||
60 | // + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||
61 | // + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||
62 | // + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||
63 | // + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
||
64 | // + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
||
41 | ingob | 65 | // + POSSIBILITY OF SUCH DAMAGE. |
1 | ingob | 66 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
41 | ingob | 67 | #include <stdio.h> |
68 | #include <stdlib.h> |
||
69 | #include <math.h> |
||
70 | #include "91x_lib.h" |
||
1 | ingob | 71 | #include "main.h" |
41 | ingob | 72 | #include "uart1.h" |
73 | #include "GPS.h" |
||
119 | killagreg | 74 | #include "timer1.h" |
41 | ingob | 75 | #include "spi_slave.h" |
76 | #include "waypoints.h" |
||
489 | killagreg | 77 | #include "i2c.h" |
1 | ingob | 78 | |
491 | killagreg | 79 | #define GPS_UPDATETIME_MS 200 // 200ms is 5 Hz |
1 | ingob | 80 | |
41 | ingob | 81 | typedef enum |
82 | { |
||
83 | GPS_FLIGHT_MODE_UNDEF, |
||
84 | GPS_FLIGHT_MODE_FREE, |
||
85 | GPS_FLIGHT_MODE_AID, |
||
86 | GPS_FLIGHT_MODE_WAYPOINT |
||
87 | } GPS_FlightMode_t; |
||
1 | ingob | 88 | |
41 | ingob | 89 | typedef struct |
90 | { |
||
91 | float Gain; |
||
92 | float P; |
||
93 | float I; |
||
94 | float D; |
||
103 | killagreg | 95 | float A; |
41 | ingob | 96 | float ACC; |
102 | killagreg | 97 | s32 P_Limit; |
98 | s32 I_Limit; |
||
99 | s32 D_Limit; |
||
100 | s32 PID_Limit; |
||
73 | killagreg | 101 | u32 BrakingDuration; |
41 | ingob | 102 | u8 MinSat; |
103 | s8 StickThreshold; |
||
104 | float WindCorrection; |
||
89 | killagreg | 105 | float SpeedCompensation; |
532 | holgerb | 106 | s32 MaxFlyingRange; |
41 | ingob | 107 | GPS_FlightMode_t FlightMode; |
108 | } __attribute__((packed)) GPS_Parameter_t; |
||
1 | ingob | 109 | |
491 | killagreg | 110 | GPS_Pos_Deviation_t CurrentTargetDeviation; // Deviation from Target |
111 | GPS_Pos_Deviation_t CurrentHomeDeviation; // Deviation from Home |
||
112 | GPS_Pos_Deviation_t TargetHomeDeviation; // Deviation from Target to Home |
||
41 | ingob | 113 | |
114 | GPS_Stick_t GPS_Stick; |
||
314 | killagreg | 115 | |
116 | // the CAM orientation |
||
117 | CAM_Orientation_t CAM_Orientation; |
||
118 | |||
41 | ingob | 119 | GPS_Parameter_t GPS_Parameter; |
120 | |||
121 | // the gps reference positions |
||
122 | GPS_Pos_t GPS_HoldPosition = {0,0,0, INVALID}; // the hold position |
||
123 | GPS_Pos_t GPS_HomePosition = {0,0,0, INVALID}; // the home position |
||
124 | GPS_Pos_t * GPS_pTargetPosition = NULL; // pointer to the actual target position |
||
92 | killagreg | 125 | u32 GPS_TargetRadius = 0; // catch radius for target area |
491 | killagreg | 126 | Point_t* GPS_pWaypoint = NULL; // pointer to the actual waypoint |
41 | ingob | 127 | |
128 | //------------------------------------------------------------- |
||
129 | // Update GPSParamter |
||
130 | void GPS_UpdateParameter(void) |
||
131 | { |
||
132 | } |
||
133 | |||
134 | //------------------------------------------------------------- |
||
135 | // This function defines a good GPS signal condition |
||
136 | u8 GPS_IsSignalOK(void) |
||
137 | { |
||
190 | killagreg | 138 | return 0; |
41 | ingob | 139 | } |
140 | |||
1 | ingob | 141 | //------------------------------------------------------------ |
41 | ingob | 142 | // Checks for manual control action |
143 | u8 GPS_IsManuallyControlled(void) |
||
144 | { |
||
190 | killagreg | 145 | return 0; |
41 | ingob | 146 | } |
147 | |||
148 | |||
149 | //------------------------------------------------------------ |
||
97 | killagreg | 150 | void GPS_Neutral(void) |
41 | ingob | 151 | { |
152 | } |
||
153 | |||
154 | //------------------------------------------------------------ |
||
1 | ingob | 155 | void GPS_Init(void) |
156 | { |
||
41 | ingob | 157 | } |
1 | ingob | 158 | |
41 | ingob | 159 | //------------------------------------------------------------ |
160 | |||
216 | killagreg | 161 | void GPS_Navigation(gps_data_t *pGPS_Data, GPS_Stick_t* pGPS_Stick) |
190 | killagreg | 162 | { |
163 | return; |
||
164 | } |
||
241 | killagreg | 165 | |
166 | void CalcHeadFree(void) |
||
167 | { |
||
168 | return; |
||
169 | } |