mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-08 02:57:16 +08:00
Copter: make AutoTune object private state to ModeAutoTune
This commit is contained in:
committed by
Peter Barker
parent
c0017abb63
commit
1e0f106ed4
@@ -918,7 +918,6 @@ private:
|
||||
ModeAuto mode_auto;
|
||||
#endif
|
||||
#if AUTOTUNE_ENABLED == ENABLED
|
||||
AutoTune autotune;
|
||||
ModeAutoTune mode_autotune;
|
||||
#endif
|
||||
#if MODE_BRAKE_ENABLED == ENABLED
|
||||
|
||||
@@ -1084,7 +1084,7 @@ ParametersG2::ParametersG2(void)
|
||||
,user_parameters()
|
||||
#endif
|
||||
#if AUTOTUNE_ENABLED == ENABLED
|
||||
,autotune_ptr(&copter.autotune)
|
||||
,autotune_ptr(&copter.mode_autotune.autotune)
|
||||
#endif
|
||||
#if MODE_SYSTEMID_ENABLED == ENABLED
|
||||
,mode_systemid_ptr(&copter.mode_systemid)
|
||||
|
||||
@@ -548,6 +548,9 @@ protected:
|
||||
|
||||
class ModeAutoTune : public Mode {
|
||||
|
||||
// ParametersG2 sets a pointer within our autotune object:
|
||||
friend class ParametersG2;
|
||||
|
||||
public:
|
||||
// inherit constructor
|
||||
using Mode::Mode;
|
||||
@@ -569,6 +572,11 @@ protected:
|
||||
|
||||
const char *name() const override { return "AUTOTUNE"; }
|
||||
const char *name4() const override { return "ATUN"; }
|
||||
|
||||
private:
|
||||
|
||||
AutoTune autotune;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -125,28 +125,28 @@ bool AutoTune::position_ok()
|
||||
*/
|
||||
bool ModeAutoTune::init(bool ignore_checks)
|
||||
{
|
||||
return copter.autotune.init();
|
||||
return autotune.init();
|
||||
}
|
||||
|
||||
|
||||
void ModeAutoTune::run()
|
||||
{
|
||||
copter.autotune.run();
|
||||
autotune.run();
|
||||
}
|
||||
|
||||
void ModeAutoTune::save_tuning_gains()
|
||||
{
|
||||
copter.autotune.save_tuning_gains();
|
||||
autotune.save_tuning_gains();
|
||||
}
|
||||
|
||||
void ModeAutoTune::stop()
|
||||
{
|
||||
copter.autotune.stop();
|
||||
autotune.stop();
|
||||
}
|
||||
|
||||
void ModeAutoTune::reset()
|
||||
{
|
||||
copter.autotune.reset();
|
||||
autotune.reset();
|
||||
}
|
||||
|
||||
#endif // AUTOTUNE_ENABLED == ENABLED
|
||||
|
||||
Reference in New Issue
Block a user