From 8a58f5a5ebba71fc9ba818a90d3384b3596809d9 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Tue, 10 May 2016 12:44:16 -0700 Subject: [PATCH] Plane: convert airspeed_error_cmd to airspeed_error (in meters) --- ArduPlane/GCS_Mavlink.cpp | 2 +- ArduPlane/Plane.h | 4 ++-- ArduPlane/navigation.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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()