Skip to content

Commit

Permalink
black reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrassow committed Dec 27, 2023
1 parent 5404cd6 commit 7f0de14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion flight/pygnc/common/zmq_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __init__(
self.subscriber.connect(f"tcp://localhost:{port}")

def receive(self, block=True):

block_flag = 0 if block else zmq.NOBLOCK

try:
Expand Down
12 changes: 5 additions & 7 deletions flight/pygnc/tasks/orbit_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
from ..configuration import pygnc as pygnc_config
from ..algorithms.OrbitEstimator import OrbitEKF


def predict_orbit_ekf(orbit_ekf, prev_epoch, dt=5.0):
orbit_ekf.predict(dt)
new_epoch = prev_epoch + dt # addition of seconds is defined in brahe
new_epoch = prev_epoch + dt # addition of seconds is defined in brahe
return new_epoch


Expand All @@ -28,7 +29,7 @@ def update_orbit_ekf(orbit_ekf, gps_message, prev_epoch=None):
state_measurement_eci = brahe.frames.sECEFtoECI(
measurement_epoch, state_measurement_ecef
)

if prev_epoch is None:
# need to initialize ekf state with first measurement
orbit_ekf.initialize_state(state_measurement_eci)
Expand All @@ -40,7 +41,6 @@ def update_orbit_ekf(orbit_ekf, gps_message, prev_epoch=None):
return measurement_epoch



def send_orbit_estimate_message(
pub: zmqMessagePublisher, measurement_epoch, orbit_ekf, sensor_message
):
Expand Down Expand Up @@ -68,9 +68,8 @@ def main():
batch_data = data_parsing.unpack_batch_sensor_gps_file_to_messages_iterable(
pygnc_config.batch_sensor_gps_filepath
)


# We predict the next state every 5 sec
# We predict the next state every 5 sec
# Every 25 sec, we process the measurement packet with an EKF update
packet_count = 0
prev_epoch = None
Expand All @@ -85,13 +84,12 @@ def main():
packet_count += 1

estimates.append(orbit_ekf.x)
for i in range(in_between_prediction_dt-1):
for i in range(in_between_prediction_dt - 1):
prev_epoch = predict_orbit_ekf(orbit_ekf, prev_epoch)
estimates.append(orbit_ekf.x)

# print("Batch orbit estimation completed")


# print("Final state estimate:")
# print(f"\t{orbit_ekf.x}")
# print(f"Final std dev:")
Expand Down
1 change: 0 additions & 1 deletion test/flight_pygnc/configuration/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class TestMessagesConfiguration(unittest.TestCase):
def test_ports_unique(self):

# ensure port numbers are unique
port_set = set()
for message_name, message_port in message_port_dict.items():
Expand Down

0 comments on commit 7f0de14

Please sign in to comment.