drone-kit Python 未与 Iris+ 连接
drone-kit Python is not connecting with Iris+
我正在尝试构建我的第一个 dronekit python 程序,我正在用一些示例进行一些测试,但我无法连接到我的无人机 (Iris+)。我插入了 USB 收音机(3DR 915 MHz),然后输入 vehicle = connect('/dev/ttyUSB0', wait_ready=True)
。其实我不知道我应该输入哪个字符串。在此先感谢大家,我需要一些帮助!
我的代码:
print "Start simulator (SITL)"
from dronekit_sitl import SITL
sitl = SITL()
sitl.download('copter', '3.3', verbose=True)
sitl_args = ['-I0', '--model', 'quad', '--home=-35.363261,149.165230,584,353']
sitl.launch(sitl_args, await_ready=True, restart=True)
# Import DroneKit-Python
from dronekit import connect, VehicleMode
import time
# Connect to the Vehicle.
print "Connecting to vehicle on: '/dev/ttyUSB0'"
vehicle = connect('/dev/ttyUSB0', 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")
现在获得 dk 支持的最佳位置可能是这里:https://discuss.dronekit.io/c/python
作为回答,我还没有在 Linux 上试过这个。我怀疑连接字符串是正确的,但您可能还必须使用 baud=57600
设置波特率
我正在尝试构建我的第一个 dronekit python 程序,我正在用一些示例进行一些测试,但我无法连接到我的无人机 (Iris+)。我插入了 USB 收音机(3DR 915 MHz),然后输入 vehicle = connect('/dev/ttyUSB0', wait_ready=True)
。其实我不知道我应该输入哪个字符串。在此先感谢大家,我需要一些帮助!
我的代码:
print "Start simulator (SITL)"
from dronekit_sitl import SITL
sitl = SITL()
sitl.download('copter', '3.3', verbose=True)
sitl_args = ['-I0', '--model', 'quad', '--home=-35.363261,149.165230,584,353']
sitl.launch(sitl_args, await_ready=True, restart=True)
# Import DroneKit-Python
from dronekit import connect, VehicleMode
import time
# Connect to the Vehicle.
print "Connecting to vehicle on: '/dev/ttyUSB0'"
vehicle = connect('/dev/ttyUSB0', 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")
现在获得 dk 支持的最佳位置可能是这里:https://discuss.dronekit.io/c/python
作为回答,我还没有在 Linux 上试过这个。我怀疑连接字符串是正确的,但您可能还必须使用 baud=57600
设置波特率