8 #include "FifoBuffer.h"
9 #include "HistoryBuffer.h"
11 #include "SparkFunLSM9DS1.h"
12 #include "SparkFun_Qwiic_KX13X.h"
13 #include "SparkFun_u-blox_GNSS_Arduino_Library.h"
14 #include "VoltageSensor.h"
15 #include "rocketFSM.h"
33 systime_t timeStamp_lowG;
44 systime_t timeStamp_highG;
58 systime_t timeStamp_GPS;
67 systime_t timeStamp_flaps;
78 systime_t timeStamp_barometer;
92 systime_t timeStamp_state = 0;
114 bool has_barometer_data;
122 bool has_rocketState_data;
130 bool has_voltage_data;
138 enum sensors { LOWG_IMU, HIGHG_IMU, BAROMETER, GPS };
140 #define FIFO_SIZE 1000
148 FifoBuffer<LowGData, FIFO_SIZE> lowGFifo{};
149 FifoBuffer<HighGData, FIFO_SIZE> highGFifo{};
150 FifoBuffer<GpsData, FIFO_SIZE> gpsFifo{};
151 FifoBuffer<stateData, FIFO_SIZE> stateFifo{};
152 FifoBuffer<rocketStateData<4>, FIFO_SIZE> rocketStateFifo{};
153 FifoBuffer<FlapData, FIFO_SIZE> flapFifo{};
154 FifoBuffer<VoltageData, FIFO_SIZE> voltageFifo{};
155 FifoBuffer<BarometerData, FIFO_SIZE> barometerFifo{};
158 MUTEX_DECL(dataMutex_lowG);
159 MUTEX_DECL(dataMutex_highG);
160 MUTEX_DECL(dataMutex_GPS);
161 MUTEX_DECL(dataMutex_barometer);
162 MUTEX_DECL(dataMutex_flaps);
163 MUTEX_DECL(dataMutex_rocket_state);
164 MUTEX_DECL(dataMutex_voltage);
165 MUTEX_DECL(dataMutex_state);
167 HistoryBuffer<50> altitude_history_50 = HistoryBuffer<50>();
168 HistoryBuffer<50> IMU_acceleration_history_50 = HistoryBuffer<50>();
170 HistoryBuffer<6> altitude_history_6 = HistoryBuffer<6>();
171 HistoryBuffer<6> IMU_acceleration_history_6 = HistoryBuffer<6>();
173 HistoryBuffer<6> gnc_altitude_history_6 = HistoryBuffer<6>();
174 HistoryBuffer<6> gnc_IMU_acceleration_history_6 = HistoryBuffer<6>();
180 bool pushLowGFifo(
LowGData* lowG_Data);
181 bool popLowGFifo(
LowGData* lowG_Data);
183 bool pushHighGFifo(
HighGData* highG_Data);
184 bool popHighGFifo(
HighGData* highG_Data);
186 bool pushGpsFifo(
GpsData* gps_Data);
187 bool popGpsFifo(
GpsData* gps_Data);
189 bool pushStateFifo(
stateData* state_data);
190 bool popStateFifo(
stateData* state_data);
198 bool pushFlapsFifo(
FlapData* flap_data);
199 bool popFlapsFifo(
FlapData* flap_data);
209 LSM9DS1* lowGimuPointer{};
210 QwiicKX134* highGimuPointer{};
211 MS5611* barometerPointer{};
212 SFE_UBLOX_GNSS* GPSPointer{};
223 char*
sd_file_namer(
char* inputName,
char* fileExtensionParam);
A class to hold all info for ring buffers and mutexes used for data.
Definition: dataLog.h:146
Definition: telemetry.h:113
char * sd_file_namer(char *fileName, char *fileExtensionParam)
Creates the name for a file to be written to SD card.
Definition: dataLog.cpp:95
void dataLoggerTickFunction(pointers *pointer_struct)
Construct a new thd function object to log data to the SD card.
Definition: dataLog.cpp:31
Structure for all values collected from the barometer.
Definition: dataLog.h:74
Structure for values relevant to active control flaps.
Definition: dataLog.h:65
Structure for all values collected from the gps.
Definition: dataLog.h:51
Structure for all values collected from the high g sensor.
Definition: dataLog.h:40
Structure for all values collected from the low g sensor.
Definition: dataLog.h:23
Definition: VoltageSensor.h:7
Definition: dataLog.h:208
A struct to hold all of the data that could come from any of the sensors.
Definition: dataLog.h:100
Structure for all values tracked for state estimation.
Definition: dataLog.h:85