Skip to content

Commit

Permalink
Mavutil: fix wrong sysid_state update from sysid mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
khancyr authored and peterbarker committed Jul 26, 2024
1 parent d251f7a commit e192ad8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mavutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ def post_message(self, msg):
self.flightmode = mode_string_v10(msg)
self.mav_type = msg.type
self.base_mode = msg.base_mode
self.sysid_state[self.sysid].armed = (msg.base_mode & mavlink.MAV_MODE_FLAG_SAFETY_ARMED)
self.sysid_state[self.sysid].mav_type = msg.type
self.sysid_state[self.sysid].mav_autopilot = msg.autopilot
self.sysid_state[src_system].armed = (msg.base_mode & mavlink.MAV_MODE_FLAG_SAFETY_ARMED)
self.sysid_state[src_system].mav_type = msg.type
self.sysid_state[src_system].mav_autopilot = msg.autopilot
elif type == 'HIGH_LATENCY2':
if self.sysid == 0:
# lock onto id tuple of first vehicle heartbeat
Expand All @@ -434,9 +434,9 @@ def post_message(self, msg):
self.mav_type = msg.type
if msg.autopilot == mavlink.MAV_AUTOPILOT_ARDUPILOTMEGA:
self.base_mode = msg.custom0
self.sysid_state[self.sysid].armed = (msg.custom0 & mavlink.MAV_MODE_FLAG_SAFETY_ARMED)
self.sysid_state[self.sysid].mav_type = msg.type
self.sysid_state[self.sysid].mav_autopilot = msg.autopilot
self.sysid_state[src_system].armed = (msg.custom0 & mavlink.MAV_MODE_FLAG_SAFETY_ARMED)
self.sysid_state[src_system].mav_type = msg.type
self.sysid_state[src_system].mav_autopilot = msg.autopilot

elif type == 'PARAM_VALUE':
if not src_tuple in self.param_state:
Expand Down

0 comments on commit e192ad8

Please sign in to comment.