Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CISLUNAR_BASE_DIR=cislunar_data
SURRENDER_LOCAL_DIR=outside_repo
FOR_FLIGHT=0
LOG=1
TEST=1
5 changes: 4 additions & 1 deletion src/core/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from utils.log import log
from utils.constants import R_EARTH, EARTH_SOI
from core.event import Event, NormalEvent
from fsw_main.main import MainSatelliteThread

class CislunarSim:
"""This class consolidates all parts of the sim (config, models, state). It is responsible for
Expand All @@ -22,6 +23,7 @@ def __init__(self, config: Config) -> None:
self.should_run = True
self.num_iters = 0
self.event_queue : "Queue[Event]" = Queue()
self.main_thread = MainSatelliteThread(is_sim_run=True)

def step(self) -> PropagatedOutput:
"""step() is the combined true and observed state after one step."""
Expand All @@ -32,7 +34,8 @@ def step(self) -> PropagatedOutput:
current_event = self.event_queue.get()
self.state_time, self.observed_state = current_event.evaluate(self.state_time)
# TODO: Feed outputs of sensor models into FSW and return actuator's state as part of `PropagatedOutput`

fsw_output = self.main_thread.step(self.observed_state.__dict__)
print(fsw_output)
# check if we should stop the sim
self.should_run = not (self.should_stop())
self.num_iters += 1
Expand Down