Browse Source

Plane: convert airspeed_error_cmd to airspeed_error (in meters)

master
Tom Pittenger 9 years ago
parent
commit
8a58f5a5eb
  1. 2
      ArduPlane/GCS_Mavlink.cpp
  2. 4
      ArduPlane/Plane.h
  3. 2
      ArduPlane/navigation.cpp

2
ArduPlane/GCS_Mavlink.cpp

@ -371,7 +371,7 @@ void Plane::send_nav_controller_output(mavlink_channel_t chan) @@ -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());
}

4
ArduPlane/Plane.h

@ -359,8 +359,8 @@ private: @@ -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.

2
ArduPlane/navigation.cpp

@ -143,7 +143,7 @@ void Plane::calc_airspeed_errors() @@ -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()

Loading…
Cancel
Save