Waypoint photos failing
421 3 2022-5-5
Uploading and Loding Picture ...(0/1)
o(^-^)o
djiuser_rGfECymr8blF
lvl.3
Portugal
Offline

Hi,

I'm creating an application using Waypoint Mission where the drone will fly through multiple waypoints and take a photo everytime it reaches a waypoint and without stoppinng the drone.
I'm using Curved Flight Path Mode and I have a listener getting an Execution update that takes a photo everytime a waypoint is reached. But the problem is that some times the photo is not taken, it gives me an error saying "Camera is busy or the command is not supported in the Camera's current state"

Here is a sample of my code:

WaypointMission.Builder waypointMissionBuilder = null;
waypointMissionBuilder = new WaypointMission.Builder().finishedAction(WaypointMissionFinishedAction.NO_ACTION)
        .headingMode(WaypointMissionHeadingMode.CONTROL_BY_REMOTE_CONTROLLER)
        .autoFlightSpeed((float) mSpeed)
        .maxFlightSpeed((float) mSpeed)
        .flightPathMode(WaypointMissionFlightPathMode.CURVED);
for (int i = startPoint; i < endPoint; i++){
    waypointList.get(i).altitude = mAltitude;
    waypointMissionBuilder.addWaypoint(waypointList.get(i));
}
mWaypointMission = waypointMissionBuilder.build();

DJIError error = getWaypointMissionOperator().loadMission(mWaypointMission);
if (error == null) {
    showToast("Waypoint loaded successfully!");
} else {
    showToast("Waypoint load failed , error" + error.getDescription());
}
@Override
public void onExecutionUpdate(WaypointMissionExecutionEvent executionEvent) {
    if (executionEvent.getProgress() != null) {
        if (executionEvent.getProgress().isWaypointReached
                && executionEvent.getProgress().executeState == WaypointMissionExecuteState.BEGIN_ACTION) {
            //Bitmap greenMark = ((BitmapDrawable)getResources().getDrawable(R.drawable.green_corner_circle_35px)).getBitmap();
            takePhoto();
            waypointIndex = waypointIndex + 1;
        }
    }
}


Thank You!

2022-5-5
Use props
djiuser_rGfECymr8blF
lvl.3
Portugal
Offline

I'm using a Mavic 2 Enterprise Advanced
2022-5-5
Use props
djiuser_OR8EW5uz3gSA
lvl.4

Canada
Offline

Maybe the actions are not executing because the flight path mode is set to curved?

From the documentation for addAction

'The action will only be executed when the mission's flightPathMode property is set to DJIWaypointMissionFlightPathNormal and will not be executed when the mission's flightPathMode property is set to DJIWaypointMissionFlightPathCurved'
2022-5-9
Use props
djiuser_rGfECymr8blF
lvl.3
Portugal
Offline

djiuser_OR8EW5uz3gSA Posted at 5-9 09:04
Maybe the actions are not executing because the flight path mode is set to curved?

From the documentation for addAction

Hi, sorry for the late reply.

I'm not using Actions, I have a listener to detect when the drone reaches a waypoint and then I call a function to start shoot photo.

I realized that the problem was that I had FFC Mode set to auto and if the camera was triggering the ffc and at same time I call my function to shoot photo it would not work because the camera would be busy triggering the FFC.

But thank you for your suggestion  
2022-7-4
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules