Code refactoring

This commit is contained in:
2024-01-27 21:35:57 +07:00
parent 2aa9648dd4
commit fa0a664e43
14 changed files with 57 additions and 40 deletions

View File

@@ -16,7 +16,8 @@ struct MpuData {
class Sensors {
public:
Sensors(Barometer *barometer, MPU *mpu, Kalman2DFilter *filter, BatteryController *battery, bool loop_on_fail = true);
Sensors(Barometer *barometer, MPU *mpu, Kalman2DFilter *filter,
BatteryController *battery, bool loop_on_fail = true);
~Sensors();
@@ -42,9 +43,9 @@ class Sensors {
Kalman2DFilter *_2d_filter = nullptr;
/* cached filtered values */
float _flightHeightFromBarometer = NAN;
float _zVelocityAltitude = NAN;
MpuData _mpuData = { NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN };
float _flightHeightFromBarometer = 0.f;
float _zVelocityAltitude = 0.f;
MpuData _mpuData = { 0.f };
static constexpr const char *_tag = "Sensors";