Skip to content

Periodically timed functions and waypoint arrival #411

Answered by jooste
OrxataEnFartons asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @OrxataEnFartons,

You could also do this with stack commands. For instance, the following:

    CRE KL001 B738 52 4 0 FL250 250
    KL001 ADDWPT 53 4
    KL001 AT KL001001 DO DEL KL001

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:

import bluesky as bs

@timed_function
def update():
     if bs.traf.ntraf == 0:
        return

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@OrxataEnFartons
Comment options

@jooste
Comment options

@OrxataEnFartons
Comment options

Answer selected by OrxataEnFartons
Comment options

You must be logged in to vote
1 reply
@OrxataEnFartons
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants