calculate

Dependencies:   mbed X_NUCLEO_IKS01A3 Mahony_Algorithm

Committer:
zollecy1
Date:
Mon Apr 13 09:37:17 2020 +0000
Revision:
1:48e219526d0f
Parent:
0:313fbc3a198a
Child:
2:4cccdc792719
.;

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 0:313fbc3a198a 31
zollecy1 0:313fbc3a198a 32 class CalculateData {
zollecy1 0:313fbc3a198a 33
zollecy1 0:313fbc3a198a 34 public:
zollecy1 0:313fbc3a198a 35
zollecy1 0:313fbc3a198a 36 CalculateData(PinName Pin0, PinName Pin1, PinName Pin2,
zollecy1 0:313fbc3a198a 37 PinName Pin3, PinName Pin4, PinName Pin5, PinName Pin6); //Constructor
zollecy1 0:313fbc3a198a 38
zollecy1 0:313fbc3a198a 39 virtual ~CalculateData();
zollecy1 0:313fbc3a198a 40 void enable();
zollecy1 0:313fbc3a198a 41 void disable();
zollecy1 1:48e219526d0f 42 void run();
zollecy1 1:48e219526d0f 43 void getAccelerometer(int *array);
zollecy1 1:48e219526d0f 44 void getSpeed(int *array);
zollecy1 1:48e219526d0f 45 void getPosition(int *array);
zollecy1 1:48e219526d0f 46 void getGyro(int *array);
zollecy1 1:48e219526d0f 47 void getAngle(int *array);
zollecy1 1:48e219526d0f 48
zollecy1 1:48e219526d0f 49
zollecy1 1:48e219526d0f 50 int32_t acc[3];
zollecy1 1:48e219526d0f 51 int32_t acc_old[3];
zollecy1 1:48e219526d0f 52 int32_t gyro[3];
zollecy1 1:48e219526d0f 53 int32_t gyro_old[3];
zollecy1 1:48e219526d0f 54 int32_t speed[3];
zollecy1 1:48e219526d0f 55 int32_t speed_old[3];
zollecy1 1:48e219526d0f 56 int32_t angle[3];
zollecy1 1:48e219526d0f 57 int32_t pos[3];
zollecy1 1:48e219526d0f 58 int32_t t;
zollecy1 1:48e219526d0f 59 int32_t t_old;
zollecy1 1:48e219526d0f 60 int32_t acc_err[3];
zollecy1 1:48e219526d0f 61 int32_t gyro_err[3];
zollecy1 0:313fbc3a198a 62
zollecy1 0:313fbc3a198a 63 private:
zollecy1 0:313fbc3a198a 64
zollecy1 0:313fbc3a198a 65 static const float PERIOD;
zollecy1 0:313fbc3a198a 66
zollecy1 1:48e219526d0f 67 //void run();
zollecy1 1:48e219526d0f 68 void integrate(int *x, int *x_old, int *y, int t, int t_old);
zollecy1 1:48e219526d0f 69 void transform(int *acc, int *angle);
zollecy1 1:48e219526d0f 70 void filter(int *acc, int *gyro);
zollecy1 1:48e219526d0f 71
zollecy1 0:313fbc3a198a 72
zollecy1 1:48e219526d0f 73
zollecy1 1:48e219526d0f 74 Ticker ticker;
zollecy1 1:48e219526d0f 75 Timer timer;
zollecy1 1:48e219526d0f 76
zollecy1 1:48e219526d0f 77
zollecy1 0:313fbc3a198a 78
zollecy1 0:313fbc3a198a 79 };
zollecy1 0:313fbc3a198a 80
zollecy1 0:313fbc3a198a 81
zollecy1 0:313fbc3a198a 82
zollecy1 0:313fbc3a198a 83 #endif