commander: internalize system status bools

Most condition bools in the commander are not used anywhere but in the
commander. It therefore makes sense to move them to a different internal
struct and remove them from the vehicle_status message.

Also, the land_detected should be used by all the modules instead of
getting it through the commander and system_status.
This commit is contained in:
Julian Oes
2016-04-11 18:01:47 +02:00
parent 705979e3c7
commit 1f44fb1efd
18 changed files with 450 additions and 332 deletions
+2 -2
View File
@@ -95,7 +95,7 @@ MissionBlock::is_mission_item_reached()
case NAV_CMD_LAND: /* fall through */
case NAV_CMD_VTOL_LAND:
return _navigator->get_vstatus()->condition_landed;
return _navigator->get_land_detected()->landed;
/* TODO: count turns */
/*_mission_item.nav_cmd == NAV_CMD_LOITER_TURN_COUNT ||*/
@@ -413,7 +413,7 @@ MissionBlock::set_previous_pos_setpoint()
void
MissionBlock::set_loiter_item(struct mission_item_s *item, float min_clearance)
{
if (_navigator->get_vstatus()->condition_landed) {
if (_navigator->get_land_detected()->landed) {
/* landed, don't takeoff, but switch to IDLE mode */
item->nav_cmd = NAV_CMD_IDLE;