diff --git a/Tools/autotest/sim_vehicle.py b/Tools/autotest/sim_vehicle.py index 8d341bbfbe..6c6fc6ba66 100755 --- a/Tools/autotest/sim_vehicle.py +++ b/Tools/autotest/sim_vehicle.py @@ -714,6 +714,8 @@ def start_vehicle(binary, opts, stuff, spawns=None): c = ["-I" + str(i)] if spawns is not None: c.extend(["--home", spawns[i]]) + if opts.auto_sysid and opts.sysid is None and 0 <= i < 255: + c.extend(["--sysid", str(i + 1)]) os.chdir(i_dir) run_in_terminal_window(cmd_name, cmd + c) os.chdir(old_dir) @@ -1139,6 +1141,10 @@ group_sim.add_option("", "--slave", type='int', default=0, help="Set the number of JSON slave") +group_sim.add_option("", "--auto-sysid", + default=False, + action='store_true', + help="Set SYSID_THISMAV based upon instance number") parser.add_option_group(group_sim)