branch for tests with T265

Dependencies:   Lib_Cntrl AHRS Lib_Misc

Committer:
altb2
Date:
Mon Oct 21 17:16:11 2019 +0000
Revision:
2:e7874762cc25
Parent:
Sources/Data_Logger.h@1:d8c9f6b16279
Added additional Ekfs, tested AltHold (still some bugs, Problems at high Lift Rates)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
altb2 1:d8c9f6b16279 1 #ifndef DATA_LOGGER_H_
altb2 1:d8c9f6b16279 2 #define DATA_LOGGER_H_
altb2 1:d8c9f6b16279 3
altb2 1:d8c9f6b16279 4 #include <SDBlockDevice.h>
altb2 1:d8c9f6b16279 5 #include <FATFileSystem.h>
altb2 1:d8c9f6b16279 6 #include "data_structs.h"
altb2 1:d8c9f6b16279 7 #include "Signal.h"
altb2 1:d8c9f6b16279 8
altb2 1:d8c9f6b16279 9 extern DATA_Xchange data;
altb2 1:d8c9f6b16279 10 extern Serial pc;
altb2 1:d8c9f6b16279 11
altb2 1:d8c9f6b16279 12 // Data-logger Class
altb2 1:d8c9f6b16279 13 // log Data on SD-card
altb2 1:d8c9f6b16279 14 class Data_Logger
altb2 1:d8c9f6b16279 15 {
altb2 1:d8c9f6b16279 16 public:
altb2 1:d8c9f6b16279 17 Data_Logger(uint8_t,float); // constructor
altb2 1:d8c9f6b16279 18 virtual ~Data_Logger(); // destructor
altb2 1:d8c9f6b16279 19 void close_file(void); // closes datafile
altb2 1:d8c9f6b16279 20 void start_logging(void);
altb2 1:d8c9f6b16279 21 void stop_logging(void);
altb2 1:d8c9f6b16279 22 void pause_logging(void);
altb2 1:d8c9f6b16279 23 void continue_logging(void);
altb2 1:d8c9f6b16279 24 float data_vector[50]; // this is the data vector, where output is stored
altb2 1:d8c9f6b16279 25 bool log_is_active; // ...
altb2 1:d8c9f6b16279 26
altb2 1:d8c9f6b16279 27 private:
altb2 1:d8c9f6b16279 28 SDBlockDevice sd; // SD-card
altb2 1:d8c9f6b16279 29 FILE *fp; // file pointer
altb2 1:d8c9f6b16279 30 FATFileSystem fs; // File system
altb2 1:d8c9f6b16279 31 uint16_t log_number; // ff-Number of logging file
altb2 1:d8c9f6b16279 32 bool file_is_open; // bool
altb2 1:d8c9f6b16279 33 uint8_t nb_cols; // number of columns
altb2 1:d8c9f6b16279 34 Signal signal;
altb2 1:d8c9f6b16279 35 Thread thread;
altb2 1:d8c9f6b16279 36 Ticker ticker;
altb2 1:d8c9f6b16279 37 Mutex mutex;
altb2 1:d8c9f6b16279 38 void sendSignal();
altb2 1:d8c9f6b16279 39 void write_line(); // write line to file
altb2 1:d8c9f6b16279 40 Timer ti; // timer for timestamp
altb2 1:d8c9f6b16279 41 float Ts;
altb2 1:d8c9f6b16279 42 };
altb2 1:d8c9f6b16279 43
altb2 1:d8c9f6b16279 44
altb2 1:d8c9f6b16279 45
altb2 1:d8c9f6b16279 46 #endif
altb2 1:d8c9f6b16279 47