Periodically timed functions and waypoint arrival #411
-
Hi, Now, when an aircraft reaches the last point of the scenario it just follows with the current heading. Is there built any way to identify if an aircraft reached its destination, or to know the past/next point in the trajectory? I see nothing like that in the Traffic object. Regards. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Well, somehow I managed to detect when it arrives to the end. Using the traf.actwp.swlastwp[idx] that becomes true when reaches to the last leg and when that happens, checking the distance to destination with each new position. When is less than a certain margin , I delete the aircraft with a DEL acid. |
Beta Was this translation helpful? Give feedback.
-
Hi @OrxataEnFartons, You could also do this with stack commands. For instance, the following:
would call the stack command Timed functions run when the simulation is running, but you can for instance add a condition check in your function to skip the remainder of the function when there is no traffic: import bluesky as bs
@timed_function
def update():
if bs.traf.ntraf == 0:
return |
Beta Was this translation helpful? Give feedback.
-
Dear Miquel,
Ok, good to hear. Normally this should indeed be covered by the AT command,. Please check the possibilities of ther AT command, using the examples. You can send any command when the waypoint reaches the waypoint. There also other variants of the AT-command, called ATDIST, ATALT ATSPD etc, these could all help as well. We use AT and these commands regularly to program specific logic or other conditional functions in the scenario. Why doesn’t it do what you wanted? What did you try to use it for exactly?
Best regards,
Jacco Hoekstra
From: Miquel Angel ***@***.***>
Sent: dinsdag 20 september 2022 11:09
To: TUDelft-CNS-ATM/bluesky ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [TUDelft-CNS-ATM/bluesky] Periodically timed functions and waypoint arrival (Discussion #411)
At the moment I solved this by checking traf.actwp.swlastwp[idx] to see if it is already in the last leg. Then when I detect that I passed the destination point, I DEL the aircraft.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/TUDelft-CNS-ATM/bluesky/discussions/411*discussioncomment-3688417__;Iw!!PAKc-5URQlI!6YwTzR-oxJwLhWbpFfMEH3916YNX-eagItIHTUblQmP7hCjxPZe290l9KqdFJHvMM4Xlz0w4nfPsIV5vhnMRT4EECsRWUw$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ABWT2BHO774A3SER7GOSAF3V7F5MTANCNFSM55LBW7UQ__;!!PAKc-5URQlI!6YwTzR-oxJwLhWbpFfMEH3916YNX-eagItIHTUblQmP7hCjxPZe290l9KqdFJHvMM4Xlz0w4nfPsIV5vhnMRT4E7nGVZgA$>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
That is indeed strange, like I said, I will have a look at this. Might indeed be that some exception is triggered due to the new SWTOD/SWTOC logic that has been added. Will fix it this week.
From: Miquel Angel ***@***.***>
Sent: dinsdag 20 september 2022 11:40
To: TUDelft-CNS-ATM/bluesky ***@***.***>
Cc: Jacco Hoekstra - LR ***@***.***>; Comment ***@***.***>
Subject: Re: [TUDelft-CNS-ATM/bluesky] Periodically timed functions and waypoint arrival (Discussion #411)
Hi Jacco,
In my plugin I receive flight plans that have been designed clicking on a map. So the first thing I do then creating the scn is naming these waypoints:
00:00:00.00>DEFWPT M6001_WP3,52.257605,10.567834,FIX
Having these waypoints defined like this in the scn, and the scenario running, if the plugin executes a:
AT M6001,M6001_WP3 ALT 32.808399,
I didn't get an error but the altitude did not change when arriving that waypoint.
Same if I introduce that command in the console while executing the scn. Maybe some problem recognizing the named waypoint? That is why I tried editing and reloading the whole scn.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/TUDelft-CNS-ATM/bluesky/discussions/411*discussioncomment-3688639__;Iw!!PAKc-5URQlI!8DeD04UlLKGwB_EBPlhsHzRbQBfQSgt0MIBaMgeqcDpSnxktIwmpboqAk1hzAjnQTLurHZWNN3pixhzXsfiQ0_RWv_inSw$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ABWT2BC6PBRTOSX4HCLBJ33V7GA6ZANCNFSM55LBW7UQ__;!!PAKc-5URQlI!8DeD04UlLKGwB_EBPlhsHzRbQBfQSgt0MIBaMgeqcDpSnxktIwmpboqAk1hzAjnQTLurHZWNN3pixhzXsfiQ0_TV4RDwAA$>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
Hi @OrxataEnFartons,
You could also do this with stack commands. For instance, the following:
would call the stack command
DEL KL001
once the waypoint is reached, and thus delete the aircraft. You can let it call any stack command this way, including the ones you create yourself.Timed functions run when the simulation is running, but you can for instance add a condition check in your function to skip the remainder of the function when there is no traffic: