mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 19:03:33 +08:00
MAVLink shell: Fix OS X default path
This commit is contained in:
+14
-11
@@ -99,19 +99,22 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
if args.port == None:
|
if args.port == None:
|
||||||
serial_list = mavutil.auto_detect_serial(preferred_list=['*FTDI*',
|
if sys.platform == "darwin":
|
||||||
"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])
|
args.port = "/dev/tty.usbmodem1"
|
||||||
|
else:
|
||||||
|
serial_list = mavutil.auto_detect_serial(preferred_list=['*FTDI*',
|
||||||
|
"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])
|
||||||
|
|
||||||
if len(serial_list) == 0:
|
if len(serial_list) == 0:
|
||||||
print("Error: no serial connection found")
|
print("Error: no serial connection found")
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(serial_list) > 1:
|
if len(serial_list) > 1:
|
||||||
print('Auto-detected serial ports are:')
|
print('Auto-detected serial ports are:')
|
||||||
for port in serial_list:
|
for port in serial_list:
|
||||||
print(" {:}".format(port))
|
print(" {:}".format(port))
|
||||||
print('Using port {:}'.format(serial_list[0]))
|
print('Using port {:}'.format(serial_list[0]))
|
||||||
args.port = serial_list[0].device
|
args.port = serial_list[0].device
|
||||||
|
|
||||||
|
|
||||||
print("Connecting to MAVLINK...")
|
print("Connecting to MAVLINK...")
|
||||||
|
|||||||
Reference in New Issue
Block a user