Plane: use axis specific tuning controller error

this gives user feedback on the axis they are tuning
This commit is contained in:
Andrew Tridgell 2016-06-01 17:19:33 +10:00
parent b4bdfa2451
commit b17c800f44

View File

@ -270,24 +270,29 @@ void AP_Tuning_Plane::reload_value(uint8_t parm)
*/
float AP_Tuning_Plane::controller_error(uint8_t parm)
{
if (!plane.quadplane.available()) {
return 0;
}
switch(parm) {
// special handling of dual-parameters
case TUNING_RATE_ROLL_PI:
case TUNING_RATE_ROLL_P:
case TUNING_RATE_ROLL_I:
case TUNING_RATE_ROLL_D:
return plane.quadplane.attitude_control->control_monitor_rms_output_roll();
case TUNING_RATE_PITCH_PI:
case TUNING_RATE_PITCH_P:
case TUNING_RATE_PITCH_I:
case TUNING_RATE_PITCH_D:
return plane.quadplane.attitude_control->control_monitor_rms_output_pitch();
case TUNING_RATE_YAW_PI:
case TUNING_RATE_YAW_P:
case TUNING_RATE_YAW_I:
case TUNING_RATE_YAW_D:
if (!plane.quadplane.available()) {
return 0;
}
return plane.quadplane.attitude_control->control_monitor_rms_output();
return plane.quadplane.attitude_control->control_monitor_rms_output_yaw();
default:
// no special handler