SIM001 › For developers › Flying by plan
Other aircraft and bad data
The safety envelope keeps the plane clear of other aircraft by the separation limit, AGENT_SEP. Its separation rule comes first, so the fence, the ceiling, the floor and the stall margin all win over it. If the data of the plane is bad, the envelope does not guess: it gives wings level and the throttle to the pilot.
The plane keeps clear of an aircraft that crosses its path
The envelope looks 5 s ahead along the paths of the plane and of each track. If the plane will come inside the separation zone, the envelope flies an escape: a hard turn, a climb, a dive, or two of them. Of two planes in conflict, the upper one climbs and the lower one dives. On an orbit, the envelope first looks for an escape that stays near the circle: within 40 % of its radius outside it. It leaves the circle only if no such escape is clear, because the ground does not tell the plane what stands round the circle. In a game of Towers, trees do.
If the flight mode of the plane is AGENT and the other aircraft is across your path, type wait 30 in the console. The other aircraft never comes within 4 m, across or above and below.
Bad input gives wings level and the throttle to the pilot
The envelope refuses a state that is not a number, or that cannot be true. The plane then flies wings level with the nose level, and the throttle stick sets the throttle. This happens if the EKF of ArduPilot loses the position of the plane. The plane ignores a bad track, and it refuses a bad plan.
If the flight mode of the plane is AGENT and the plane loses its position estimate, AG_FALL is 2 (fall=2), and the plane flies wings level. The throttle stick of the radio sets the throttle.
The plane flies again when the position estimate comes back
If the reported fallback is bad input and the plane gets its position estimate back, AG_FALL is 0 (fall=0). The executor sets the throttle.
With space to turn, planes on plans keep their separation
In a large fence, each plane has space for its escapes. Three planes on random plans keep the separation for 20 minutes. Their plans also tell them to chase each other, and to break away from each other.
If the fence radius is 300 m and the separation limit is 8 m, simulate three planes on random plans for 20 minutes. No two of the three planes come within 8 m, across or above and below.
In a small fence, the fence wins over the separation
The 85 m fence of a game of tag is small for three planes. Sometimes an escape from another plane would take the plane out of the fence. Then the envelope keeps the plane inside the fence, and the separation can be less than the limit for a moment. We flew three planes for 20 minutes with a separation of 8 m, eight times. In three of the eight flights, two planes came closer than 8 m for a moment: to 2.7 m, 3.6 m and 5.7 m. Use height bands, as in Tag by plan, to keep planes apart in a small fence.
If the fence radius is 85 m and the separation limit is 8 m, simulate three planes on random plans for 20 minutes. The plane never goes out of the fence, 85 m round the arena centre. The plane never goes down to the floor of 12 m.