linux系统链接飞控以及配置SITL以及ardupilot环境
先更改本机host到对象的ip
再进行ssh的链接
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-meuTGFrN-1651933771950)(https://s2.loli.net/2022/05/07/eY3L84RVOZF6MrS.png)]
链接成功进入系统
链接飞控
from dronekit import connect
# Connect to the Vehicle (in this case a UDP endpoint) 后边那个baud是波特率
vehicle = connect('/dev/ttyUSB0', wait_ready=True, baud=921600)
# vehicle is an instance of the Vehicle class
print "Autopilot Firmware version: %s" % vehicle.version
print "Autopilot capabilities (supports ftp): %s" % vehicle.capabilities.ftp
print "Global Location: %s" % vehicle.location.global_frame
print "Global Location (relative altitude): %s" % vehicle.location.global_relative_frame
print "Local Location: %s" % vehicle.location.local_frame #NED
print "Attitude: %s" % vehicle.attitude
print "Velocity: %s" % vehicle.velocity
print "GPS: %s" % vehicle.gps_0
print "Groundspeed: %s" % vehicle.groundspeed
print "Airspeed: %s" % vehicle.airspeed
print "Gimbal status: %s" % vehicle.gimbal
print