Cyrill Zoller / Mbed 2 deprecated calculate

Dependencies:   mbed X_NUCLEO_IKS01A3 Mahony_Algorithm

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CalculateData.h Source File

CalculateData.h

00001 /**
00002 |**********************************************************************;
00003 * Project           : Projektarbeit Systemtechnik PES4
00004 *
00005 * Program name      : Beispiel
00006 *
00007 * Author            : PES4 Team1
00008 *
00009 * Team              : **Team 1**
00010 *                     Fabio Bernard
00011 *                     Lukas Egli
00012 *                     Matthias Ott
00013 *                     Pascal Novacki
00014 *                     Robin Wanner
00015 *                     Vincent Vescoli
00016 *                     Cyrill Zoller
00017 *
00018 * Date created      : 20.02.2020
00019 *
00020 * Purpose           : Beispiel
00021 *
00022 |**********************************************************************;
00023 **/
00024 
00025 
00026 #ifndef CALCULATEDATA_H
00027 #define CALCULATEDATA_H
00028 
00029 #include "mbed.h"
00030 #include "XNucleoIKS01A3.h"
00031 #include "Liste.h"
00032 #include "MahonyAHRS.h"
00033 
00034 class CalculateData {
00035 
00036 public:
00037 
00038     CalculateData(PinName Pin0, PinName Pin1, PinName Pin2,
00039                     PinName Pin3, PinName Pin4, PinName Pin5, PinName Pin6); //Constructor
00040                     
00041     virtual                     ~CalculateData();                
00042     void                        enable();
00043     void                        disable();
00044     void                        getValue(Liste *list);
00045     void                        update();
00046     
00047     
00048 
00049 private:
00050 
00051     
00052     void                        integrate(float *x, float *x_old, float *y, float t, float t_old);
00053     void                        transform(int old_val[3][100], int index, float *new_val, int roll, int pitch, int yaw);
00054     void                        filterAcc(float *array);
00055     void                        filterSpeed(float *array);
00056     void                        run();
00057     void                        calibrationMag(int x,int y,int z, float *buff);
00058 
00059     
00060     
00061     Thread                      thread;
00062     Timer                       timer;
00063     MahonyAHRS                  *mahony;
00064     
00065     int                         array_acc[3][100];       //Matrix periodic Sensor Data
00066     int                         array_gyro[3][100];      //Matrix periodic Sensor Data
00067     int                         array_mag[3][100];      //Matrix periodic Sensor Data
00068     int                         counter;                //count Matrix records
00069     bool                        periodic_task;          //boolean periodic condition
00070     
00071     
00072     float                       acc[3];
00073     float                       acc_old[3];
00074     float                       speed[3];
00075     float                       speed_old[3];
00076     float                       pos[3];
00077     float                       t[100];
00078     float                       t_old;
00079   
00080     
00081 };
00082 
00083 
00084 
00085 #endif