Skip to content
Snippets Groups Projects
Commit d5aad58c authored by Alessandro Simovic's avatar Alessandro Simovic Committed by Daniel Agar
Browse files

navigator: reset vehicle_roi on mission update

parent 93553242
No related branches found
No related tags found
No related merge requests found
...@@ -448,6 +448,11 @@ Mission::update_mission() ...@@ -448,6 +448,11 @@ Mission::update_mission()
/* reset triplets */ /* reset triplets */
_navigator->reset_triplets(); _navigator->reset_triplets();
/* Reset vehicle_roi
* Missions that do not explicitly configure ROI would not override
* an existing ROI setting from previous missions */
_navigator->reset_vroi();
struct mission_s old_mission = _mission; struct mission_s old_mission = _mission;
if (orb_copy(ORB_ID(mission), _navigator->get_mission_sub(), &_mission) == OK) { if (orb_copy(ORB_ID(mission), _navigator->get_mission_sub(), &_mission) == OK) {
......
...@@ -159,6 +159,7 @@ public: ...@@ -159,6 +159,7 @@ public:
PrecLand *get_precland() { return &_precland; } /**< allow others, e.g. Mission, to use the precision land block */ PrecLand *get_precland() { return &_precland; } /**< allow others, e.g. Mission, to use the precision land block */
const vehicle_roi_s &get_vroi() { return _vroi; } const vehicle_roi_s &get_vroi() { return _vroi; }
void reset_vroi() { _vroi = {}; }
bool home_alt_valid() { return (_home_pos.timestamp > 0 && _home_pos.valid_alt); } bool home_alt_valid() { return (_home_pos.timestamp > 0 && _home_pos.valid_alt); }
bool home_position_valid() { return (_home_pos.timestamp > 0 && _home_pos.valid_alt && _home_pos.valid_hpos); } bool home_position_valid() { return (_home_pos.timestamp > 0 && _home_pos.valid_alt && _home_pos.valid_hpos); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment