calculate

Dependencies:   mbed X_NUCLEO_IKS01A3 Mahony_Algorithm

Committer:
zollecy1
Date:
Fri May 01 08:44:21 2020 +0000
Revision:
6:4641f2b2684b
Parent:
5:62994bb9fff9
..

Who changed what in which revision?

UserRevisionLine numberNew contents of line
zollecy1 0:313fbc3a198a 1 /**
zollecy1 0:313fbc3a198a 2 |**********************************************************************;
zollecy1 0:313fbc3a198a 3 * Project : Projektarbeit Systemtechnik PES4
zollecy1 0:313fbc3a198a 4 *
zollecy1 0:313fbc3a198a 5 * Program name : Beispiel
zollecy1 0:313fbc3a198a 6 *
zollecy1 0:313fbc3a198a 7 * Author : PES4 Team1
zollecy1 0:313fbc3a198a 8 *
zollecy1 0:313fbc3a198a 9 * Team : **Team 1**
zollecy1 0:313fbc3a198a 10 * Fabio Bernard
zollecy1 0:313fbc3a198a 11 * Lukas Egli
zollecy1 0:313fbc3a198a 12 * Matthias Ott
zollecy1 0:313fbc3a198a 13 * Pascal Novacki
zollecy1 0:313fbc3a198a 14 * Robin Wanner
zollecy1 0:313fbc3a198a 15 * Vincent Vescoli
zollecy1 0:313fbc3a198a 16 * Cyrill Zoller
zollecy1 0:313fbc3a198a 17 *
zollecy1 0:313fbc3a198a 18 * Date created : 20.02.2020
zollecy1 0:313fbc3a198a 19 *
zollecy1 0:313fbc3a198a 20 * Purpose : Beispiel
zollecy1 0:313fbc3a198a 21 *
zollecy1 0:313fbc3a198a 22 |**********************************************************************;
zollecy1 0:313fbc3a198a 23 **/
zollecy1 0:313fbc3a198a 24
zollecy1 0:313fbc3a198a 25
zollecy1 0:313fbc3a198a 26 #ifndef CALCULATEDATA_H
zollecy1 0:313fbc3a198a 27 #define CALCULATEDATA_H
zollecy1 0:313fbc3a198a 28
zollecy1 0:313fbc3a198a 29 #include "mbed.h"
zollecy1 0:313fbc3a198a 30 #include "XNucleoIKS01A3.h"
zollecy1 3:795998b31c32 31 #include "Liste.h"
zollecy1 4:7d13076ecece 32 #include "MahonyAHRS.h"
zollecy1 0:313fbc3a198a 33
zollecy1 0:313fbc3a198a 34 class CalculateData {
zollecy1 0:313fbc3a198a 35
zollecy1 0:313fbc3a198a 36 public:
zollecy1 0:313fbc3a198a 37
zollecy1 0:313fbc3a198a 38 CalculateData(PinName Pin0, PinName Pin1, PinName Pin2,
zollecy1 0:313fbc3a198a 39 PinName Pin3, PinName Pin4, PinName Pin5, PinName Pin6); //Constructor
zollecy1 0:313fbc3a198a 40
zollecy1 0:313fbc3a198a 41 virtual ~CalculateData();
zollecy1 0:313fbc3a198a 42 void enable();
zollecy1 0:313fbc3a198a 43 void disable();
zollecy1 3:795998b31c32 44 void getValue(Liste *list);
zollecy1 4:7d13076ecece 45 void update();
zollecy1 1:48e219526d0f 46
zollecy1 1:48e219526d0f 47
zollecy1 0:313fbc3a198a 48
zollecy1 0:313fbc3a198a 49 private:
zollecy1 0:313fbc3a198a 50
zollecy1 0:313fbc3a198a 51
zollecy1 5:62994bb9fff9 52 void integrate(float *x, float *x_old, float *y, float t, float t_old);
zollecy1 5:62994bb9fff9 53 void transform(int old_val[3][100], int index, float *new_val, int roll, int pitch, int yaw);
zollecy1 5:62994bb9fff9 54 void filterAcc(float *array);
zollecy1 5:62994bb9fff9 55 void filterSpeed(float *array);
zollecy1 3:795998b31c32 56 void run();
zollecy1 5:62994bb9fff9 57 void calibrationMag(int x,int y,int z, float *buff);
zollecy1 1:48e219526d0f 58
zollecy1 0:313fbc3a198a 59
zollecy1 1:48e219526d0f 60
zollecy1 3:795998b31c32 61 Thread thread;
zollecy1 3:795998b31c32 62 Timer timer;
zollecy1 4:7d13076ecece 63 MahonyAHRS *mahony;
zollecy1 3:795998b31c32 64
zollecy1 4:7d13076ecece 65 int array_acc[3][100]; //Matrix periodic Sensor Data
zollecy1 4:7d13076ecece 66 int array_gyro[3][100]; //Matrix periodic Sensor Data
zollecy1 4:7d13076ecece 67 int array_mag[3][100]; //Matrix periodic Sensor Data
zollecy1 3:795998b31c32 68 int counter; //count Matrix records
zollecy1 3:795998b31c32 69 bool periodic_task; //boolean periodic condition
zollecy1 3:795998b31c32 70
zollecy1 1:48e219526d0f 71
zollecy1 5:62994bb9fff9 72 float acc[3];
zollecy1 5:62994bb9fff9 73 float acc_old[3];
zollecy1 5:62994bb9fff9 74 float speed[3];
zollecy1 5:62994bb9fff9 75 float speed_old[3];
zollecy1 5:62994bb9fff9 76 float pos[3];
zollecy1 5:62994bb9fff9 77 float t[100];
zollecy1 5:62994bb9fff9 78 float t_old;
zollecy1 1:48e219526d0f 79
zollecy1 0:313fbc3a198a 80
zollecy1 0:313fbc3a198a 81 };
zollecy1 0:313fbc3a198a 82
zollecy1 0:313fbc3a198a 83
zollecy1 0:313fbc3a198a 84
zollecy1 0:313fbc3a198a 85 #endif