From 997ae984448442f352681db15d67cd9b12691e08 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 26 Sep 2016 22:54:15 +0200 Subject: [PATCH] navigator: reset cruise speed when out of mission (#5494) This reset the cruise speed which can be set by mission items/waypoints to set a custom speed. Once, switched out of mission, it makes sense to use the speed set by the param again. --- src/modules/navigator/mission.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/navigator/mission.cpp b/src/modules/navigator/mission.cpp index cb6a52bb3c..63d79a8c62 100644 --- a/src/modules/navigator/mission.cpp +++ b/src/modules/navigator/mission.cpp @@ -101,6 +101,11 @@ Mission::~Mission() void Mission::on_inactive() { + /* We need to reset the mission cruising speed, otherwise the + * mission velocity which might have been set using mission items + * is used for missions such as RTL. */ + _navigator->set_cruising_speed(); + /* Without home a mission can't be valid yet anyway, let's wait. */ if (!_navigator->home_position_valid()) { return;