Comments

6 comments

  • DJI Developer Support
    尊敬的开发者, 您好,感谢您联系DJI 大疆创新。 里面是Log截图,暂时不明白您的问题是什么。能否发一下您的航点动作代码过来,一般不执行是因为你的设置有问题。 希望我们的解决方案能够帮到您,感谢您的邮件,祝您生活愉快! Best Regards, DJI 大疆创新SDK技术支持
    0
    Comment actions Permalink
  • msdk-dji-dev

    航线飞行正常执行, 但是路点动作卡死在actionId为8的动作上, 不会继续往下执行.

    0
    Comment actions Permalink
  • msdk-dji-dev

    后面的路点动作包括拍照等都不再执行

    0
    Comment actions Permalink
  • DJI Developer Support
    尊敬的开发者, 您好,感谢您联系DJI 大疆创新。 你需要看你的航点动作搭配才知道为什么卡死在8。你需要检查下触发器和执行器是否搭配。建议再看下文档,和Sample对比一下。 希望我们的解决方案能够帮到您,感谢您的邮件,祝您生活愉快! Best Regards, DJI 大疆创新SDK技术支持
    0
    Comment actions Permalink
  • msdk-dji-dev

    这是相应触发器和执行器的绑定,贵方可以帮忙分析一下是否搭配的合理吗

    0
    Comment actions Permalink
  • msdk-dji-dev
    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);
        }
    0
    Comment actions Permalink

Please sign in to leave a comment.