From 6a06efa8d7931dd699972744e618faa954deaed3 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 15 Nov 2024 12:37:11 +1100 Subject: [PATCH] ArduPlane: add _cm to get_vector_from_origin_NEU ... and the _NE equivalent. Moves us closer to using metres in interfaces. Several places already *0.01 the result of these methods --- ArduPlane/mode_qloiter.cpp | 2 +- ArduPlane/mode_thermal.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduPlane/mode_qloiter.cpp b/ArduPlane/mode_qloiter.cpp index e51f0222263..9fbb54ccb33 100644 --- a/ArduPlane/mode_qloiter.cpp +++ b/ArduPlane/mode_qloiter.cpp @@ -54,7 +54,7 @@ void ModeQLoiter::run() if (last_pos_set_ms != 0 && now - last_pos_set_ms < precland_timeout_ms) { // we have an active landing target override Vector2f rel_origin; - if (plane.next_WP_loc.get_vector_xy_from_origin_NE(rel_origin)) { + if (plane.next_WP_loc.get_vector_xy_from_origin_NE_cm(rel_origin)) { quadplane.pos_control->set_pos_desired_NE_cm(rel_origin); last_target_loc_set_ms = 0; } diff --git a/ArduPlane/mode_thermal.cpp b/ArduPlane/mode_thermal.cpp index d592c6de15f..3ce4ce02f08 100644 --- a/ArduPlane/mode_thermal.cpp +++ b/ArduPlane/mode_thermal.cpp @@ -60,8 +60,8 @@ void ModeThermal::update_soaring() AP_Mission::Mission_Command prev_nav_cmd; if (!(plane.mission.get_next_nav_cmd(plane.mission.get_prev_nav_cmd_with_wp_index(), prev_nav_cmd) && - prev_nav_cmd.content.location.get_vector_xy_from_origin_NE(prev_wp) && - current_nav_cmd.content.location.get_vector_xy_from_origin_NE(next_wp))) { + prev_nav_cmd.content.location.get_vector_xy_from_origin_NE_cm(prev_wp) && + current_nav_cmd.content.location.get_vector_xy_from_origin_NE_cm(next_wp))) { prev_wp.zero(); next_wp.zero(); }