Browse Source

ArduCopter: add Airspeed support

gps-1.3.1
Joshua Henderson 3 years ago committed by Andrew Tridgell
parent
commit
b917a71431
  1. 3
      ArduCopter/AP_Arming.cpp
  2. 10
      ArduCopter/GCS_Mavlink.cpp
  3. 4
      ArduCopter/system.cpp

3
ArduCopter/AP_Arming.cpp

@ -62,6 +62,9 @@ bool AP_Arming_Copter::run_pre_arm_checks(bool display_failure) @@ -62,6 +62,9 @@ bool AP_Arming_Copter::run_pre_arm_checks(bool display_failure)
& gcs_failsafe_check(display_failure)
& winch_checks(display_failure)
& alt_checks(display_failure)
#if AP_AIRSPEED_ENABLED
& AP_Arming::airspeed_checks(display_failure)
#endif
& AP_Arming::pre_arm_checks(display_failure);
}

10
ArduCopter/GCS_Mavlink.cpp

@ -195,6 +195,16 @@ void GCS_MAVLINK_Copter::send_nav_controller_output() const @@ -195,6 +195,16 @@ void GCS_MAVLINK_Copter::send_nav_controller_output() const
float GCS_MAVLINK_Copter::vfr_hud_airspeed() const
{
#if AP_AIRSPEED_ENABLED
// airspeed sensors are best. While the AHRS airspeed_estimate
// will use an airspeed sensor, that value is constrained by the
// ground speed. When reporting we should send the true airspeed
// value if possible:
if (copter.airspeed.enabled() && copter.airspeed.healthy()) {
return copter.airspeed.get_airspeed();
}
#endif
Vector3f airspeed_vec_bf;
if (AP::ahrs().airspeed_vector_true(airspeed_vec_bf)) {
// we are running the EKF3 wind estimation code which can give

4
ArduCopter/system.cpp

@ -111,6 +111,10 @@ void Copter::init_ardupilot() @@ -111,6 +111,10 @@ void Copter::init_ardupilot()
AP::compass().set_log_bit(MASK_LOG_COMPASS);
AP::compass().init();
#if AP_AIRSPEED_ENABLED
airspeed.set_log_bit(MASK_LOG_IMU);
#endif
#if AC_OAPATHPLANNER_ENABLED == ENABLED
g2.oa.init();
#endif

Loading…
Cancel
Save