测试发现4.16.1的航点动作属性-waitingTime的最大值为25s.
V2航点任务的悬停需要通过这个属性实现,这时如果要实现超过25s的悬停可以在上一个START_STOP_FLY的动作之后再接几个带有waitingTime属性的START_STOP_FLY动作,从而实现时间上的累加。
下面是实现悬停50s的航点动作示例代码:
WaypointTrigger waypointActionTrigger = new WaypointTrigger.Builder()
.setTriggerType(ActionTypes.ActionTriggerType.ASSOCIATE)
.setAssociateParam(new WaypointV2AssociateTriggerParam.Builder()
.setAssociateActionID(associateActionId)
.setAssociateType(ActionTypes.AssociatedTimingType.AFTER_FINISHED)
.setWaitingTime(25)
.build())
.build();
WaypointActuator waypointActionActuator = new WaypointActuator.Builder()
.setActuatorType(ActionTypes.ActionActuatorType.AIRCRAFT_CONTROL)
.setAircraftControlActuatorParam(new WaypointAircraftControlParam.Builder()
.setAircraftControlType(ActionTypes.AircraftControlType.START_STOP_FLY)
.setFlyControlParam(new WaypointAircraftControlStartStopFlyParam.Builder()
.setStartFly(false)
.build())
.build())
.build();
WaypointV2Action waypointAction = new WaypointV2Action.Builder()
.setActionID(++actionId)
.setTrigger(waypointActionTrigger)
.setActuator(waypointActionActuator)
.build();
waypointV2ActionList.add(waypointAction);
WaypointTrigger waypointActionTrigger1 = new WaypointTrigger.Builder()
.setTriggerType(ActionTypes.ActionTriggerType.ASSOCIATE)
.setAssociateParam(new WaypointV2AssociateTriggerParam.Builder()
.setAssociateActionID(associateActionId)
.setAssociateType(ActionTypes.AssociatedTimingType.AFTER_FINISHED)
.setWaitingTime(25)
.build())
.build();
WaypointActuator waypointActionActuator1 = new WaypointActuator.Builder()
.setActuatorType(ActionTypes.ActionActuatorType.AIRCRAFT_CONTROL)
.setAircraftControlActuatorParam(new WaypointAircraftControlParam.Builder()
.setAircraftControlType(ActionTypes.AircraftControlType.START_STOP_FLY)
.setFlyControlParam(new WaypointAircraftControlStartStopFlyParam.Builder()
.setStartFly(false)
.build())
.build())
.build();
WaypointV2Action waypointAction = new WaypointV2Action.Builder()
.setActionID(++actionId)
.setTrigger(waypointActionTrigger1)
.setActuator(waypointActionActuator1)
.build();
waypointV2ActionList.add(waypointAction);
评论
0 条评论
请登录写评论。