From 21bcc0d2f40d307c3c88009ff5a7f13e8dbbe93e Mon Sep 17 00:00:00 2001 From: Jake Dahl Date: Fri, 7 Dec 2018 14:18:05 -0700 Subject: [PATCH] mav_cmd_do_reposition now obeys the ground speed argument --- src/modules/navigator/navigator_main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 7ec01e286a..70045453e2 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -328,7 +328,15 @@ Navigator::run() rep->current.loiter_radius = get_loiter_radius(); rep->current.loiter_direction = 1; rep->current.type = position_setpoint_s::SETPOINT_TYPE_LOITER; - rep->current.cruising_speed = get_cruising_speed(); + + // If no argument for ground speed, use default value. + if (cmd.param1 <= 0 || !PX4_ISFINITE(cmd.param1)) { + rep->current.cruising_speed = get_cruising_speed(); + + } else { + rep->current.cruising_speed = cmd.param1; + } + rep->current.cruising_throttle = get_cruising_throttle(); rep->current.acceptance_radius = get_acceptance_radius();