You can use START_STOP_FLY to achieve this goal.
WaypointActuator waypointAction1Actuator = 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();
By using this action, the aircraft will hover in air. During the hover state, you can execute other waypointActions. After all waypointActions have finished, you can use a trigger to trigger the START_STOP_FLY action and fly to the next waypoint.
WaypointTrigger waypointAction2Trigger = new WaypointTrigger.Builder()
.setTriggerType(ActionTypes.ActionTriggerType.ASSOCIATE)
.setAssociateParam(new WaypointV2AssociateTriggerParam.Builder()
.setAssociateActionID(associateActionId)
.setAssociateType(ActionTypes.AssociatedTimingType.AFTER_FINISHED)
.setWaitingTime(0)
.build())
.build();
WaypointActuator waypointAction2Actuator = new WaypointActuator.Builder()
.setActuatorType(ActionTypes.ActionActuatorType.AIRCRAFT_CONTROL)
.setAircraftControlActuatorParam(new WaypointAircraftControlParam.Builder()
.setAircraftControlType(ActionTypes.AircraftControlType.START_STOP_FLY)
.setFlyControlParam(new WaypointAircraftControlStartStopFlyParam.Builder()
.setStartFly(true)
.build())
.build())
.build();
WaypointV2Action waypointAction2 = new WaypointV2Action.Builder()
.setActionID(++actionId)
.setTrigger(waypointAction2Trigger)
.setActuator(waypointAction2Actuator)
.build();
waypointV2ActionList.add(waypointAction2);
After executing this action, the aircraft will cancel the hover in air action.
Comments
0 comments
Please sign in to leave a comment.