SIM001 › Beyond the cockpit
Flying by plan
In this section, a computer flies the plane. The ground control agent decides what each plane does, about once a second. It sends the decision to the plane as an agent plan. The plane flies the plan in AGENT mode, a flight mode of our ArduPlane fork. In the plane, the executor turns the plan into a bank, a pitch and a throttle. ArduPilot flies them, as in FBWA.
The safety envelope is a part of the executor. It keeps the plane inside the fence, above the floor and below the ceiling. It keeps the plane clear of other aircraft and above the stall speed. A plan cannot switch it off. The plane tells the ground its plan and the work of the envelope once a second.
Use this section when you write a ground control agent, or when you fly planes by plan. Sending plans tells you how a plan gets to the plane. What each primitive does tells you how the plane flies each plan. What the envelope prevents tells you what the plane does not do, whatever the plan says. Tag by plan shows the ground control agent in a game of tag.
The pilot always wins. If the pilot moves the mode switch of the radio, the plane leaves AGENT mode at once.
The tutorials use the console of the runner, with real ArduPilot planes in SITL. The console shows only the replies and the status of the plane. The topics also give the distances and the heights that we measured in a simulation of the T1-S. That simulation uses the same executor as the plane.
Tutorials
Topics
- Sending plans
- An agent plan tells the plane what to do for the next few seconds. It has a primitive, a target or a point, a plan id and a time to live. The ground sends it as a MAVLink
COMMAND_INTwith the command 31010 (MAV_CMD_USER_1).param1is the primitive,param2the target,param3the plan id andparam4the time to live in seconds. - What each primitive does
- Each agent plan has one primitive. The primitive tells the plane how to fly: to a point, round a point, in a height band, after another aircraft or away from it. The plane holds each primitive until a new plan comes or the plan runs out.
- What the envelope prevents
- The safety envelope checks each demand of the executor before the plane flies it, 50 times a second. It keeps the plane inside the fence, above the floor and below the ceiling. It keeps the plane clear of other aircraft by the separation limit, and it keeps the plane above the stall margin. If the plan and the envelope disagree, the envelope wins.
- Tag by plan
- In a game of tag, the scripted ground control agent flies the three computer pilots by plan. It does what the computer pilots do in the simulator, but with plans. Each plane gets a new plan once a second. Each plan is good for 2.5 s.