SIM001

SIM001 › For developers › Flying by plan

Replacing and ending a plan

The ground sends a new plan about once a second, with a new plan id each time. The plane flies the newest plan. If no new plan comes before the time to live ends, the plane circles where it is. Thus a plane that loses the ground does not fly away.

The ground can also give the plane a standing plan and a time. If no new plan comes for that long, the plane flies the standing plan on its own: it holds, or it flies home, whatever the ground told it before it lost the link. A new plan from the ground stops the clock and starts it again. The plane keeps the standing plan until the ground gives it another.

A new plan id replaces the plan

The plane does not finish the old plan first. It turns to the new plan at once.

If the reported primitive is go to, 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. AG_PLAN goes up by 1, to the id of the new plan (plan= in the console). AG_PRIM is 4, orbit (prim=4).

If the reported primitive is go to, 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. AG_PLAN goes up by 1, to the id of the new plan (plan= in the console). AG_PRIM is 4, orbit (prim=4).

See it in Sending your first plan.

A repeated plan id changes nothing

The plane flies a plan id only once. If a plan comes again with the same id, the plane keeps the plan that it has, even if the new message has another primitive. Thus a plan that the link sends twice does not restart.

If the reported primitive is go to, type again orbit 70 0 45 45 600 in the console. This sends an orbit plan with the id of the last plan. The plane replies with COMMAND_ACK, result 0 (ACCEPTED). The console shows ack with result=0. AG_PLAN does not change. AG_PRIM is 3, go to (prim=3).

If the reported primitive is go to, type again orbit 70 0 45 45 600 in the console. This sends an orbit plan with the id of the last plan. The plane replies with COMMAND_ACK, result 0 (ACCEPTED). The console shows ack with result=0. AG_PLAN does not change. AG_PRIM is 3, go to (prim=3).

A plan that runs out makes the plane circle

If the time to live of the plan ends before a new plan comes, the plane circles where it is. It tells the ground why, with AG_FALL and the message "Agent: fallback 1". A short recovery can also show, as recoveries in the console. To give each plan more time, set AGENT_GRACE. It is in seconds, and it is 0 by default.

If the time to live of the plan is 5 s, type wait 10 in the console. AG_FALL is 1 (fall=1), and the plane circles where it is.

If the time to live of the plan is 5 s, type wait 10 in the console. AG_FALL is 1 (fall=1), and the plane circles where it is.

See it in Letting a plan run out.

A new plan ends the circle

The plane flies the new plan at once. With the parameters of ardupilot/t1s.parm, a short recovery can show in AG_FALL as 3 at the same time.

If the time to live of the plan is 5 s, type plan goto 80 10 40 0 600 in the console. This plan tells the plane to fly to the point 80 m north and 10 m east of home, at 40 m. The reported fallback is none or recovery.

If the time to live of the plan is 5 s, type plan goto 80 10 40 0 600 in the console. This plan tells the plane to fly to the point 80 m north and 10 m east of home, at 40 m. The reported fallback is none or recovery.

See it in Letting a plan run out.

A standing plan takes over when the plans stop

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Then type wait 30. AG_FLY is 4, orbit.

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Then type wait 30. AG_FLY is 4, orbit.

A standing plan waits for its time

The plane flies the plan that it has until the time of the standing plan is out.

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Then type wait 10. AG_FLY is 3, go to.

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Then type wait 10. AG_FLY is 3, go to.

A new plan starts the time again

The second plan comes 15 s after the first, and the standing plan is due 20 s after the second, not the first.

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Type wait 15, then plan goto 80 10 40 0 600 again, and wait 15. AG_FLY is 3, go to.

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Type wait 15, then plan goto 80 10 40 0 600 again, and wait 15. AG_FLY is 3, go to.

A new plan replaces a standing plan that took over

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Type wait 30, then plan goto 80 10 40 0 600 again. AG_FLY is 3, go to.

If the flight mode of the plane is AGENT, type plan goto 80 10 40 0 600 and standing orbit 70 0 45 45 20 in the console. Type wait 30, then plan goto 80 10 40 0 600 again. AG_FLY is 3, go to.