Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Move ONE_G definition to flix.ino

Oleg Kalachev7533a9cbfade
diff --git a/flix/estimate.ino b/flix/estimate.ino
index cf63ee3..b0fae96 100644
--- a/flix/estimate.ino
+++ b/flix/estimate.ino
@@ -7,7 +7,6 @@
#include "vector.h"
#include "lpf.h"
-#define ONE_G 9.807f
#define WEIGHT_ACC 0.5f
#define RATES_LFP_ALPHA 0.2 // cutoff frequency ~ 40 Hz
diff --git a/flix/flix.ino b/flix/flix.ino
index dea10d9..34335c2 100644
--- a/flix/flix.ino
+++ b/flix/flix.ino
@@ -23,6 +23,8 @@
#define MOTOR_FRONT_RIGHT 2
#define MOTOR_FRONT_LEFT 3
+#define ONE_G 9.80665
+
float t = NAN; // current step time, s
float dt; // time delta from previous step, s
float loopRate; // loop rate, Hz
diff --git a/flix/imu.ino b/flix/imu.ino
index e9d9969..5475e9e 100644
--- a/flix/imu.ino
+++ b/flix/imu.ino
@@ -6,8 +6,6 @@
#include <SPI.h>
#include <MPU9250.h>
-#define ONE_G 9.80665
-
// NOTE: use 'ca' command to calibrate the accelerometer and put the values here
Vector accBias(0, 0, 0);
Vector accScale(1, 1, 1);
diff --git a/gazebo/flix.h b/gazebo/flix.h
index 72787f5..26cbbec 100644
--- a/gazebo/flix.h
+++ b/gazebo/flix.h
@@ -19,6 +19,8 @@
#define WIFI_ENABLED 1
+#define ONE_G 9.80665
+
float t = NAN;
float dt;
float loopRate;