Copter: Add expected value to message

This commit is contained in:
murata 2018-12-23 18:37:34 +09:00 committed by Randy Mackay
parent 2822fa68fc
commit 04b0a8a62a

View File

@ -487,8 +487,9 @@ bool AP_Arming_Copter::proximity_checks(bool display_failure) const
float angle_deg, distance; float angle_deg, distance;
if (copter.avoid.proximity_avoidance_enabled() && copter.g2.proximity.get_closest_object(angle_deg, distance)) { if (copter.avoid.proximity_avoidance_enabled() && copter.g2.proximity.get_closest_object(angle_deg, distance)) {
// display error if something is within 60cm // display error if something is within 60cm
if (distance <= 0.6f) { const float tolerance = 0.6f;
check_failed(ARMING_CHECK_PARAMETERS, display_failure, "Proximity %d deg, %4.2fm", (int)angle_deg, (double)distance); if (distance <= tolerance) {
check_failed(ARMING_CHECK_PARAMETERS, display_failure, "Proximity %d deg, %4.2fm (want <= %0.2fm)", (int)angle_deg, (double)distance, (double)tolerance);
return false; return false;
} }
} }