Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

Commit 2582f73

Browse files
committed
fix: Updated common submodule + added string path for images
1 parent 59041a4 commit 2582f73

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ flight_interface:
5757
baud_rate: 57600 # symbol rate
5858
worker_period: 0.1 # seconds
5959
enable_hitl: false # bool
60+
images_path: "./tests/integration/" # file path
6061

6162
data_merge:
6263
timeout: 60.0 # seconds

main_2025.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def main() -> int:
5050
action="store_true",
5151
help="option to show annotated image",
5252
)
53-
parser.add_argument("--enable-hitl", action="store_true", help="enable the hitl workflow")
53+
parser.add_argument("--enable_hitl", action="store_true", help="enable the hitl workflow")
5454
args = parser.parse_args()
5555

5656
# Configuration settings
@@ -138,7 +138,11 @@ def main() -> int:
138138
FLIGHT_INTERFACE_TIMEOUT = config["flight_interface"]["timeout"]
139139
FLIGHT_INTERFACE_BAUD_RATE = config["flight_interface"]["baud_rate"]
140140
FLIGHT_INTERFACE_WORKER_PERIOD = config["flight_interface"]["worker_period"]
141-
FLIGHT_INTERFACE_ENABLE_HITL = config["flight_interface"]["enable_hitl"]
141+
if args.enable_hitl:
142+
FLIGHT_INTERFACE_ENABLE_HITL = True
143+
else:
144+
FLIGHT_INTERFACE_ENABLE_HITL = config["flight_interface"]["enable_hitl"]
145+
FLIGHT_INTERFACE_IMAGES_PATH = config["flight_interface"]["images_path"]
142146

143147
DATA_MERGE_TIMEOUT = config["data_merge"]["timeout"]
144148

@@ -296,6 +300,7 @@ def main() -> int:
296300
FLIGHT_INTERFACE_BAUD_RATE,
297301
FLIGHT_INTERFACE_WORKER_PERIOD,
298302
FLIGHT_INTERFACE_ENABLE_HITL,
303+
FLIGHT_INTERFACE_IMAGES_PATH,
299304
LOG_TIMINGS,
300305
),
301306
input_queues=[

modules/flight_interface/flight_interface.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,21 @@ def create(
2525
timeout_home: float,
2626
baud_rate: int,
2727
local_logger: logger.Logger,
28-
enable_hitl: bool = False,
28+
images_path: str | None,
29+
enable_hitl: bool,
2930
) -> "tuple[bool, FlightInterface | None]":
3031
"""
3132
address: TCP address or port.
3233
timeout_home: Timeout for home location in seconds.
3334
baud_rate: Baud rate for the connection.
3435
"""
35-
result, controller = flight_controller.FlightController.create(address, baud_rate)
36+
if enable_hitl:
37+
if images_path is None:
38+
return False, None
39+
result, controller = flight_controller.FlightController.create(address, baud_rate, enable_hitl, images_path=images_path)
40+
else:
41+
result, controller = flight_controller.FlightController.create(address, baud_rate)
42+
3643
if not result:
3744
local_logger.error("controller could not be created", True)
3845
return False, None

modules/flight_interface/flight_interface_worker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def flight_interface_worker(
1919
baud_rate: int,
2020
period: float,
2121
enable_hitl: bool,
22+
images_path: str | None,
2223
log_timings: bool,
2324
input_queue: queue_proxy_wrapper.QueueProxyWrapper,
2425
coordinates_input_queue: queue_proxy_wrapper.QueueProxyWrapper,
@@ -50,7 +51,7 @@ def flight_interface_worker(
5051
local_logger.info("Logger initialized", True)
5152

5253
result, interface = flight_interface.FlightInterface.create(
53-
address, timeout, baud_rate, local_logger
54+
address, timeout, baud_rate, local_logger, images_path, enable_hitl
5455
)
5556
if not result:
5657
local_logger.error("Worker failed to create class object", True)

0 commit comments

Comments
 (0)