大疆 Phantom 4 Pro 降落在错误位置。

huangapple go评论57阅读模式
英文:

DJI Phantom 4 Pro lands at incorrect location

问题

背景

我正在构建一个任务规划器,它将从用户在地图上的点击处获取航点。在完成一个区域后,他将加载并启动任务。

预期/当前行为

当我启动任务时,它会经过所有的航点,然后在到达最后一个航点后,返回到起始点并降落。

问题是:它没有返回起始点,而是降落在最后一个航点上。

细节

下面的代码只是一个POJO对象的一部分

public WaypointMission toDjiMission() {
  final WaypointMission.Builder waypointMissionBuilder = new WaypointMission.Builder();
  
  final int waypointsSize = waypoints.size();
  for (int i = 0; i < waypointsSize; i++) {
    waypointMissionBuilder.addWaypoint(Waypoint.toDjiWaypoint(waypoints.get(i)));
  }
  
  return waypointMissionBuilder
    .setMissionID(id)
    .maxFlightSpeed(maxSpeedInMetersPerSecond.floatValue()) // 15
    .autoFlightSpeed(autoFlightSpeedInMetersPerSecond.floatValue()) // 8.5
    .flightPathMode(flightPathTurnMode.toDjiEnum()) // curved
    .headingMode(uavHeadingMode.toDjiEnum()) // auto
    .finishedAction(missionFinishedAction.toDjiEnum()) // Go home
    .build();
}

环境

  • Android 9
  • MSDK 4.13.1
  • Phantom 4 Pro
英文:

Context

I'm building a mission planner that will get waypoints from a user click on the map. After completing an area, he'll load and start the mission.

Expected/current behavior

When I start the mission, it goes through all the waypoints, and after arrives at the last one, it comes back to the home point and lands.

The problem is: it doesn't return home, instead it lands on the last waypoint.

Details

The code below is just a part of a POJO object

public WaypointMission toDjiMission() {
  final WaypointMission.Builder waypointMissionBuilder = new WaypointMission.Builder();
  
  final int waypointsSize = waypoints.size();
  for (int i = 0; i < waypointsSize; i++) {
    waypointMissionBuilder.addWaypoint(Waypoint.toDjiWaypoint(waypoints.get(i)));
  }
  
  return waypointMissionBuilder
    .setMissionID(id)
    .maxFlightSpeed(maxSpeedInMetersPerSecond.floatValue()) // 15
    .autoFlightSpeed(autoFlightSpeedInMetersPerSecond.floatValue()) // 8.5
    .flightPathMode(flightPathTurnMode.toDjiEnum()) // curved
    .headingMode(uavHeadingMode.toDjiEnum()) // auto
    .finishedAction(missionFinishedAction.toDjiEnum()) // Go home
    .build();
}

Environment

  • Android 9
  • MSDK 4.13.1
  • Phantom 4 Pro

答案1

得分: 2

有一些因素在起作用,并且有一些问题可以帮助澄清您所看到的情况:

第一个问题,飞机在到达最后航点时离起始点有多远?

由于某种原因,DJI设计了固件,使得如果飞机靠近起始点(我想在15米内),飞机会在原地着陆。这意味着,如果最后的航点靠近起始点,飞机可能已经认为它回到了起始点,并且会在原地着陆。

对于我编写的所有软件,我总是在我想要任务结束的特定航点上,使用AUTO_LAND作为完成动作,它消除了上述问题,并始终确保正确的结果(即,没有因为固件逻辑而产生的不确定性)。

我的建议是在起始点上方添加一个航点,这是最好的解决方案!

英文:

There are a few thing in play and a few questions that can help clarify what you are seeing:

First question, how far away from home is the aircraft when the last waypoint is reached?

For whatever reason, DJI designed the firmware such that if the aircraft is close to home (I think close it within 15m) then the aircraft lands in place. This means, if the last waypoint is close to the home point, it might already believe it is home and just land in place.

For all the software I write, I always add a specific waypoint on where I want the mission to end and use AUTO_LAND as the finishedAction, it's removes the above issue and always guarantees the correct results (aka, no 'iffyness' because of firmware logic).

My suggestion would be to add a waypoint above the home point, it's the best solution!

huangapple
  • 本文由 发表于 2020年10月16日 06:03:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/64380276.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定