calculate

Dependencies:   mbed X_NUCLEO_IKS01A3 Mahony_Algorithm

Committer:
zollecy1
Date:
Thu Apr 16 19:34:49 2020 +0000
Revision:
3:795998b31c32
Parent:
2:4cccdc792719
Child:
4:7d13076ecece
.

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 0:313fbc3a198a 32
zollecy1 0:313fbc3a198a 33 class CalculateData {
zollecy1 0:313fbc3a198a 34
zollecy1 0:313fbc3a198a 35 public:
zollecy1 0:313fbc3a198a 36
zollecy1 0:313fbc3a198a 37 CalculateData(PinName Pin0, PinName Pin1, PinName Pin2,
zollecy1 0:313fbc3a198a 38 PinName Pin3, PinName Pin4, PinName Pin5, PinName Pin6); //Constructor
zollecy1 0:313fbc3a198a 39
zollecy1 0:313fbc3a198a 40 virtual ~CalculateData();
zollecy1 0:313fbc3a198a 41 void enable();
zollecy1 0:313fbc3a198a 42 void disable();
zollecy1 3:795998b31c32 43 void getValue(Liste *list);
zollecy1 1:48e219526d0f 44
zollecy1 1:48e219526d0f 45
zollecy1 0:313fbc3a198a 46
zollecy1 0:313fbc3a198a 47 private:
zollecy1 0:313fbc3a198a 48
zollecy1 0:313fbc3a198a 49
zollecy1 3:795998b31c32 50 void integrate(double *x, double *x_old, double *y, double t, double t_old);
zollecy1 2:4cccdc792719 51 //void transform(int *acc, int *angle);
zollecy1 3:795998b31c32 52 void filterAcc(int array[3][30],int index, double *target);
zollecy1 3:795998b31c32 53 void filterGyro(int array[3][30],int index, double *target);
zollecy1 3:795998b31c32 54 void filterSpeed(double *array, double *target);
zollecy1 3:795998b31c32 55 void run();
zollecy1 1:48e219526d0f 56
zollecy1 0:313fbc3a198a 57
zollecy1 1:48e219526d0f 58
zollecy1 3:795998b31c32 59 Thread thread;
zollecy1 3:795998b31c32 60 Timer timer;
zollecy1 3:795998b31c32 61
zollecy1 3:795998b31c32 62 int array_acc[3][30]; //Matrix periodiv Sensor Data
zollecy1 3:795998b31c32 63 int array_gyro[3][30]; //Matrix periodiv Sensor Data
zollecy1 3:795998b31c32 64 int counter; //count Matrix records
zollecy1 3:795998b31c32 65 bool periodic_task; //boolean periodic condition
zollecy1 3:795998b31c32 66
zollecy1 1:48e219526d0f 67
zollecy1 3:795998b31c32 68 int buf_acc[3];
zollecy1 3:795998b31c32 69 int buf_gyro[3];
zollecy1 3:795998b31c32 70 double acc[3];
zollecy1 3:795998b31c32 71 double gyro[3];
zollecy1 3:795998b31c32 72 double acc_old[3];
zollecy1 3:795998b31c32 73 double gyro_old[3];
zollecy1 3:795998b31c32 74 double speed[3];
zollecy1 3:795998b31c32 75 double speed_old[3];
zollecy1 3:795998b31c32 76 double angle[3];
zollecy1 3:795998b31c32 77 double pos[3];
zollecy1 3:795998b31c32 78 double t[30];
zollecy1 3:795998b31c32 79 double t_old;
zollecy1 1:48e219526d0f 80
zollecy1 0:313fbc3a198a 81
zollecy1 0:313fbc3a198a 82 };
zollecy1 0:313fbc3a198a 83
zollecy1 0:313fbc3a198a 84
zollecy1 0:313fbc3a198a 85
zollecy1 0:313fbc3a198a 86 #endif