PID controllers hierarchy revision
This commit is contained in:
20
src/main.cpp
20
src/main.cpp
@@ -11,14 +11,18 @@ static Application *app = nullptr;
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
app = new Application(new FlightDispatcher(
|
||||
new BluetoothDispatcher(new BluetoothSerial()),
|
||||
new FlightController(
|
||||
new Sensors(new Barometer(new GyverBME280(i2c)),
|
||||
new MPU(new MPU6050(MPU6050_DEFAULT_ADDRESS, &i2c)), new Kalman2DFilter(10.f, 1.f, 1.8f),
|
||||
new BatteryController(BATTERY_DATA_PIN, BATTERY_DATA_SWITCH_PIN)),
|
||||
new PIDController(1.f, 1.f, 1.f, new BrushedMotor(1, 2, 3, 4, 1), 1),
|
||||
new PIDController(1.f, 1.f, 1.f, new BrushedMotor(1, 2, 3, 4, 2), 2),
|
||||
new PIDController(1.f, 1.f, 1.f, new BrushedMotor(1, 2, 3, 4, 3), 3), true)));
|
||||
new BluetoothDispatcher(new BluetoothSerial()),
|
||||
new FlightController(
|
||||
new Sensors(new Barometer(new GyverBME280(i2c)),
|
||||
new MPU(new MPU6050(MPU6050_DEFAULT_ADDRESS, &i2c)),
|
||||
new Kalman2DFilter(10.f, 1.f, 1.8f),
|
||||
new BatteryController(BATTERY_DATA_PIN, BATTERY_DATA_SWITCH_PIN)),
|
||||
new SavedPidRegulator(3.5f, 0.0015f, 0.01f, "HeightController"), // height
|
||||
new SavedPidRegulator(2.f, 12.f, 0.f, "YawController"), // yaw
|
||||
new BrushedMotor(1, 2, 3, 4, 1),
|
||||
new BrushedMotor(1, 2, 3, 4, 1),
|
||||
new PIDController(0.6f, 3.5f, 0.03f, new BrushedMotor(1, 2, 3, 4, 3), "RollController"), // pitch
|
||||
true)));
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user