Skip to content

Commit 8b05143

Browse files
committed
Tools: adjust tooling to use MAV_SYSID
1 parent d255453 commit 8b05143

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Tools/autotest/default_params/vee-gull_005.param

+1-1
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ SYS_NUM_RESETS,1
741741
SYSID_ENFORCE,0
742742
SYSID_MYGCS,255
743743
SYSID_SW_TYPE,0
744-
SYSID_THISMAV,1
744+
MAV_SYSID,1
745745
TECS_APPR_SMAX,0
746746
TECS_CLMB_MAX,5
747747
TECS_HGT_OMEGA,3

Tools/autotest/sim_vehicle.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ def generate_frame_help():
13331333
group_sim.add_option("", "--sysid",
13341334
type='int',
13351335
default=None,
1336-
help="Set SYSID_THISMAV")
1336+
help="Set MAV_SYSID")
13371337
group_sim.add_option("--postype-single",
13381338
action='store_true',
13391339
help="force single precision postype_t")
@@ -1350,7 +1350,7 @@ def generate_frame_help():
13501350
group_sim.add_option("", "--auto-sysid",
13511351
default=False,
13521352
action='store_true',
1353-
help="Set SYSID_THISMAV based upon instance number")
1353+
help="Set MAV_SYSID based upon instance number")
13541354
group_sim.add_option("", "--sim-address",
13551355
type=str,
13561356
default="127.0.0.1",

Tools/autotest/unittest/extract_param_defaults_unittest.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ def test_output_params_qgcs_2_4(self, mock_print):
243243
mock_print.assert_has_calls(expected_calls, any_order=False)
244244

245245
@patch('extract_param_defaults.print')
246-
def test_output_params_qgcs_SYSID_THISMAV(self, mock_print):
246+
def test_output_params_qgcs_MAV_SYSID(self, mock_print):
247247
# Prepare a dummy defaults dictionary
248-
defaults = {'PARAM2': 2.0, 'PARAM1': 1.0, 'SYSID_THISMAV': 3.0}
248+
defaults = {'PARAM2': 2.0, 'PARAM1': 1.0, 'MAV_SYSID': 3.0}
249249

250250
# Call the function with the dummy dictionary, 'qgcs' format type and 'qgcs' sort type
251251
defaults = sort_params(defaults, 'qgcs')
@@ -255,13 +255,13 @@ def test_output_params_qgcs_SYSID_THISMAV(self, mock_print):
255255
expected_calls = [unittest.mock.call("\n# # Vehicle-Id Component-Id Name Value Type\n"),
256256
unittest.mock.call("%u %u %-15s %.6f %u" % (3, 7, 'PARAM1', 1.0, 9)),
257257
unittest.mock.call("%u %u %-15s %.6f %u" % (3, 7, 'PARAM2', 2.0, 9)),
258-
unittest.mock.call("%u %u %-15s %.6f %u" % (3, 7, 'SYSID_THISMAV', 3.0, 9))]
258+
unittest.mock.call("%u %u %-15s %.6f %u" % (3, 7, 'MAV_SYSID', 3.0, 9))]
259259
mock_print.assert_has_calls(expected_calls, any_order=False)
260260

261261
@patch('extract_param_defaults.print')
262262
def test_output_params_qgcs_SYSID_INVALID(self, mock_print):
263263
# Prepare a dummy defaults dictionary
264-
defaults = {'PARAM2': 2.0, 'PARAM1': 1.0, 'SYSID_THISMAV': -1.0}
264+
defaults = {'PARAM2': 2.0, 'PARAM1': 1.0, 'MAV_SYSID': -1.0}
265265

266266
# Assert that a SystemExit is raised with the correct message when an invalid sysid is used
267267
with self.assertRaises(SystemExit) as cm:

Tools/ros2/ardupilot_sitl/src/ardupilot_sitl/launch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def generate_launch_arguments() -> List[DeclareLaunchArgument]:
633633
DeclareLaunchArgument(
634634
"sysid",
635635
default_value="",
636-
description="Set SYSID_THISMAV.",
636+
description="Set MAV_SYSID.",
637637
),
638638
]
639639

Tools/scripts/extract_param_defaults.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def parse_arguments(args=None):
4747
help='Display version information and exit.',
4848
)
4949
parser.add_argument('-i', '--sysid', type=int, default=-1,
50-
help='System ID for qgcs output format. Defaults to SYSID_THISMAV if defined else 1.',
50+
help='System ID for qgcs output format. Defaults to MAV_SYSID if defined else 1.',
5151
)
5252
parser.add_argument('-c', '--compid', type=int, default=-1,
5353
help='Component ID for qgcs output format. Defaults to 1.',
@@ -160,8 +160,8 @@ def output_params(defaults: Dict[str, float], format_type: str = 'missionplanner
160160
"""
161161
if format_type == "qgcs":
162162
if sysid == -1:
163-
if 'SYSID_THISMAV' in defaults:
164-
sysid = defaults['SYSID_THISMAV']
163+
if 'MAV_SYSID' in defaults:
164+
sysid = defaults['MAV_SYSID']
165165
else:
166166
sysid = 1 # if unspecified, default to 1
167167
if compid == -1:

0 commit comments

Comments
 (0)