check two CRC types
[u360gts.git] / src / main / tracker / gps_estimation.h
blob1624cd21e0f2afacdad489de0932d0f10e42b06c
1 /*
2 * This file is part of u360gts, aka amv-open360tracker 32bits:
3 * https://github.com/raul-ortega/amv-open360tracker-32bits
5 * u360gts is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * u360gts is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with u360gts. If not, see <http://www.gnu.org/licenses/>.
20 #include <stdint.h>
21 #include <stdbool.h>
23 #include "tracker/defines.h"
25 typedef struct {
26 float heading;
27 float speed;
28 float distance;
29 int16_t lat_a;
30 uint32_t lat_b;
31 int8_t lat_sgn;
32 int16_t lon_a;
33 uint32_t lon_b;
34 int8_t lon_sgn;
35 uint32_t time;
36 uint16_t index;
37 uint8_t type;
38 } pvQElement_t;
40 typedef struct {
41 float heading;
42 float speed;
43 float distance;
44 int32_t lat;
45 int32_t lon;
46 int16_t lat_a;
47 uint32_t lat_b;
48 int8_t lat_sgn;
49 int16_t lon_a;
50 uint32_t lon_b;
51 int8_t lon_sgn;
52 uint32_t time;
53 uint16_t index;
54 } epsVector_t;
58 epsVector_t targetLast;
59 epsVector_t targetCurrent;
60 epsVector_t targetEstimated;
62 void pvInit(void);
63 bool pvFull();
64 bool pvEmpty();
65 bool pvPut(epsVector_t *pvector, uint8_t vectorType);
66 pvQElement_t pvGet(void);
67 void epsVectorsInit(epsVector_t *last, epsVector_t *current, epsVector_t *esttimated, uint8_t interpolation,uint8_t interpolation_points);
68 void epsVectorAddPoint(epsVector_t *last, epsVector_t *current);
69 void epsVectorEstimate(epsVector_t *last, epsVector_t *current, epsVector_t *estimated,epsVectorGain_t gain, uint32_t eps_frequency,uint8_t eps_mode);
70 void epsVectorLoad(epsVector_t *current,int32_t lat,int32_t lon,float distance, uint32_t last_time, uint32_t currentTime);
71 void epsVectorCurrentToLast(epsVector_t *current,epsVector_t *last);
72 void epsVectorDecompose(epsVector_t *pvector);
73 float epsVectorSpeed(uint32_t last_time,uint32_t currentTime, float distance);
74 uint16_t getPositionVectorIndex(void);