Skip to content

Conversation

@KerelosGayed
Copy link

added a method in flight controller for gps data
reads camera emulator's current frame to check if camera feed is active

print("GPS: No data")

# Test camera feed every 3 seconds
if int(current_time) % 3 == 0 and current_time > 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The camera test should be assuming no access to the emulators, try creating a video stream using cv2 and checking if it's receiving video.

Base automatically changed from periodic-hitl to main September 25, 2025 23:43
Copy link
Contributor

@honzikschenk honzikschenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes; looks good so far!

try:
loc = self.drone.location
except Exception: # pylint: disable=broad-except
print("HITL get_location error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generalize this error message (ie. say something like "Error with requesting location" or "get_location could not complete request"). flight_controller is used on our general airside system

def get_location(self) -> "tuple[bool, tuple[float, float, float] | None]":
"""Return (lat, lon, alt) if available via the drone, otherwise (False, None)."""
try:
loc = self.drone.location
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on how your test goes, you might have to replace this with receiving the "GLOBAL_POSITION_INT" mavlink message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants