Skip to content

Commit

Permalink
mavproxy_misc.py: add configerror_autopilot command
Browse files Browse the repository at this point in the history
we need new and interesting ways to torture our autopilots.

Understand a new command which asks the autopilot to enter its config error loop.  This can be useful for testing GCS behaviour while autopilot is in this state.

Co-authored-by: Bob Long <[email protected]>
Co-authored-by: Michelle Rossouw <[email protected]>
  • Loading branch information
3 people committed Feb 3, 2025
1 parent efd6720 commit c4736aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MAVProxy/modules/mavproxy_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def __init__(self, mpstate):
self.add_command('hardfault_autopilot', self.cmd_hardfault_autopilot, "hardfault autopilot")
self.add_command('panic_autopilot', self.cmd_panic_autopilot, "panic autopilot")
self.add_command('longloop_autopilot', self.cmd_longloop_autopilot, "cause long loop in autopilot")
self.add_command('configerror_autopilot', self.cmd_config_error_autopilot, "ask autopilot to jump to its config error loop") # noqa:E501
self.add_command('internalerror_autopilot', self.cmd_internalerror_autopilot, "cause internal error in autopilot")
self.add_command('dfu_boot', self.cmd_dfu_boot, "boot into DFU mode")
self.add_command('deadlock', self.cmd_deadlock, "trigger deadlock")
Expand Down Expand Up @@ -260,6 +261,10 @@ def cmd_dfu_boot(self, args):
'''boot into DFU bootloader without hold'''
self.cmd_dosomethingreallynastyto_autopilot(args, 'DFU-boot-without-hold', 99)

def cmd_config_error_autopilot(self, args):
'''Ask the autopilot to jump into its config error loop'''
self.cmd_dosomethingreallynastyto_autopilot(args, 'config-loop', 101)

def cmd_deadlock(self, args):
'''trigger a mutex deadlock'''
self.cmd_dosomethingreallynastyto_autopilot(args, 'mutex-deadlock', 100)
Expand Down

0 comments on commit c4736aa

Please sign in to comment.