From f26e1dc8e8e9f82ec0786867eb2319caa066b223 Mon Sep 17 00:00:00 2001 From: Peter Hall <33176108+IamPete1@users.noreply.github.com> Date: Mon, 13 May 2019 20:48:25 +0100 Subject: [PATCH] AP_WindVane: add modern devices rev p cal --- libraries/AP_WindVane/AP_WindVane_ModernDevice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/AP_WindVane/AP_WindVane_ModernDevice.cpp b/libraries/AP_WindVane/AP_WindVane_ModernDevice.cpp index b5bcc70ca8..8a892f739f 100644 --- a/libraries/AP_WindVane/AP_WindVane_ModernDevice.cpp +++ b/libraries/AP_WindVane/AP_WindVane_ModernDevice.cpp @@ -52,3 +52,10 @@ void AP_WindVane_ModernDevice::update_speed() // simplified equation from data sheet, converted from mph to m/s speed_update_frontend(24.254896f * powf((analog_voltage / powf(temp_ambient, 0.115157f)), 3.009364f)); } + +void AP_WindVane_ModernDevice::calibrate() +{ + gcs().send_text(MAV_SEVERITY_INFO, "WindVane: rev P. zero wind voltage offset set to %.1f",double(_current_analog_voltage)); + _frontend._speed_sensor_voltage_offset.set_and_save(_current_analog_voltage); + _frontend._calibration.set_and_save(0); +}