Skip to content

Commit 37c30bb

Browse files
committed
ran linters
1 parent a6fed7f commit 37c30bb

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tests/integration/hitl/test_hitl_emulator_check.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,39 @@
22
HITL Test - GPS + Camera Feed Verification
33
44
"""
5+
56
import cv2
67
import os
78
import time
89

910
from modules.mavlink import flight_controller
1011

1112

12-
1313
# Physical connection to Pixhawk: /dev/ttyAMA0
1414
# Simulated connection to Pixhawk: tcp:localhost:5762
1515
PIXHAWK_ADDRESS = "/dev/ttyAMA0"
1616
TEST_DURATION = 10
1717

1818

19-
2019
def test_camera_feed() -> bool:
2120
"""
2221
Returns True if camera feed is available, False otherwise.
2322
"""
2423
try:
2524
camera = cv2.VideoCapture(2)
26-
25+
2726
if not camera.isOpened():
2827
camera.release()
2928
return False
30-
29+
3130
ret, frame = camera.read()
3231
camera.release()
33-
32+
3433
if ret and frame is not None and frame.size > 0:
3534
return True
36-
35+
3736
return False
38-
37+
3938
except Exception:
4039
return False
4140

@@ -65,17 +64,17 @@ def main() -> int:
6564
if controller.hitl_instance is not None:
6665
controller.hitl_instance.start()
6766
print("HITL emulators started")
68-
67+
6968
print("Waiting for camera creation...")
70-
time.sleep(5)
71-
69+
time.sleep(5)
70+
7271
print("Checking for camera...")
7372
camera_available = test_camera_feed()
7473
if camera_available:
7574
print("Camera: detected")
7675
else:
7776
print("Camera: not detected")
78-
77+
7978
else:
8079
print("ERROR: HITL instance not created")
8180
return -1

0 commit comments

Comments
 (0)