The Mission interface is based on datalink messages that dynamically add tasks (basic navigation patterns) to a queue, rather than using a static sequence like the flight plans.
Available in latest master (v5.1_devel) only
Loading the mission controller
The mission controller is based on a module, that holds a common part for the message parsing and a specific part for the navigation (which depend on the firmware). Currently the available modules are:
The interface provides a mission_run() function that must be called from the classic flight plan. The mission controller will gives the control back to the flight plan when their is no more tasks to do. Some sample flight plans are provided with takeoff, mission control and landing procedures:
The elements (or tasks) are basic navigation patterns that are sent to the aircraft and stored in a circular buffer. For each element, an insertion mode is required and a duration can be defined as well.
The insertion modes are:
- Append: add the task at the last position of the tasks' list
- Prepend: add the task before the current element (the current one remains in the list)
- ReplaceCurrent: replace the current mission element
- ReplaceAll: remove all elements in the tasks' list and add a new one
A duration for each element can be specified. The time is a floating point value in seconds. When setting a zero (or even better a negative) value, the duration parameter is not taken into account. Be aware that some navigation pattern (like segment) will end when reaching the end of the pattern or at the end of the duration time, but some (like circle) will not if a positive duration is not set. It is always possible the go to the next mission element with a specific message.
The navigation patterns are more or less the same than the one available from the flight plan (except user specific function). The vertical control is currently limited to altitude control.
- GOTO_WP: go to a specific waypoint
- east: local east position of the waypoint
- north: local north position of the waypoint
- CIRCLE: fly a circle around a waypoint
- east: local east position of the center
- north: local north position of the center
- radius: radius of the circle (positive to turn clockwise, negative to turn counter-clockwise)
- SEGMENT: fly a segment between two waypoints
- east_1: local east position of the start waypoint
- north_1: local north position of the start waypoint
- east_2: local east position of the end waypoint
- north_2: local north position of the end waypoint
- PATH: fly a sequence of segments (max 5 waypoints)
- east_'x': local east position of waypoint 'x'
- north_'x': local north position of waypoint 'x'
- nb: number of waypoints in the path (max 5)
- note: the 5 points are always sent, but only the first nb are used
More patterns will be added in the future, and global coordinates will be supported as well.
Sending tasks to the mission controller
The mission elements are sent as datalink messages using Ivy from the ground or directly with the binary format by an onboard CPU.
See conf/messages.xml for the exact message structure.
Mission status report
The mission controller is periodically sending a report message MISSION_STATUS with the following fields:
- remaining_time : time remaining for the current element in seconds (-1. if unlimited time)
- task_list: list of the elements pending in the mission controller
- each value in this list correspond to a given element type (1: wp, 2: circle, 3: segment, 4: path, ...); see sw/airborne/modules/mission/mission.h for more details
- the first element in the list is the current one
- if the list is empty, a single element with the value zero (0) is sent