DJI Phantom 4 Pro lands at incorrect location

89 Views Asked by At

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

There are 1 best solutions below

1
On BEST ANSWER

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!