Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload mission for RTL_TYPE 2 #23855

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/modules/navigator/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ void RTL::init_rtl_mission_type()
_set_rtl_mission_type = RtlType::NONE;
}

mission_s new_mission = _mission_sub.get();

switch (new_rtl_mission_type) {
case RtlType::RTL_DIRECT_MISSION_LAND:
_rtl_mission_type_handle = new RtlDirectMissionLand(_navigator);
Expand All @@ -593,13 +595,13 @@ void RTL::init_rtl_mission_type()
break;

case RtlType::RTL_MISSION_FAST:
_rtl_mission_type_handle = new RtlMissionFast(_navigator);
_rtl_mission_type_handle = new RtlMissionFast(_navigator, new_mission);
_set_rtl_mission_type = RtlType::RTL_MISSION_FAST;
_rtl_type = RtlType::RTL_MISSION_FAST;
break;

case RtlType::RTL_MISSION_FAST_REVERSE:
_rtl_mission_type_handle = new RtlMissionFastReverse(_navigator);
_rtl_mission_type_handle = new RtlMissionFastReverse(_navigator, new_mission);
_set_rtl_mission_type = RtlType::RTL_MISSION_FAST_REVERSE;
_rtl_type = RtlType::RTL_MISSION_FAST_REVERSE;
break;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/navigator/rtl_mission_fast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@

static constexpr int32_t DEFAULT_MISSION_FAST_CACHE_SIZE = 5;

RtlMissionFast::RtlMissionFast(Navigator *navigator) :
RtlMissionFast::RtlMissionFast(Navigator *navigator, mission_s mission) :
RtlBase(navigator, DEFAULT_MISSION_FAST_CACHE_SIZE)
{

_mission = mission;
}

void RtlMissionFast::on_inactive()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/navigator/rtl_mission_fast.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Navigator;
class RtlMissionFast : public RtlBase
{
public:
RtlMissionFast(Navigator *navigator);
RtlMissionFast(Navigator *navigator, mission_s mission);
~RtlMissionFast() = default;

void on_activation() override;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/navigator/rtl_mission_fast_reverse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@

static constexpr int32_t DEFAULT_MISSION_FAST_REVERSE_CACHE_SIZE = 5;

RtlMissionFastReverse::RtlMissionFastReverse(Navigator *navigator) :
RtlMissionFastReverse::RtlMissionFastReverse(Navigator *navigator, mission_s mission) :
RtlBase(navigator, -DEFAULT_MISSION_FAST_REVERSE_CACHE_SIZE)
{

_mission = mission;
}

void RtlMissionFastReverse::on_inactive()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/navigator/rtl_mission_fast_reverse.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Navigator;
class RtlMissionFastReverse : public RtlBase
{
public:
RtlMissionFastReverse(Navigator *navigator);
RtlMissionFastReverse(Navigator *navigator, mission_s mission);
~RtlMissionFastReverse() = default;

void on_activation() override;
Expand Down
Loading