路点飞行中路点动作不执行,pre/cur ActuatorState一直都是1, 日志如链接,https://sp...
已完成 路点飞行中路点动作不执行,pre/cur ActuatorState一直都是1, 日志如链接,https://space.dingtalk.com/s/gwHOAvCkbwLOiZTTUgPaACBmMmEzNDFmZGMzMmM0YzRhYWIxYTA0OTBmZjQ0ZTExMw 密码: P8af
-
DJIWaypointV2Action* DY::WayPointMissionV2::createDJIWaypointV2Action(int actionId, int actionIdAssociated, std::shared_ptr<DyWaypointAction> action){if(action->type == CAMERA_TAKE_PHOTO){DJIWaypointV2AssociateTriggerParam associateTriggerParam;associateTriggerParam.actionIdAssociated = actionIdAssociated;associateTriggerParam.actionAssociatedType = DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised;associateTriggerParam.waitingTime = 0;
auto *trigger = new DJIWaypointV2Trigger(DJIWaypointV2ActionTriggerTypeActionAssociated, &associateTriggerParam);auto *cameraActuatorParam = new DJIWaypointV2CameraActuatorParam(DJIWaypointV2ActionActuatorCameraOperationTypeTakePhoto, nullptr);auto *actuator = new DJIWaypointV2Actuator(DJIWaypointV2ActionActuatorTypeCamera, 0, cameraActuatorParam);return new DJIWaypointV2Action(actionId, *trigger, *actuator);}
if(action->type == CAMERA_START_RECORD_VIDEO){DJIWaypointV2AssociateTriggerParam associateTriggerParam;associateTriggerParam.actionIdAssociated = actionIdAssociated;associateTriggerParam.actionAssociatedType = DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised;associateTriggerParam.waitingTime = 0;
auto *trigger = new DJIWaypointV2Trigger(DJIWaypointV2ActionTriggerTypeActionAssociated, &associateTriggerParam);auto *cameraActuatorParam = new DJIWaypointV2CameraActuatorParam(DJIWaypointV2ActionActuatorCameraOperationTypeStartRecordVideo, nullptr);auto *actuator = new DJIWaypointV2Actuator(DJIWaypointV2ActionActuatorTypeCamera, 0, cameraActuatorParam);return new DJIWaypointV2Action(actionId, *trigger, *actuator);}
if(action->type == CAMERA_STOP_RECORD_VIDEO){DJIWaypointV2AssociateTriggerParam associateTriggerParam;associateTriggerParam.actionIdAssociated = actionIdAssociated;associateTriggerParam.actionAssociatedType = DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised;associateTriggerParam.waitingTime = 0;
auto *trigger = new DJIWaypointV2Trigger(DJIWaypointV2ActionTriggerTypeActionAssociated, &associateTriggerParam);auto *cameraActuatorParam = new DJIWaypointV2CameraActuatorParam(DJIWaypointV2ActionActuatorCameraOperationTypeStopRecordVideo, nullptr);auto *actuator = new DJIWaypointV2Actuator(DJIWaypointV2ActionActuatorTypeCamera, 0, cameraActuatorParam);return new DJIWaypointV2Action(actionId, *trigger, *actuator);}
if(action->type == CAMERA_FOCUS){DJIWaypointV2AssociateTriggerParam associateTriggerParam;associateTriggerParam.actionIdAssociated = actionIdAssociated;associateTriggerParam.actionAssociatedType = DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised;associateTriggerParam.waitingTime = 0;
std::shared_ptr<FocusAction> focusAction = std::dynamic_pointer_cast<FocusAction>(action);DJIWaypointV2CameraFocusParam focusParam;focusParam.focusTarget.x = focusAction->focusX;focusParam.focusTarget.y = focusAction->focusY;focusParam.retryTimes = 0;//focusParam.focusDelayTime = focusAction->focusDelayTime;
auto *trigger = new DJIWaypointV2Trigger(DJIWaypointV2ActionTriggerTypeActionAssociated, &associateTriggerParam);auto *cameraActuatorParam = new DJIWaypointV2CameraActuatorParam(DJIWaypointV2ActionActuatorCameraOperationTypeFocus, &focusParam);auto *actuator = new DJIWaypointV2Actuator(DJIWaypointV2ActionActuatorTypeCamera, 0, cameraActuatorParam);return new DJIWaypointV2Action(actionId, *trigger, *actuator);}
if(action->type == CAMERA_ZOOM){DJIWaypointV2AssociateTriggerParam associateTriggerParam;associateTriggerParam.actionIdAssociated = actionIdAssociated;associateTriggerParam.actionAssociatedType = DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised;associateTriggerParam.waitingTime = 0;
std::shared_ptr<ZoomAction> zoomAction = std::dynamic_pointer_cast<ZoomAction>(action);DJIWaypointV2CameraFocalLengthParam zoomParam;zoomParam.focalLength = zoomAction->focalLength;zoomParam.retryTimes = 0;
auto *trigger = new DJIWaypointV2Trigger(DJIWaypointV2ActionTriggerTypeActionAssociated, &associateTriggerParam);auto *cameraActuatorParam = new DJIWaypointV2CameraActuatorParam(DJIWaypointV2ActionActuatorCameraOperationTypeFocalLength, &zoomParam);auto *actuator = new DJIWaypointV2Actuator(DJIWaypointV2ActionActuatorTypeCamera, 0, cameraActuatorParam);return new DJIWaypointV2Action(actionId, *trigger, *actuator);}
if(action->type == GIMBAL_ROTATE){DJIWaypointV2AssociateTriggerParam associateTriggerParam;associateTriggerParam.actionIdAssociated = actionIdAssociated;associateTriggerParam.actionAssociatedType = DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised;associateTriggerParam.waitingTime = 0;
std::shared_ptr<RotateGimbalAction> gimbalAction = std::dynamic_pointer_cast<RotateGimbalAction>(action);DJIGimbalRotation rotation;rotation.x = 10 * gimbalAction->rollDeg;rotation.y = 10 * gimbalAction->pitchDeg;rotation.z = 10 * gimbalAction->yawDeg;rotation.ctrl_mode = gimbalAction->ctrlMode;rotation.rollCmdIgnore = gimbalAction->rollCmdIgnore;rotation.pitchCmdIgnore = gimbalAction->pitchCmdIgnore;rotation.yawCmdIgnore = gimbalAction->yawCmdIgnore;rotation.absYawModeRef = gimbalAction->absYawModeRef;//rotation.duationTime = 10 * gimbalAction->durationTime;rotation.duationTime = 5; // hard coded for duration time as 1s
auto *trigger = new DJIWaypointV2Trigger(DJIWaypointV2ActionTriggerTypeActionAssociated, &associateTriggerParam);auto *gimbalActuatorParam = new DJIWaypointV2GimbalActuatorParam(DJIWaypointV2ActionActuatorGimbalOperationTypeRotateGimbal, &rotation);auto *actuator = new DJIWaypointV2Actuator(DJIWaypointV2ActionActuatorTypeGimbal, 0, gimbalActuatorParam);return new DJIWaypointV2Action(actionId, *trigger, *actuator);}
if(action->type == AIRCRAFT_ROTATE_HEADING){DJIWaypointV2AssociateTriggerParam associateTriggerParam;associateTriggerParam.actionIdAssociated = actionIdAssociated;associateTriggerParam.actionAssociatedType = DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised;associateTriggerParam.waitingTime = 0;
std::shared_ptr<RotateHeadingAction> headingAction = std::dynamic_pointer_cast<RotateHeadingAction>(action);DJIWaypointV2AircraftControlRotateHeadingParam rotateParam;rotateParam.isRelative = headingAction->isRelative;rotateParam.yaw = headingAction->yaw;
auto *trigger = new DJIWaypointV2Trigger(DJIWaypointV2ActionTriggerTypeActionAssociated, &associateTriggerParam);auto *airCraftControlActuatorParam = new DJIWaypointV2AircraftControlParam(DJIWaypointV2ActionActuatorAircraftControlOperationTypeRotateYaw, &rotateParam);auto *actuator = new DJIWaypointV2Actuator(DJIWaypointV2ActionActuatorTypeAircraftControl, 0, airCraftControlActuatorParam);return new DJIWaypointV2Action(actionId, *trigger, *actuator);}
请先登录再写评论。
评论
6 条评论