From a2845e4222a9bf47f4a61e549a9e03e57e3b9ad2 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 10 Sep 2024 21:12:31 +0900 Subject: [PATCH] Copter: auto mode takeoff complete pos fix --- ArduCopter/mode.h | 2 +- ArduCopter/mode_auto.cpp | 2 +- ArduCopter/takeoff.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ArduCopter/mode.h b/ArduCopter/mode.h index 4c345a5eca..77d72c7073 100644 --- a/ArduCopter/mode.h +++ b/ArduCopter/mode.h @@ -15,7 +15,7 @@ class _AutoTakeoff { public: void run(); void start(float complete_alt_cm, bool terrain_alt); - bool get_position(Vector3p& completion_pos); + bool get_completion_pos(Vector3p& pos_neu_cm); bool complete; // true when takeoff is complete diff --git a/ArduCopter/mode_auto.cpp b/ArduCopter/mode_auto.cpp index f6cdec6560..d95687bf12 100644 --- a/ArduCopter/mode_auto.cpp +++ b/ArduCopter/mode_auto.cpp @@ -427,7 +427,7 @@ bool ModeAuto::wp_start(const Location& dest_loc) Vector3f stopping_point; if (_mode == SubMode::TAKEOFF) { Vector3p takeoff_complete_pos; - if (auto_takeoff.get_position(takeoff_complete_pos)) { + if (auto_takeoff.get_completion_pos(takeoff_complete_pos)) { stopping_point = takeoff_complete_pos.tofloat(); } } diff --git a/ArduCopter/takeoff.cpp b/ArduCopter/takeoff.cpp index 14fb7d39da..e31ea18710 100644 --- a/ArduCopter/takeoff.cpp +++ b/ArduCopter/takeoff.cpp @@ -239,15 +239,15 @@ void _AutoTakeoff::start(float _complete_alt_cm, bool _terrain_alt) } } -// return takeoff final position if takeoff has completed successfully -bool _AutoTakeoff::get_position(Vector3p& _complete_pos) +// return takeoff final target position in cm from the EKF origin if takeoff has completed successfully +bool _AutoTakeoff::get_completion_pos(Vector3p& pos_neu_cm) { // only provide location if takeoff has completed if (!complete) { return false; } - complete_pos = _complete_pos; + pos_neu_cm = complete_pos; return true; }