mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
autotest: look in parent directories for vehicle type in sim_vehicle.py
this allows eeprom.bin per vehicle type without using -v
This commit is contained in:
parent
043b1d321d
commit
a8e5255b90
@ -277,6 +277,18 @@ default_frame_for_vehicle = {
|
|||||||
"AntennaTracker": "tracker"
|
"AntennaTracker": "tracker"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not default_frame_for_vehicle.has_key(opts.vehicle):
|
||||||
|
# try in parent directories, useful for having config in subdirectories
|
||||||
|
cwd = os.getcwd()
|
||||||
|
while cwd:
|
||||||
|
bname = os.path.basename(cwd)
|
||||||
|
if not bname:
|
||||||
|
break
|
||||||
|
if bname in default_frame_for_vehicle:
|
||||||
|
opts.vehicle = bname
|
||||||
|
break
|
||||||
|
cwd = os.path.dirname(cwd)
|
||||||
|
|
||||||
# try to validate vehicle
|
# try to validate vehicle
|
||||||
if not default_frame_for_vehicle.has_key(opts.vehicle):
|
if not default_frame_for_vehicle.has_key(opts.vehicle):
|
||||||
progress("** Is (%s) really your vehicle type? Try -v VEHICLETYPE if not, or be in the e.g. ArduCopter subdirectory" % (opts.vehicle,))
|
progress("** Is (%s) really your vehicle type? Try -v VEHICLETYPE if not, or be in the e.g. ArduCopter subdirectory" % (opts.vehicle,))
|
||||||
|
Loading…
Reference in New Issue
Block a user