SIM001 › For developers › Flying by plan
Flying after other aircraft
Two primitives fly with another aircraft: pursue chases it, and evade breaks away from it. The plan names the other aircraft as its target.
The other aircraft come from tracks. The ground sends each one as an ADSB_VEHICLE message. The low byte of its ICAO address is the id that a plan names as its target. The plane ignores a track that it has not heard for 3 s. In the runner, the ids of the planes are 1 for Kestrel, 2 for Merlin and 3 for Swift. After the game, the console sends the tracks of Merlin and Swift to Kestrel twice a second. Type silent to stop them, and heard to send them again.
We measured the distances and the heights on this page in a simulation of the T1-S that uses the same executor. The plane starts at 30 m over the arena centre, to the north, at 15 m/s. The console does not show these distances and heights. In the simulation, the other aircraft is a model plane too.
A pursue plan chases another aircraft
If the flight mode of the plane is AGENT and the other aircraft is round the arena, type plan pursue 0 0 0 0 600 2 in the console. The plane chases Merlin, the aircraft with the id 2. The plane replies with COMMAND_ACK, result 0 (ACCEPTED). The console shows ack with result=0. AG_PLAN goes up by 1, to the id of the new plan (plan= in the console). AG_PRIM is 1, pursue (prim=1). The plan is good for 600 s.
Pursue closes on the target and stays on its tail
The plane flies to the place where the target will be, and it matches the speed of the target. It stays just outside the separation zone, behind the target. Then the target cannot turn away from it easily.
If the reported primitive is pursue and the other aircraft is round the arena, type wait 120 in the console. In the last minute, the plane stays within 25 m of the other aircraft. The other aircraft never comes within 4 m, across or above and below.
An evade plan breaks away from another aircraft
If the flight mode of the plane is AGENT and the other aircraft is after your plane, type plan evade 0 0 0 0 600 2 in the console. The plane breaks away from Merlin, id 2. The plane replies with COMMAND_ACK, result 0 (ACCEPTED). The console shows ack with result=0. AG_PLAN goes up by 1, to the id of the new plan (plan= in the console). AG_PRIM is 2, evade (prim=2). The plan is good for 600 s.
Evade opens the distance from a chaser
The plane turns away from the other aircraft and flies fast, 20 m above or below it. Near the edge of the arena, it turns back in, so that it does not fly out.
If the reported primitive is evade and the other aircraft is after your plane, type wait 10 in the console. The other aircraft is now at least 35 m away.
A target that goes silent ends the chase
If the plane does not hear its target for 3 s, it cannot chase it or break away from it. It circles where it is, as for a plan that runs out.
If the reported primitive is pursue, stop the ADSB_VEHICLE messages of the other aircraft: type silent in the console. Then type wait 5 in the console. AG_FALL is 1 (fall=1), and the plane circles where it is.