SIM001 › For developers › Flying by plan
Flying to a point and round it
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.
The points of the plans are latitude and longitude, with the altitude above home. The console of the runner takes metres north and east of home, and changes them for you. The plane moves a circle in from the fence if the whole circle does not fit inside it.
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.
Flying after other aircraft tells you about pursue and evade, the primitives that follow another aircraft.
Go to flies over the point, then circles it
The plane flies straight to the point. When it is over the point, it circles the point at the loiter radius, about 49 m for the T1-S. It holds the height of the plan.
If the reported primitive is go to and the time to live of the plan is 600 s, type wait 120 in the console. The plane flies over the point, within 10 m of it. In the last minute, the plane stays within 50 m of the point. In the last minute, the plane is always at least 38 m above home. In the last minute, the plane is never more than 42 m above home.
An orbit plan circles a point
If the flight mode of the plane is AGENT, type plan orbit 70 0 45 45 600 in the console. This plan tells the plane to circle the arena centre at 45 m from it, at 45 m. 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 4, orbit (prim=4). The plan is good for 600 s.
See it in Sending your first plan.
Orbit holds its radius and its height
The plane circles the point at the radius of the plan, in the direction that it already turns. A radius that is too small for the plane becomes the smallest circle that it can fly.
If the reported primitive is orbit, type wait 120 in the console. In the last minute, the plane is always at least 40 m from the point. In the last minute, the plane stays within 50 m of the point. In the last minute, the plane is always at least 43 m above home. In the last minute, the plane is never more than 47 m above home.
A band plan holds a height band
If the flight mode of the plane is AGENT, type plan band 70 0 35 10 600 in the console. This plan tells the plane to stay between 35 m and 45 m over the arena. 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 5, band (prim=5). The plan is good for 600 s.
Band keeps the plane between its two heights
The altitude of a band plan is the bottom of the band, and its radius is the thickness of the band. The plane climbs or sinks into the band. Then it circles over the arena, inside the fence. In tag, each plane has its own band, so that two planes do not meet by chance.
If the reported primitive is band, type wait 120 in the console. In the last minute, the plane is always at least 34 m above home. In the last minute, the plane is never more than 46 m above home. The plane never goes out of the fence, 85 m round the arena centre.
A loiter plan circles where the plane is
If the flight mode of the plane is AGENT, type plan loiter 0 0 0 0 600 in the console. This plan tells the plane to circle where it is. 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 6, loiter (prim=6). The plan is good for 600 s.
Loiter stays round the place where it began
The plane circles the place where it got the plan, at the loiter radius and at its height. Near the fence, the circle moves in until it fits.
If the reported primitive is loiter, type wait 120 in the console. In the last minute, the plane is always at least 40 m from the point. In the last minute, the plane stays within 50 m of the point.