From 945e34639cb00b9ef3338d2e4ab52a403720043b Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 3 Dec 2019 11:34:19 +0900 Subject: [PATCH] Copter: use SID_AXIS to hide other SystemID mode params --- ArduCopter/mode.h | 2 +- ArduCopter/mode_systemid.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ArduCopter/mode.h b/ArduCopter/mode.h index dd69546d64..74cda23977 100644 --- a/ArduCopter/mode.h +++ b/ArduCopter/mode.h @@ -1217,7 +1217,7 @@ private: MIX_THROTTLE = 13, // mixer throttle axis is being excited }; - AP_Int8 axis; // Controls which axis are being excited + AP_Int8 axis; // Controls which axis are being excited. Set to non-zero to display other parameters AP_Float waveform_magnitude;// Magnitude of chirp waveform AP_Float frequency_start; // Frequency at the start of the chirp AP_Float frequency_stop; // Frequency at the end of the chirp diff --git a/ArduCopter/mode_systemid.cpp b/ArduCopter/mode_systemid.cpp index 0242d710da..5b9734c04a 100644 --- a/ArduCopter/mode_systemid.cpp +++ b/ArduCopter/mode_systemid.cpp @@ -10,10 +10,10 @@ const AP_Param::GroupInfo ModeSystemId::var_info[] = { // @Param: _AXIS // @DisplayName: System identification axis - // @Description: Controls which axis are being excited + // @Description: Controls which axis are being excited. Set to non-zero to see more parameters // @User: Standard // @Values: 0:None, 1:Input Roll Angle, 2:Input Pitch Angle, 3:Input Yaw Angle, 4:Recovery Roll Angle, 5:Recovery Pitch Angle, 6:Recovery Yaw Angle, 7:Rate Roll, 8:Rate Pitch, 9:Rate Yaw, 10:Mixer Roll, 11:Mixer Pitch, 12:Mixer Yaw, 13:Mixer Thrust - AP_GROUPINFO("_AXIS", 1, ModeSystemId, axis, 0), + AP_GROUPINFO_FLAGS("_AXIS", 1, ModeSystemId, axis, 0, AP_PARAM_FLAG_ENABLE), // @Param: _MAGNITUDE // @DisplayName: System identification Chirp Magnitude @@ -74,6 +74,12 @@ ModeSystemId::ModeSystemId(void) : Mode() // systemId_init - initialise systemId controller bool ModeSystemId::init(bool ignore_checks) { + // check if enabled + if (axis == 0) { + gcs().send_text(MAV_SEVERITY_WARNING, "No axis selected, SID_AXIS = 0"); + return false; + } + // if landed and the mode we're switching from does not have manual throttle and the throttle stick is too high if (motors->armed() && copter.ap.land_complete && !copter.flightmode->has_manual_throttle()) { return false;