The mission planner sits on top of all other software subsystems to control mission execution. It is what allows a user to write complicated missions and how Drekar is able to run the sophisticated, multi-threaded missions required by the AUVSI/ONR AUV competition. The mission planner is built upon two subsystems: a planner and a task subsystem. The planner schedules everything from task blocks. This structure allows for incredibly rich, dynamic missions to be written quickly, with the planner system taking care of many of the details that would have had to be encoded in a more procedural system.
The mission planner is a tree-walking, multi-threaded program written in Python that instantiates each element of the user-given task list, allowing the tasks to add sub-tasks, and executing these subtasks when it is their turn. The planner is always running in the background, ready to cull completed tasks and notify tasks further down the line that it is their turn to run. The planner also makes sure exclusive tasks (such as movement primitives) only run one-at-a-time, and that each task is run at a regular interval so that tasks can use time-based accounting if desired.
Each task is allowed to give the planner a list of “dependencies”, which are simply aliases to shared variables. The planner monitors the requested lists of shared variables in separate threads and notifies the tasks to run when their “dependencies” change. General feedback motion primitive tasks have been developed to abstract approaching and hovering over mission elements out of mission element specific tasks. This greatly reduces code reuse and allows for the rapid development and tuning of new tasks without having to worry about the physical response of the vehicle, which is handled by these motion primitives.