我已经安装了dronekit 和dronekit sitl 并创建了hello.py 示例,我得到以下错误我是一个新手,如果它很明显很抱歉。这是我在 debian 下的 raspberry 3 上使用 python 2.7 运行的输出。这是代码
print "Start simulator (SITL)"
import dronekit_sitl
sitl = dronekit_sitl.start_default()
connection_string = sitl.connection_string()
# Import DroneKit-Python
from dronekit import connect, VehicleMode
# Connect to the Vehicle.
print("Connecting to vehicle on: %s" % (connection_string,))
vehicle = connect(connection_string, wait_ready=True)
# Get some vehicle attributes (state)
print "Get some vehicle attribute values:"
print " GPS: %s" % vehicle.gps_0
print " Battery: %s" % vehicle.battery
print " Last Heartbeat: %s" % vehicle.last_heartbeat
print " Is Armable?: %s" % vehicle.is_armable
print " System status: %s" % vehicle.system_status.state
print " Mode: %s" % vehicle.mode.name # settable
# Close vehicle object before exiting script
vehicle.close()
# Shut down simulator
sitl.stop()
print("Completed")
这是我得到的输出:
python hellp.py
Start simulator (SITL)
Starting copter simulator (SITL)
SITL already Downloaded and Extracted.
Ready to boot.
Traceback (most recent call last):
File "hellp.py", line 3, in <module>
sitl = dronekit_sitl.start_default()
File "/home/gus/.local/lib/python2.7/site-packages/dronekit_sitl/__init__.py", line 341, in start_default
sitl.launch(sitl_args, await_ready=True, restart=True)
File "/home/gus/.local/lib/python2.7/site-packages/dronekit_sitl/__init__.py", line 271, in launch
p = Popen([self.path] + args, cwd=wd, shell=sys.platform == 'win32', stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error
非常感谢您的帮助