我怎样才能将 GPS 数据发送到鹦鹉 ar 无人机并转到我的无人机到 gps 位置?

How can i send the GPS data to parrot ar drone and go to my drone to gps position?

我正在使用 node ar drone modules。我的无人机是parrot ar drone 2.0 gps edition 我成功获取了parrot ar drone gps数据。我想将鹦鹉 ar 无人机发送到操纵的 gps 位置。但是我无法将gps数据发送到parrot ar无人机。

有什么方法可以将操纵的 gps 数据发送到我的鹦鹉 ar 无人机吗?

有两种方法可以做到这一点。

首先,艰难的道路。 node-ar-drone 用于与 AR.Drone 通信的协议没有任何方法可以直接给无人机坐标飞向,但你可以自己计算。

  1. 启用无人机的磁力计(参见https://github.com/wiseman/webflight-traffic/blob/master/index.js#L19)。
  2. 校准磁力计:命令无人机起飞,然后执行client.calibrate(0)(参见https://github.com/felixge/node-ar-drone#clientcalibratedevice_num)。
  3. navdata.magneto.heading.fusionUnwrapped获取无人机的磁航向。
  4. navdata.gps.latitudenavdata.gps.longitude获取无人机当前坐标。
  5. 计算从无人机当前位置到目的地所需的航向。这有一些微妙之处,但对于大多数应用程序,您可以按照 http://www.movable-type.co.uk/scripts/latlong.html:

    中描述的过程进行操作

    θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ ) 其中φ1,λ1为起点,φ2,λ2为终点(Δλ为经度差)。

    由于 atan2 returns 值在 -π ... +π(即 -180° ... +180°)范围内,将结果标准化为罗盘方位(在范围内0° ... 360°,其中 −ve 值转换为 180° ... 360°),转换为度数,然后使用 (θ+360) % 360,其中 % 是(浮点)模数。

  6. 判断无人机是否需要顺时针或逆时针旋转以达到所需航向,并根据需要调用client.clockwiseclient.counterClockwise

  7. 当无人机朝向正确航向时,用client.front告诉它前进。

一旦无人机朝着正确的方向飞行,每次获得新的导航数据时,您应该检查当前航向,重新计算所需的航向,并在需要时告诉无人机顺时针或逆时针转动。一旦你在你想要的目的地的某个阈值(5 英尺?50 英尺?)内,告诉无人机停止 client.stop

除了node-ar-drone使用的协议外,AR.Drone还支持MAVLink protocol, used by many hobbyist and commercial drones. That protocol has a way to tell the drone to move directly to specific coordinates. You could use an application like QGroundControl将无人机发送到特定的纬度,经度,或者您可以使用现有的MAVLink之一图书馆向无人机发送信息来做同样的事情。

DroneKit-Python,例如, 是一个高级库,可让您编写如下代码(取自 this example):

# set the default travel speed
vehicle.airspeed=3

point1 = LocationGlobalRelative(-35.361354, 149.165218, 20)
vehicle.simple_goto(point1)