navigator: reset vehicle_roi on mission update

This commit is contained in:
Alessandro Simovic 2019-02-21 16:35:55 +01:00 committed by Daniel Agar
parent 9355324209
commit d5aad58c92
2 changed files with 6 additions and 0 deletions

View File

@ -448,6 +448,11 @@ Mission::update_mission()
/* 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;
if (orb_copy(ORB_ID(mission), _navigator->get_mission_sub(), &_mission) == OK) {

View File

@ -159,6 +159,7 @@ public:
PrecLand *get_precland() { return &_precland; } /**< allow others, e.g. Mission, to use the precision land block */
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_position_valid() { return (_home_pos.timestamp > 0 && _home_pos.valid_alt && _home_pos.valid_hpos); }