...
decode controller inputs (map them to attitude manager struct) & extra bits
Decide whether or not to call PM.
if we call PM, wait for return from PM and then give that to AM
if not calling PM, pass struct directly to AM
If failover, call to ardupilot?
if landing, call to the TX2.
waypoint_type sent to PM.
Takeoff
Call PM to get takeoff targets
Send targets to AM
report Report AM info to TM
Cruise
If instruction is autopilot, call PM and then send which sends to AM, report to TM
if instruction is GPS/Level User Control, Call PM and then send which sends to AM, report to TM
if instruction is direct passby user control, encode struct and send to PM to pass through to AM.
If instruction is override, enter override mode in SM. Report to Tm.
...