mirror of https://github.com/ArduPilot/ardupilot
AP_Mission: added contains_terrain_relative()
used in plane arming check
This commit is contained in:
parent
2d06261be3
commit
bad0120d3c
|
@ -2464,6 +2464,23 @@ bool AP_Mission::contains_item(MAV_CMD command) const
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
return true if the mission has a terrain relative item
|
||||
*/
|
||||
bool AP_Mission::contains_terrain_relative(void) const
|
||||
{
|
||||
for (int i = 1; i < num_commands(); i++) {
|
||||
Mission_Command tmp;
|
||||
if (!read_cmd_from_storage(i, tmp)) {
|
||||
continue;
|
||||
}
|
||||
if (stored_in_location(tmp.id) && tmp.content.location.terrain_alt) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// reset the mission history to prevent recalling previous mission histories after a mission restart.
|
||||
void AP_Mission::reset_wp_history(void)
|
||||
{
|
||||
|
|
|
@ -619,6 +619,9 @@ public:
|
|||
// returns true if the mission contains the requested items
|
||||
bool contains_item(MAV_CMD command) const;
|
||||
|
||||
// returns true if the mission has a terrain relative mission item
|
||||
bool contains_terrain_relative(void) const;
|
||||
|
||||
// reset the mission history to prevent recalling previous mission histories when restarting missions.
|
||||
void reset_wp_history(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue