From 317457ec1ab8da5e2a495740dc93d70d0227aa62 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 11 May 2022 13:56:07 +1000 Subject: [PATCH] ArduSub: support *10 multipler when storing/retrieving radius in NAV_LOITER_TURNS --- ArduSub/commands_logic.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArduSub/commands_logic.cpp b/ArduSub/commands_logic.cpp index 70a006cdc0..8d49c3eb43 100644 --- a/ArduSub/commands_logic.cpp +++ b/ArduSub/commands_logic.cpp @@ -353,7 +353,10 @@ void Sub::do_circle(const AP_Mission::Mission_Command& cmd) } // calculate radius - uint8_t circle_radius_m = HIGHBYTE(cmd.p1); // circle radius held in high byte of p1 + uint16_t circle_radius_m = HIGHBYTE(cmd.p1); // circle radius held in high byte of p1 + if (cmd.type_specific_bits & (1U << 0)) { + circle_radius_m *= 10; + } // move to edge of circle (verify_circle) will ensure we begin circling once we reach the edge auto_circle_movetoedge_start(circle_center, circle_radius_m);