【问题标题】:Drone-kit function for getting x, y, and z position relative to a start point or take off location?用于获取相对于起点或起飞位置的 x、y 和 z 位置的无人机套件功能?
【发布时间】:2021-03-27 13:44:17
【问题描述】:

在飞行期间,例如使用 pixhawk,我想保存无人机的当前位置,以参考其初始起始位置。理想情况下,这将以米为单位的 x、y 和 z 位置。我知道您可以使用无人机套件保存纬度、经度或 IMU/速度读数,然后计算位置。但是,如果能够只调用一个为您计算 x、y 和 z 的函数,这样就不需要后处理了,那就太棒了。

【问题讨论】:

    标签: dronekit-python


    【解决方案1】:

    以下对我的目的来说是令人满意的(我相信你需要一个 GPS,但不是肯定的):

    from dronekit import connect
    vehicle = connect("Connection String", baud=57600)
    metersNorth = vehicle.location.local_frame.north # used for the y position
    metersEast = vehicle.location.local_frame.east # used for the x position
    altitude = vehicle.location.local_frame.down # used for the z position
    

    或者在我的情况下,我的测距仪朝下

    z = vehicle.rangefinder.distance
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-18
      • 2019-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多