MAV'RIC
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes
Mavlink_waypoint_handler Class Reference
Inheritance diagram for Mavlink_waypoint_handler:
Inheritance graph
[legend]
Collaboration diagram for Mavlink_waypoint_handler:
Collaboration graph
[legend]

List of all members.

Classes

struct  conf_t

Public Member Functions

 Mavlink_waypoint_handler (const INS &ins, Mavlink_message_handler &message_handler, const Mavlink_stream &mavlink_stream, Mission_handler_registry &mission_handler_registry, conf_t config=default_config())
 Initialize the waypoint handler.
bool init ()
uint16_t waypoint_count () const
 Returns the number of waypoints.
uint64_t waypoint_received_time_ms () const
 Returns the time that the waypoint list was received.
const Waypointcurrent_waypoint () const
 Gets the current waypoint.
const Waypointnext_waypoint () const
 Gets the next waypoint if available.
const Waypointwaypoint_from_index (int i) const
 Returns a waypoint from the list from a specific index.
const Waypointhome_waypoint () const
 Returns the home waypoint.
void advance_to_next_waypoint ()
 Sets the next waypoint as the current one. Should be called when the current waypoint has been reached.
uint16_t current_waypoint_index () const
 Gets the current waypoint index.
bool set_current_waypoint_index (int index)
 Sets the current waypoint index if possible.

Static Public Member Functions

static conf_t default_config ()
 Default configuration.

Protected Attributes

Waypoint waypoint_list_ [MAX_WAYPOINTS]
 The array of all waypoints (max MAX_WAYPOINTS)
uint16_t waypoint_count_
 The total number of waypoints.
uint16_t current_waypoint_index_
 The current waypoint index.
Waypoint home_waypoint_
 The home waypoint.
const Mavlink_streammavlink_stream_
 The reference to MAVLink stream object.
const INSins_
 The pointer to the position estimation structure.
Mavlink_message_handlermessage_handler_
 The reference to the mavlink message handler.
Mission_handler_registrymission_handler_registry_
 The reference to the mission handler registry.

Constructor & Destructor Documentation

Mavlink_waypoint_handler::Mavlink_waypoint_handler ( const INS ins,
Mavlink_message_handler message_handler,
const Mavlink_stream mavlink_stream,
Mission_handler_registry mission_handler_registry,
conf_t  config = default_config() 
)

Initialize the waypoint handler.

Parameters:
insThe reference to the Inertial Navigation System
message_handlerThe reference to the message handler
mavlink_streamThe reference to the MAVLink stream structure
mission_handler_registryThe reference to the mission handler registry
configThe config structure (optional)
Returns:
True if the init succeed, false otherwise

Member Function Documentation

Gets the current waypoint.

If there is no waypoints in the list, creates a hold position waypoint as the first index in the list and returns it

Returns:
current waypoint

Here is the call graph for this function:

Here is the caller graph for this function:

Gets the current waypoint index.

Returns:
Current waypoint index

Here is the caller graph for this function:

Default configuration.

Returns:
Config structure

Returns the home waypoint.

Recreates the home waypoint if it has not been manually set as the takeoff altitude could have changed from the onboard parameters

Returns:
Home

Here is the caller graph for this function:

Gets the next waypoint if available.

If there is no waypoints in the list, creates a hold position waypoint as the first index in the list and returns it

Returns:
next waypoint

Here is the call graph for this function:

Sets the current waypoint index if possible.

Parameters:
indexThe new waypoint index
Returns:
Success

Here is the caller graph for this function:

uint16_t Mavlink_waypoint_handler::waypoint_count ( ) const [inline]

Returns the number of waypoints.

Returns:
number of waypoints

Here is the caller graph for this function:

Returns a waypoint from the list from a specific index.

If there is no waypoints in the list, creates a hold position waypoint as the first index in the list and returns it

Returns:
waypoint_list_[i]

Here is the call graph for this function:

Returns the time that the waypoint list was received.

Returns:
Waypoint list reception time

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