mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 08:21:37 +08:00
Tools: use Python 3, improve import checks
In more detail: - Change shebang to Python 3. - Suggest installation using pip3 as user.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Stream ULog data over MAVLink.
|
||||
@@ -12,15 +12,17 @@ import sys, select, os
|
||||
import datetime
|
||||
from timeit import default_timer as timer
|
||||
os.environ['MAVLINK20'] = '1' # The commands require mavlink 2
|
||||
from argparse import ArgumentParser
|
||||
|
||||
try:
|
||||
from pymavlink import mavutil
|
||||
except:
|
||||
print("Failed to import pymavlink.")
|
||||
print("You may need to install it with 'pip install pymavlink pyserial'")
|
||||
except ImportError as e:
|
||||
print("Failed to import pymavlink: " + e)
|
||||
print("")
|
||||
raise
|
||||
from argparse import ArgumentParser
|
||||
print("You may need to install it with:")
|
||||
print(" pip3 install --user pymavlink")
|
||||
print("")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
class MavlinkLogStreaming():
|
||||
|
||||
Reference in New Issue
Block a user