mirror of
https://github.com/okalachev/flix.git
synced 2026-02-18 08:02:36 +00:00
Move all global variable declarations to the appropriate subsystems
As it makes the subsystems code easier to understand. Declare the most used variables in main sketch file as forward declarations. Make all control input zero by default (except controlMode). Minor changes.
This commit is contained in:
@@ -9,16 +9,13 @@
|
||||
|
||||
#define WIFI_ENABLED 1
|
||||
|
||||
float t = NAN; // current step time, s
|
||||
float dt; // time delta from previous step, s
|
||||
float controlRoll, controlPitch, controlYaw, controlThrottle; // pilot's inputs, range [-1, 1]
|
||||
float controlMode = NAN;
|
||||
Vector gyro; // gyroscope data
|
||||
Vector acc; // accelerometer data, m/s/s
|
||||
Vector rates; // filtered angular rates, rad/s
|
||||
Quaternion attitude; // estimated attitude
|
||||
bool landed; // are we landed and stationary
|
||||
float motors[4]; // normalized motors thrust in range [0..1]
|
||||
extern float t, dt;
|
||||
extern float controlRoll, controlPitch, controlYaw, controlThrottle, controlMode;
|
||||
extern Vector gyro, acc;
|
||||
extern Vector rates;
|
||||
extern Quaternion attitude;
|
||||
extern bool landed;
|
||||
extern float motors[4];
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
Reference in New Issue
Block a user