MAV'RIC
Public Types | Public Member Functions
Mission_handler Class Reference
Inheritance diagram for Mission_handler:
Inheritance graph
[legend]
Collaboration diagram for Mission_handler:
Collaboration graph
[legend]

List of all members.

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.

Member Function Documentation

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.

Parameters:
wptThe waypoint class
Returns:
Can handle

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.

Returns:
Mission handler's mission state

Implemented in Mission_handler_landing, Mission_handler_navigating, Mission_handler_hold_position, Mission_handler_takeoff, Mission_handler_on_ground, and Mission_handler_manual.

Here is the caller graph for this function:

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.

Parameters:
wptThe waypoint class
Returns:
Success

Implemented in Mission_handler_landing, Mission_handler_navigating, Mission_handler_hold_position, Mission_handler_takeoff, Mission_handler_on_ground, and Mission_handler_manual.

Here is the caller graph for this function:

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.

Returns:
Update status code

Implemented in Mission_handler_landing, Mission_handler_navigating, Mission_handler_hold_position, Mission_handler_takeoff, Mission_handler_on_ground, and Mission_handler_manual.

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines