main_ground.py
This is the entry point script for the ground station, meaning that this is the one you need to execute. This is a managed application, so you need to execute this code before starting up the NOS-T Manager application.
- class Environment(app, grounds)
Bases:
ObserverThe Environment object class inherits properties from the Observer object class in the NOS-T tools library
- app
An application containing a test-run namespace, a name and description for the app, client credentials, and simulation timing instructions
- Type:
ManagedApplication
- grounds
DataFrame of ground station information including groundId (int), latitude-longitude location (
GeographicPosition), and min_elevation (float) angle constraints- Type:
DataFrame
- on_change(source, property_name, old_value, new_value)
Standard on_change callback function format inherited from Observer object class
In this instance, the callback function checks when the PROPERTY_MODE switches to EXECUTING to send a
GroundLocationmessage to the PREFIX/ground/location topic. These locations are published as soon as the execution starts. As modeled here, the number, location, and elevation angle for each ground station will not change throughout the test case.if property_name == Simulator.PROPERTY_MODE and new_value == Mode.EXECUTING: for index, ground in self.grounds.iterrows(): self.app.send_message( "location", GroundLocation( groundId=ground.groundId, latitude=ground.latitude, longitude=ground.longitude, elevAngle=ground.elevAngle, ).json(), )