Better routing
This commit is contained in:
@@ -18,24 +18,43 @@ struct ReportedDeviceState {
|
||||
};
|
||||
|
||||
struct FlightParams {
|
||||
float height; // [cm]
|
||||
float yaw; // [degrees]
|
||||
float pitch; // [degrees]
|
||||
float height; // [cm]
|
||||
float yaw; // [degrees]
|
||||
float pitch; // [degrees]
|
||||
};
|
||||
|
||||
struct PidSettings {
|
||||
float p;
|
||||
float i;
|
||||
float d;
|
||||
};
|
||||
|
||||
class FlightController {
|
||||
public:
|
||||
FlightController(Sensors *sensors, PIDController *pid1, PIDController *pid2, PIDController *pid3, bool unlimitedBattery = false);
|
||||
FlightController(Sensors *sensors, PIDController *pid1, PIDController *pid2,
|
||||
PIDController *pid3, bool unlimitedBattery = false);
|
||||
~FlightController();
|
||||
ReportedDeviceState currentDeviceState() const;
|
||||
void startTakeoff(OnMeasuringFinishedCb onTakeoffStarted);
|
||||
void startTakeoff();
|
||||
void startBoarding();
|
||||
void startImuCalibration();
|
||||
void tick();
|
||||
[[deprecated]] void moveToFlightHeight(float newFlightHeight); //[cm]
|
||||
[[deprecated]] void newFlightHeightStickPosition(int16_t newFlightHeightStickPostition);
|
||||
[[deprecated]] void newYawStickPosition(int16_t newYawStickPostition);
|
||||
[[deprecated]] void newPitchStickPosition(int16_t newPitchStickPostition);
|
||||
void newRotor1Duty(uint32_t rotor1Duty);
|
||||
void newRotor2Duty(uint32_t rotor2Duty);
|
||||
void newRotor3Duty(uint32_t rotor3Duty);
|
||||
void stopAllRotors();
|
||||
void setPid1Params(float p, float i, float d);
|
||||
void setPid2Params(float p, float i, float d);
|
||||
void setPid3Params(float p, float i, float d);
|
||||
PidSettings *pidSettings() const;
|
||||
private:
|
||||
void _updateBatteryCharge();
|
||||
void _takeoff();
|
||||
void _boarding();
|
||||
[[deprecated]] void _takeoff();
|
||||
[[deprecated]] void _boarding();
|
||||
|
||||
Sensors *_sensors = nullptr;
|
||||
PIDController *_pid1 = nullptr;
|
||||
@@ -50,5 +69,5 @@ class FlightController {
|
||||
static constexpr float _defaultHorizontAngle = 90.f; // [degrees]
|
||||
static constexpr float _defaultStopMotorHeight = 5; // [cm]
|
||||
|
||||
bool _unlimitedBattery = false; // for debug purposes
|
||||
bool _unlimitedBattery = false; // for debug purposes
|
||||
};
|
||||
Reference in New Issue
Block a user