Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mavutil: fix wrong sysid_state update from sysid mismatch #960

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading