PX4/Firmware — pull request #1046 by julianoes (2014-06-06 21:36:55+00:00)
Title: Navigator Rewrite

#### Overview

This navigator rewrite aims to consolidate the tasks of commander versus navigator. It is now written in the way that it was initially proposed:

- Commander:
- Watch vehicle status, inputs, sensors, etc.
- React to errors and human input (e.g. using a fail-safe state machine)
- Set navigation mode for navigator

- Navigator:
- Listen to navigation mode set by commander
- Set position setpoints according to navigation mode (Misison, Loiter, RTL, etc.)

The state machine in the navigator is gone. However, it might someday replace the if/else failsafe logic (bool and enum hell) currently implemented in the commander.

The main work was to split the navigation modes into separate classes. This should make it easy for developers to add custom flight modes in the future. All that is needed is a new class for the navigation and a (new) mode from the commander going with it.

#### Features

- Land/in-air detection for FW added
- RTL does not trigger when landed
- RTL on RC loss is not triggered during mission but when the mission is finished
- Switching to loiter after a mission is finished does not move the loiter center
- Switching to loiter after RTL (without landing) does not move the loiter center
- Loiter is triggered when WPs can not be read from SD card

#### Todo:

- MC HIL Testing
- MC Testing
- FW Testing

- Autocontinue (not added yet)
- Autoland (might work but probably does not)