MAV'RIC
|
Public Types | |
enum | update_status_t { MISSION_FAILED = -1, MISSION_IN_PROGRESS = 0, MISSION_FINISHED = 1 } |
Public Member Functions | |
virtual bool | can_handle (const Waypoint &wpt) const =0 |
Checks if the handler is able to handle the request. | |
virtual bool | setup (const Waypoint &wpt)=0 |
Sets up this handler class for a first time initialization. | |
virtual update_status_t | update ()=0 |
Handles the mission every iteration. | |
virtual Mission_planner::internal_state_t | handler_mission_state () const =0 |
Gets the mission state of this handler. |
virtual bool Mission_handler::can_handle | ( | const Waypoint & | wpt | ) | const [pure virtual] |
Checks if the handler is able to handle the request.
This must be defined in the subclasses. It should perform a check on the inputted waypoint and return true or false if this is the appropriate handler for the waypoint.
wpt | The waypoint class |
Implemented in Mission_handler_landing, Mission_handler_navigating, Mission_handler_critical_navigating, Mission_handler_hold_position, Mission_handler_takeoff, Mission_handler_critical_landing, Mission_handler_on_ground, and Mission_handler_manual.
virtual Mission_planner::internal_state_t Mission_handler::handler_mission_state | ( | ) | const [pure virtual] |
Gets the mission state of this handler.
All mission handlers are required to suggest a mission state. The choices can be one of the follow: STANDBY (drone is on ground and standing by) PREMISSION (takeoff) MISSION (executing mission waypoint) POSTMISSION (landing) PAUSED (should not be selected) Child classes should implement this function to return one of these states.
Implemented in Mission_handler_landing, Mission_handler_navigating, Mission_handler_hold_position, Mission_handler_takeoff, Mission_handler_on_ground, and Mission_handler_manual.
virtual bool Mission_handler::setup | ( | const Waypoint & | wpt | ) | [pure virtual] |
Sets up this handler class for a first time initialization.
This must be defined in the subclasses. It should perform initial setup. For example, setting the hold position to the current position of the drone, that way it is not done every iteration.
wpt | The waypoint class |
Implemented in Mission_handler_landing, Mission_handler_navigating, Mission_handler_hold_position, Mission_handler_takeoff, Mission_handler_on_ground, and Mission_handler_manual.
virtual update_status_t Mission_handler::update | ( | ) | [pure virtual] |
Handles the mission every iteration.
This must be defined in the subclasses. It should perform routine checks and code that needs to be done every iteration The effective goal of the handle function is to set some command that will have the drone achieve the mission item.
Implemented in Mission_handler_landing, Mission_handler_navigating, Mission_handler_hold_position, Mission_handler_takeoff, Mission_handler_on_ground, and Mission_handler_manual.