Skip to content

Commit 55f7b14

Browse files
authored
Send out initial heartbeat on connection creation (#1163)
1 parent a4bd033 commit 55f7b14

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

radio/app/drone.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,19 @@ def __init__(
157157
self._setCancelledConnectionErrorAndCloseMaster()
158158
return
159159

160+
try:
161+
self.master.mav.heartbeat_send(
162+
mavutil.mavlink.MAV_TYPE_GCS,
163+
mavutil.mavlink.MAV_AUTOPILOT_INVALID,
164+
0,
165+
0,
166+
mavutil.mavlink.MAV_STATE_ACTIVE,
167+
)
168+
except Exception as e:
169+
self.logger.warning(
170+
f"Failed to send initial outgoing heartbeat: {e}", exc_info=True
171+
)
172+
160173
try:
161174
initial_heartbeat = None
162175
heartbeat_timeout_secs = 5.0

0 commit comments

Comments
 (0)