Occasional error thrown by newStopIntervalPhotoAction()
已完成I am including newStopIntervalPhotoAction() (from the Android MSDK) in a Timeline.
Randomly, about 1 in every 10 times, it reports an error in the MissionControl.Listener().
The error is 'The execution cannot be executed'. The variables at this point are:
element.getClass().getSimpleName() is ShootPhotoAction
event.toString() is FINISHED
element.actiontype is STOP
Can anyone confirm if this command works reliably for the Android MSDK- I'm on V4.16. And for now I am only trying it out in simulator mode.
====================
I note in the API Reference, it says
Initialize object to stop shooting photos. Only works if there was a previous ShootPhotoAction in the timeline which started shooting photos using the newShootIntervalPhotoAction initializer with wait set to false.
but I find this confusing as I cannot see a parameter for WAIT- there are only 2 parameters:
static ShootPhotoAction newShootIntervalPhotoAction(int count, int interval)
I note also that the IOS version DOES have a WAIT parameter- is there confusion there?
(instancetype _Nullable)initWithPhotoCount:(int)count timeInterval:(double)interval waitUntilFinish:(BOOL)wait
=========================
My usage case is: I want to take photos for the duration of a Hotpoint. I dont want to take photos after the Hotpoint is finished. The time taken for the drone to go to the circle start point is variable- so I cannot put in an exact photo count. I therefore must put in a count that I know will be too large, and then stop it when the Hotpoint is finished.
=========================
My (simplified) code is as follows:
Integer Cnt = 20; //Pick a number that is definitely big enough to last until the end of the HotPoint-
ShootPhotoAction Photo = ShootPhotoAction.newShootIntervalPhotoAction(Cnt,3);
TLElements.add(Photo);
HotpointMission hotpointMission = new HotpointMission();
hotpointMission.setHotpoint(new LocationCoordinate2D(MyLat,MyLng));
hotpointMission.setAltitude(MyAlt);
hotpointMission.setRadius(MyRadius);
hotpointMission.setAngularVelocity(MyAngVel);
hotpointMission.setStartPointHotpointStartPoint.NEAREST
hotpointMission.setHeading(HotpointHeading.TOWARDS_HOT_POINT);
HotpointAction HA = new HotpointAction(hotpointMission);
HA.setDelayTime(10000);
TLElements.add(HA);
TLElements.add(ShootPhotoAction.newStopIntervalPhotoAction());//I want to stop taking photos when hotpoint completes
=========================
-
You are on the right track. To clarify, I have the interval fixed at 3sec for exactly that reason. And the error never occurs on the ShootPhoto action. It only occurs for the newStopIntervalPhotoAction().
My guess is that if the Stop action arrives at the moment when a photo is being taken, the error is thrown.
(So with approximation figures, if the time to take and process a photo is 0.3sec, my interval is 3sec, a random clash will occur about 1 in 10 times I issue the STOP command- which is what I am observing)
-
Some further information as I am still testing...
The STOP command still works even when it throws the error i.e. no more photos are taken
Secondly, it MAY only be happening when the newStopIntervalPhotoAction is the last item in the Timeline. On one occasion when I was in debug, I noticed the additional information of "The mission has already completed".
I will try to verify this with a further dummy action where there are no further actions.
请先登录再写评论。
评论
4 条评论