mirror of
https://github.com/okalachev/flix.git
synced 2025-08-17 17:16:10 +00:00
Make motor indexes definition const int and move them to motors.ino
Remove motor indexes definitions from flix.ino Add motors.ino to simulation code and implement required mocks
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
extern PID rollRatePID, pitchRatePID, yawRatePID, rollPID, pitchPID;
|
||||
extern LowPassFilter<Vector> ratesFilter;
|
||||
extern const int MOTOR_REAR_LEFT, MOTOR_REAR_RIGHT, MOTOR_FRONT_RIGHT, MOTOR_FRONT_LEFT;
|
||||
|
||||
const char* motd =
|
||||
"\nWelcome to\n"
|
||||
|
@@ -50,6 +50,8 @@ Vector ratesTarget;
|
||||
Vector torqueTarget;
|
||||
float thrustTarget;
|
||||
|
||||
extern const int MOTOR_REAR_LEFT, MOTOR_REAR_RIGHT, MOTOR_FRONT_RIGHT, MOTOR_FRONT_LEFT;
|
||||
|
||||
void control() {
|
||||
interpretRC();
|
||||
failsafe();
|
||||
|
@@ -18,11 +18,6 @@
|
||||
#define RC_CHANNEL_ARMED 4
|
||||
#define RC_CHANNEL_MODE 5
|
||||
|
||||
#define MOTOR_REAR_LEFT 0
|
||||
#define MOTOR_REAR_RIGHT 1
|
||||
#define MOTOR_FRONT_RIGHT 2
|
||||
#define MOTOR_FRONT_LEFT 3
|
||||
|
||||
#define ONE_G 9.80665
|
||||
|
||||
float t = NAN; // current step time, s
|
||||
|
@@ -14,6 +14,12 @@
|
||||
#define PWM_MIN 0
|
||||
#define PWM_MAX 1000000 / PWM_FREQUENCY
|
||||
|
||||
// Motors array indexes:
|
||||
const int MOTOR_REAR_LEFT = 0;
|
||||
const int MOTOR_REAR_RIGHT = 1;
|
||||
const int MOTOR_FRONT_RIGHT = 2;
|
||||
const int MOTOR_FRONT_LEFT = 3;
|
||||
|
||||
void setupMotors() {
|
||||
Serial.println("Setup Motors");
|
||||
|
||||
|
Reference in New Issue
Block a user