diff --git a/Tools/autotest/param_metadata/param.py b/Tools/autotest/param_metadata/param.py index 3080c80076..7c6c96762d 100644 --- a/Tools/autotest/param_metadata/param.py +++ b/Tools/autotest/param_metadata/param.py @@ -5,7 +5,9 @@ class Parameter(object): class Vehicle(object): - def __init__(self, name, path): + def __init__(self, name, path, truename=None): + if truename is not None: + self.truename = truename self.name = name self.path = path self.params = [] diff --git a/Tools/autotest/param_metadata/param_parse.py b/Tools/autotest/param_metadata/param_parse.py index 5f3807eafe..4417beff98 100755 --- a/Tools/autotest/param_metadata/param_parse.py +++ b/Tools/autotest/param_metadata/param_parse.py @@ -56,10 +56,17 @@ def error(str_to_print): error_count += 1 print(str_to_print) +truename_map = { + "APMrover2": "Rover", + "ArduSub": "Sub", + "ArduCopter": "Copter", + "ArduPlane": "Plane", + "AntennaTracker": "Tracker", +} for vehicle_path in vehicle_paths: name = os.path.basename(os.path.dirname(vehicle_path)) path = os.path.normpath(os.path.dirname(vehicle_path)) - vehicles.append(Vehicle(name, path)) + vehicles.append(Vehicle(name, path, truename_map[name])) debug('Found vehicle type %s' % name) if len(vehicles) > 1: @@ -154,7 +161,7 @@ def process_library(vehicle, library, pathprefix=None): for field in fields: only_for_vehicles = field[1].split(",") # print("vehicle=%s field[1]=%s only_for_vehicles=%s\n" % (vehicle.name,field[1], str(only_for_vehicles))) - if vehicle.name not in only_for_vehicles: + if vehicle.truename not in only_for_vehicles: continue; if field[0] in known_param_fields: setattr(p, field[0], field[2])