diff --git a/ArduPlane/GCS_Mavlink.cpp b/ArduPlane/GCS_Mavlink.cpp index 988220a93c..a4fbf0317b 100644 --- a/ArduPlane/GCS_Mavlink.cpp +++ b/ArduPlane/GCS_Mavlink.cpp @@ -371,7 +371,7 @@ void Plane::send_nav_controller_output(mavlink_channel_t chan) nav_controller->target_bearing_cd() * 0.01f, auto_state.wp_distance, altitude_error_cm * 0.01f, - airspeed_error_cm, + airspeed_error * 100, nav_controller->crosstrack_error()); } diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 09f8c49c83..4b006860d0 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -359,8 +359,8 @@ private: // Also used for flap deployment criteria. Centimeters per second. int32_t target_airspeed_cm; - // The difference between current and desired airspeed. Used in the pitch controller. Centimeters per second. - float airspeed_error_cm; + // The difference between current and desired airspeed. Used in the pitch controller. Meters per second. + float airspeed_error; // An amount that the airspeed should be increased in auto modes based on the user positioning the // throttle stick in the top half of the range. Centimeters per second. diff --git a/ArduPlane/navigation.cpp b/ArduPlane/navigation.cpp index a47cdbb759..c2bc58c1a1 100644 --- a/ArduPlane/navigation.cpp +++ b/ArduPlane/navigation.cpp @@ -143,7 +143,7 @@ void Plane::calc_airspeed_errors() // use the TECS view of the target airspeed for reporting, to take // account of the landing speed - airspeed_error_cm = SpdHgt_Controller->get_target_airspeed()*100 - airspeed_measured_cm; + airspeed_error = SpdHgt_Controller->get_target_airspeed() - airspeed_measured_cm * 0.01f; } void Plane::calc_gndspeed_undershoot()