Skip to content

link: add option to suppress printing of ACKs from other systems #1063

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions MAVProxy/mavproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ def __init__(self):

MPSetting('vehicle_name', str, '', 'Vehicle Name', tab='Vehicle'),

MPSetting('all_vehicle_command_acks', bool, True, 'Show COMMAND_ACKs even if they are targetted at other vehicles'),

MPSetting('sys_status_error_warn_interval', int, 30, 'interval to warn of autopilot software failure'),

MPSetting('inhibit_screensaver_when_armed', bool, False, 'inhibit screensaver while vehicle armed'),
Expand Down
39 changes: 34 additions & 5 deletions MAVProxy/modules/mavproxy_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,37 @@ def heartbeat_is_from_autopilot(self, m):
continue
mav_type_planes.append(attr)

def should_show_command_ack(self, m):
'''returns true if we should display some text on the console for m'''
if m.target_component in [mavutil.mavlink.MAV_COMP_ID_MAVCAN]:
# too noisy?
return False

if m.command in frozenset([
mavutil.mavlink.MAV_CMD_GET_HOME_POSITION,
mavutil.mavlink.MAV_CMD_DO_DIGICAM_CONTROL
]):
# too noisy?
return False

if self.settings.all_vehicle_command_acks:
# we're showing everything
return True

if m.target_system == 0:
return True

if m.target_system != self.settings.source_system:
return False

if m.target_component == 0:
return True

if m.target_component != self.settings.source_component:
return False

return True

def master_msg_handling(self, m, master):
'''link message handling for an upstream link'''

Expand Down Expand Up @@ -921,11 +952,9 @@ def accumulated_statustext(self):
cmd = cmd[8:]
res = mavutil.mavlink.enums["MAV_RESULT"][m.result].name
res = res[11:]
if (m.target_component not in [mavutil.mavlink.MAV_COMP_ID_MAVCAN] and
m.command not in [mavutil.mavlink.MAV_CMD_GET_HOME_POSITION,
mavutil.mavlink.MAV_CMD_DO_DIGICAM_CONTROL]):
self.mpstate.console.writeln("Got COMMAND_ACK: %s: %s" % (cmd, res))
except Exception:
if self.should_show_command_ack(m):
self.mpstate.console.writeln("Got COMMAND_ACK: %s: %s" % (cmd, res)) # noqa
except KeyError:
self.mpstate.console.writeln("Got MAVLink msg: %s" % m)

if m.command == mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION:
Expand Down
Loading