mirror of https://github.com/ArduPilot/ardupilot
Plane: move defualt attitude control to base class
This commit is contained in:
parent
6111e9d9db
commit
4ca071045c
|
@ -410,14 +410,7 @@ void Plane::stabilize()
|
|||
}
|
||||
#endif
|
||||
} else {
|
||||
// Direct stick mixing functionality has been removed, so as not to remove all stick mixing from the user completely
|
||||
// the old direct option is now used to enable fbw mixing, this is easier than doing a param conversion.
|
||||
if ((g.stick_mixing == StickMixing::FBW) || (g.stick_mixing == StickMixing::DIRECT_REMOVED)) {
|
||||
stabilize_stick_mixing_fbw();
|
||||
}
|
||||
stabilize_roll();
|
||||
stabilize_pitch();
|
||||
stabilize_yaw();
|
||||
plane.control_mode->run();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -200,3 +200,15 @@ bool Mode::_pre_arm_checks(size_t buflen, char *buffer) const
|
|||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void Mode::run()
|
||||
{
|
||||
// Direct stick mixing functionality has been removed, so as not to remove all stick mixing from the user completely
|
||||
// the old direct option is now used to enable fbw mixing, this is easier than doing a param conversion.
|
||||
if ((plane.g.stick_mixing == StickMixing::FBW) || (plane.g.stick_mixing == StickMixing::DIRECT_REMOVED)) {
|
||||
plane.stabilize_stick_mixing_fbw();
|
||||
}
|
||||
plane.stabilize_roll();
|
||||
plane.stabilize_pitch();
|
||||
plane.stabilize_yaw();
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
void exit();
|
||||
|
||||
// run controllers specific to this mode
|
||||
virtual void run() {};
|
||||
virtual void run();
|
||||
|
||||
// returns a unique number specific to this mode
|
||||
virtual Number mode_number() const = 0;
|
||||
|
|
Loading…
Reference in New Issue