From 9167d4742a9382fa9311cb83430127fbadafcf2f Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Thu, 29 Dec 2022 12:11:42 -0500 Subject: [PATCH] add .env file for FSW configurations, add FSW thread object in step() method --- .env | 5 +++++ src/core/sim.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..cc7b2ea --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +CISLUNAR_BASE_DIR=cislunar_data +SURRENDER_LOCAL_DIR=outside_repo +FOR_FLIGHT=0 +LOG=1 +TEST=1 \ No newline at end of file diff --git a/src/core/sim.py b/src/core/sim.py index acff3f0..d2bc2db 100644 --- a/src/core/sim.py +++ b/src/core/sim.py @@ -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 @@ -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.""" @@ -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