World Sims

Basilisk world models are given in bsk_rl.sim.world.

In most cases, the user does not need to specify the world model, as it is inferred from the requirements of the FSWModel. However, the user can specify the world model in the GeneralSatelliteTasking constructor if desired.

Customization of the world model parameters is via the world_args parameter in the GeneralSatelliteTasking. As with sat_args, these parameters are passed as a dictionary of key-value or key-function pairs, with the latter called to generate the value each time the simulation is reset.

world_args = dict(
    utc_init="2018 SEP 29 21:00:00.000 (UTC)",  # set the epoch
    scaleHeight=np.random.uniform(7e3, 9e3),  # randomize the atmosphere
)

In general, world_args parameter names match those used in Basilisk. See the setup functions for short descriptions of what parameters do and the Basilisk documentation for more detail on their exact model effects.

class WorldModel(simulator: Simulator, world_rate: float, priority: int = 300, **kwargs)[source]

Bases: ABC

Abstract Basilisk world model.

One WorldModel is instantiated for the environment each time a new simulator is created.

Parameters:
  • simulator (Simulator) – Simulator using this model.

  • world_rate (float) – Rate of world simulation [s]

  • priority (int) – Model priority.

  • kwargs – Passed through to setup functions.

classmethod default_world_args(**kwargs) dict[str, Any][source]

Compile default arguments for the world model.

Parameters:

**kwargs – Arguments to override in the default arguments.

Returns:

Dictionary of arguments for simulation models.

Return type:

dict[str, Any]

class BasicWorldModel(*args, **kwargs)[source]

Bases: WorldModel

Basic world with minimum necessary Basilisk world components.

This model includes ephemeris and SPICE-based Earth gravity and dynamics models, an exponential atmosphere model, and an eclipse model.

Parameters:
  • *args – Passed to superclass.

  • **kwargs – Passed to superclass.

property PN

Planet relative to inertial frame rotation matrix.

property omega_PN_N

Planet angular velocity in inertial frame [rad/s].

setup_gravity_bodies(utc_init: str, priority: int = 1100, **kwargs) None[source]

Specify gravitational models to use in the simulation.

Parameters:
  • utc_init (str) – UTC datetime string, in the format YYYY MMM DD hh:mm:ss.sss (UTC)

  • priority (int) – Model priority.

  • **kwargs – Passed to other setup functions.

Return type:

None

setup_ephem_object(priority: int = 988, **kwargs) None[source]

Set up the ephemeris object to use with the SPICE library.

Parameters:
  • priority (int) – Model priority.

  • **kwargs – Passed to other setup functions.

Return type:

None

setup_atmosphere_density_model(planetRadius: float, baseDensity: float, scaleHeight: float, priority: int = 1000, **kwargs) None[source]

Set up the exponential gravity model.

Parameters:
  • planetRadius (float) – [m] Planet ground radius.

  • baseDensity (float) – [kg/m^3] Exponential model parameter.

  • scaleHeight (float) – [m] Exponential model parameter.

  • priority (int) – Model priority.

  • **kwargs – Passed to other setup functions.

Return type:

None

setup_eclipse_object(priority: int = 988, **kwargs) None[source]

Set up the celestial object that is causing an eclipse message.

Parameters:
  • priority (int) – Model priority.

  • kwargs – Ignored

Return type:

None

class GroundStationWorldModel(*args, **kwargs)[source]

Bases: BasicWorldModel

Model that includes downlink ground stations.

This model includes the basic world components, as well as ground stations for downlinking data.

Parameters:
  • *args – Passed to superclass.

  • **kwargs – Passed to superclass.

setup_ground_locations(groundStationsData: list[dict[str, str | float]], groundLocationPlanetRadius: float, gsMinimumElevation: float, gsMaximumRange: float, priority: int = 1399, **kwargs) None[source]

Specify the ground locations of interest.

Parameters:
  • groundStationsData (list[dict[str, str | float]]) –

    List of dictionaries of ground station data. Each dictionary must include keys for lat and long [deg], and may include elev [m], name. For example:

    groundStationsData=[
        dict(name="Boulder", lat=40.009971, long=-105.243895, elev=1624),
        dict(lat=28.3181, long=-80.6660),
    ]
    

    groundLocationPlanetRadius, gsMinimumElevation, and gsMaximumRange may also be specified in the dictionary to override the global values for those parameters for a specific ground station.

  • groundLocationPlanetRadius (float) – [m] Radius of ground locations from center of planet.

  • gsMinimumElevation (float) – [rad] Minimum elevation angle from station to satellite to be able to downlink data.

  • gsMaximumRange (float) – [m] Maximum range from station to satellite when downlinking. Set to -1 to disable.

  • priority (int) – Model priority.

  • kwargs – Passed to other setup functions.

Return type:

None