Skip to content
Discussion options

You must be logged in to vote

Hi @Santisoutoo,

The problem you are encountering is that on first import, no objects within bluesky are initialised yet, so when you do from bluesky import traf, all you get is None. The way to avoid this is by importing the module instead of only specific objects from the module:

import bluesky as bs

def traffic(self):
    for i in range(bs.traf.ntraf):
        callsign = traf.id[i]
    ...

Note that this approach is not necessary in plugins, as these are only imported after bluesky is initialised, so by then all simulation objects exist.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Santisoutoo
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
2 participants