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!
|
|