Waypoint V2 Type

2023-07-10
暂无评分

waypoint V2 type相关的头文件为dji_waypoint_v2_type.h,本文档描述了dji_waypoint_v2_type.h 文件中结构体和函数原型的关键信息和使用方法。

目录

宏定义、枚举与结构体

  • 数据结构
typedef dji_f32_t T_DjiWaypointV2GlobalCruiseSpeed;

typedef enum E_DJIWaypointV2MissionFinishedAction

航点任务完成后将采取行动。

typedef enum {


    DJI_WAYPOINT_V2_FINISHED_NO_ACTION,

    
    DJI_WAYPOINT_V2_FINISHED_GO_HOME,

    
    DJI_WAYPOINT_V2_FINISHED_AUTO_LANDING,

    
    DJI_WAYPOINT_V2_FINISHED_GO_TO_FIRST_WAYPOINT,


    DJI_WAYPOINT_V2_FINISHED_CONTINUE_UNTIL_STOP
} E_DJIWaypointV2MissionFinishedAction;

typedef enum E_DJIWaypointV2MissionActionWhenRcLost

typedef enum {
    
    DJI_WAYPOINT_V2_MISSION_STOP_WAYPOINT_V2_AND_EXECUTE_RC_LOST_ACTION,

    
    DJI_WAYPOINT_V2_MISSION_KEEP_EXECUTE_WAYPOINT_V2,
} E_DJIWaypointV2MissionActionWhenRcLost;

typedef enum E_DJIWaypointV2MissionGotoFirstWaypointMode

typedef enum {

    DJI_WAYPOINT_V2_MISSION_GO_TO_FIRST_WAYPOINT_MODE_SAFELY,

    DJI_WAYPOINT_V2_MISSION_GO_TO_FIRST_WAYPOINT_MODE_POINT_TO_POINT,
} E_DJIWaypointV2MissionGotoFirstWaypointMode;

typedef enum E_DJIWaypointV2FlightPathMode

航点飞行路径模式

typedef enum {

    
    DJI_WAYPOINT_V2_FLIGHT_PATH_MODE_GO_TO_POINT_ALONG_CURVE,

    
    DJI_WAYPOINT_V2_FLIGHT_PATH_MODE_GO_TO_POINT_ALONG_CURVE_AND_STOP,

    
    DJI_WAYPOINT_V2_FLIGHT_PATH_MODE_GO_TO_POINT_IN_STRAIGHT_AND_STOP,

    
    DJI_WAYPOINT_V2_FLIGHT_PATH_MODE_COORDINATE_TURN,

    
    DJI_WAYPOINT_V2_FLIGHT_PATH_MODE_GO_TO_FIRST_POINT_ALONG_STRAIGHT_LINE,

    
    DJI_WAYPOINT_V2_FLIGHT_PATH_MODE_STRAIGHT_OUT,

    
    DJI_WAYPOINT_V2_FLIGHT_PATH_MODE_UNKNOWN = 0xFF,
} E_DJIWaypointV2FlightPathMode;

typedef enum E_DJIWaypointV2HeadingMode

表示当前航点上当前飞机的航向模式。

typedef enum {

    
    DJI_WAYPOINT_V2_HEADING_MODE_AUTO,

    
    DJI_WAYPOINT_V2_HEADING_FIXED,

    
    DJI_WAYPOINT_V2_HEADING_MANUAL,

    
    DJI_WAYPOINT_V2_HEADING_WAYPOINT_CUSTOM,

    
    DJI_WAYPOINT_V2_HEADING_TOWARDS_POINT_OD_INTEREST,

    
    DJI_WAYPOINT_V2_HEADING_GIMBAL_YAW_FOLLOW,

    
    DJI_WAYPOINT_V2_HEADING_UNKNOWN = 0xFF,
} E_DJIWaypointV2HeadingMode;

typedef enum E_DJIWaypointV2TurnMode

飞行器改变航向以适应航路点航向时的方向。

typedef enum {

    
    DJI_WAYPOINT_V2_TURN_MODE_CLOCK_WISE,

    
    DJI_WAYPOINT_V2_TURN_MODE_COUNTER_CLOCK_WISE,

    
    DJI_WAYPOINT_V2_TURN_MODE_UNKNOWN = 0xFF,
} E_DJIWaypointV2TurnMode;

typedef enum E_DJIWaypointV2MissionState

WaypointV2MissionOperator的所有可能状态

typedef enum {
    
    DJI_WAYPOINT_V2_MISSION_STATE_UNKNOWN = -1,

    
    DJI_WAYPOINT_V2_MISSION_STATE_DISCONNECTED = 0,

    
    DJI_WAYPOINT_V2_MISSION_STATE_READY_TO_EXECUTE = -1,

    
    DJI_WAYPOINT_V2_MISSION_STATE_EXECUTING = 2,

    
    DJI_WAYPOINT_V2_MISSION_STATE_INTERRUPTED = 3,

    
    DJI_WAYPOINT_V2_MISSION_STATE_RESUME_AFTER_INTERRUPTED = 4,

    
    DJI_WAYPOINT_V2_MISSION_STATE_EXIT_MISSION = 5,

    
    DJI_WAYPOINT_V2_MISSION_STATE_FINISHED_MISSION = 6,
} E_DJIWaypointV2MissionState;

typedef struct T_DjiWaypointV2RelativePosition

航点位置相对于 WayPointV2InitSettings 的参考点

typedef struct {
    dji_f32_t positionX; 
    dji_f32_t positionY; 
    dji_f32_t positionZ; 
} T_DjiWaypointV2RelativePosition;

typedef struct T_DjiWaypointV2Config

表示当前航路点的速度配置。

typedef struct {
    
    uint16_t useLocalCruiseVel;

    
    uint16_t useLocalMaxVel;
} T_DjiWaypointV2Config;

typedef struct T_DjiWaypointV2

typedef struct {
    
    dji_f64_t longitude;
    dji_f64_t latitude;
    dji_f32_t relativeHeight; /*! relative to takeoff height*/

    
    E_DJIWaypointV2FlightPathMode waypointType;

    
    E_DJIWaypointV2HeadingMode headingMode;

    
    T_DjiWaypointV2Config config;

    uint16_t dampingDistance;

    
    dji_f32_t heading;

    
    E_DJIWaypointV2TurnMode turnMode;

    
    T_DjiWaypointV2RelativePosition pointOfInterest;

    
    dji_f32_t maxFlightSpeed;

    
    dji_f32_t autoFlightSpeed;
} T_DjiWaypointV2;

typedef struct T_DjiWaypointV2List

typedef struct {
    T_DjiWaypointV2 *waypointV2;
    uint16_t waypointV2Num;
} T_DjiWaypointV2List;

typedef enum E_DJIWaypointV2ActionTriggerType

可能的动作触发器类型

typedef enum {
    /**
     *  The action will be triggered when action associated executes.
     *  The parameters should be defined by ``DJIWaypointV2Action_E_DJIWaypointV2AssociateTriggerParam``.
     */
    DJI_WAYPOINT_V2_ACTION_TRIGGER_ACTION_ASSOCIATED = 2,

    /**
     *  The action will be triggered when the aircraft flies from one waypoint to the next.
     *  The parameters should be defined by ``DJIWaypointV2Action_T_DJIWaypointV2TrajectoryTriggerParam``.
     */
    DJI_WAYPOINT_V2_ACTION_TRIGGER_TYPE_TRAJECTORY,

    /**
     *  The action will be triggered when the aircraft flies between two waypoints
     *  The parameters should be defined by ``DJIWaypointV2Action_T_DJIWaypointV2IntervalTriggerParam``.
     */
    DJI_WAYPOINT_V2_ACTION_TRIGGER_TYPE_INTERVAL,

    /**
     *  The action will be trigger when the aircraft reach the waypoint point.
     *  The parameters should be setting by ``DJIWaypointV2SampleReachPointTriggerParam``.
     */
    DJI_WAYPOINT_V2_ACTION_TRIGGER_TYPE_SAMPLE_REACH_POINT,

    /**
     *  Unknown
     */
    DJI_WAYPOINT_V2_ACTION_TRIGGER_TYPE_UNKNOWN = 0xFF
} E_DJIWaypointV2ActionTriggerType;

typedef enum E_DJIWaypointV2TriggerAssociatedTimingType

DJIWaypointV2Action_E_DJIWaypointV2AssociateTriggerParam的类型,确定执行与另一个相关联的触发器的时间。

typedef enum {

    
    DJI_WAYPOINT_V2_TRIGGER_ASSOCIATED_TIMING_TYPE_SIMULTANEOUSLY = 1,

    
    DJI_WAYPOINT_V2_TRIGGER_ASSOCIATED_TIMING_TYPE_AFTER_FINISHED,

    
    DJI_WAYPOINT_V2_TRIGGER_ASSOCIATED_TIMING_TYPE_UNKNOWN = 0xFF,
} E_DJIWaypointV2TriggerAssociatedTimingType;

typedef enum E_DJIWaypointV2ActionIntervalType

DJIWaypointV2Action_DJIWaypointV2IntervalTriggerParam的类型,决定动作如何重复的区间类型。

typedef enum {
    
    DJI_WAYPOINT_V2_ACTION_INTERVAL_TYPE_TIME = 1,

    
    DJI_WAYPOINT_V2_ACTION_INTERVAL_TYPE_DISTANCE,

    
    DJI_WAYPOINT_V2_ACTION_INTERVAL_TYPE_UNKNOWN = 0xFF,
} E_DJIWaypointV2ActionIntervalType;

typedef enum E_DJIWaypointV2ActionActuatorType

可能的动作执行器类型。

typedef enum {

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_TYPE_CAMERA = 1,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_TYPE_GIMBAL = 2,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_TYPE_AIRCRAFT_CONTROL = 4,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_TYPE_UNKNOWN = 0xFF
} E_DJIWaypointV2ActionActuatorType;

typedef enum E_DJIWaypointV2ActionActuatorCameraOperationType

相机执行器操作的可能类型。

typedef enum {

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_CAMERA_OPERATION_TYPE_TAKE_PHOTO = 1,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_CAMERA_OPERATION_TYPE_START_RECORD_VIDEO,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_CAMERA_OPERATION_TYPE_STOP_RECORD_VIDEO,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_CAMERA_OPERATION_TYPE_FOCUS,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_CAMERA_OPERATION_TYPE_FOCUL_LENGTH,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_CAMERA_OPERATION_TYPE_UNKNOWN = 0xFF,
} E_DJIWaypointV2ActionActuatorCameraOperationType;

typedef enum E_DJIWaypointV2ActionActuatorGimbalOperationType

云台执行器操作的类型。

typedef enum {

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_GIMBAL_OPERATION_TYPE_ROTATE_GIMBAL = 1,

    
    DJI_WAYPOINT_V2_ACTION_ACTUATOR_GIMBAL_OPERATION_TYPE_UNKNOWN = 0xFF,
} E_DJIWaypointV2ActionActuatorGimbalOperationType;

typedef struct T_DjiWaypointV2GetRemainMemory

获取剩余内存

typedef struct {
    uint16_t totalMemory;
    uint16_t remainMemory;
} T_DjiWaypointV2GetRemainMemory;

typedef struct T_DjiWaypointV2GetWaypointStartEndIndex

获取任务的开始和停止索引

typedef struct {
    uint32_t result;
    uint16_t startIndex;
    uint16_t endIndex;
} T_DjiWaypointV2GetWaypointStartEndIndex;

typedef struct T_DJIWaypointV2SampleReachPointTriggerParam

typedef struct {
    
    uint16_t waypointIndex;

    uint16_t terminateNum;

} T_DJIWaypointV2SampleReachPointTriggerParam;

typedef struct T_DJIWaypointV2AssociateTriggerParam

这个类别定义了DJIWaypointV2MissionV2_DJIWaypointV2ActionTriggerType_ActionAssociated

typedef struct {
    
    uint8_t actionAssociatedType: 7;

    

    uint8_t waitTimeUint: 1;

    
    uint8_t waitingTime;

    
    uint16_t actionIdAssociated;
} T_DJIWaypointV2AssociateTriggerParam;

typedef struct T_DJIWaypointV2TrajectoryTriggerParam

此类表示何时应该触发的轨迹触发动作。

typedef struct {
    
    uint16_t startIndex;

    
    uint16_t endIndex;
} T_DJIWaypointV2TrajectoryTriggerParam;

typedef struct T_DJIWaypointV2IntervalTriggerParam

这个类别定义了DJIWaypointV2MissionV2_DJIWaypointV2ActionTriggerType_Trajectory

typedef struct {
    
    uint16_t startIndex;

    
    uint16_t interval;
    
    uint8_t actionIntervalType;

} T_DJIWaypointV2IntervalTriggerParam;

typedef struct T_DJIWaypointV2Trigger

typedef struct {
   
    uint8_t actionTriggerType;
    union {
        T_DJIWaypointV2SampleReachPointTriggerParam sampleReachPointTriggerParam;
        T_DJIWaypointV2AssociateTriggerParam associateTriggerParam;
        T_DJIWaypointV2TrajectoryTriggerParam trajectoryTriggerParam;
        T_DJIWaypointV2IntervalTriggerParam intervalTriggerParam;
    };
} T_DJIWaypointV2Trigger;

typedef struct T_DjiWaypointV2CGPoint

焦点参数

typedef struct {
    
    dji_f32_t x;
    
    dji_f32_t y;
} T_DjiWaypointV2CGPoint;

typedef struct T_DJIWaypointV2CameraFocusParam

这个类定义了一个相机对焦操作DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam

typedef struct {
    
    T_DjiWaypointV2CGPoint focusTarget;

    
    uint8_t regionType;

    
    dji_f32_t width;

    

    dji_f32_t height;

    uint32_t reserve;

    
    uint8_t retryTimes;
} T_DJIWaypointV2CameraFocusParam;

typedef struct T_DJIWaypointV2CameraFocalLengthParam

这个类定义了一个相机焦距操作 DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam.

typedef struct {
    
    uint16_t focalLength;

    uint8_t retryTimes;

} T_DJIWaypointV2CameraFocalLengthParam;

typedef struct T_DJIWaypointV2CameraActuatorParam

这个类定义了DJIWaypointV2Action_DJIWaypointV2Actuator的参数。 这决定了执行航点任务时相机将如何执行。

typedef struct {
    
    uint16_t operationType;

    union {
        
        T_DJIWaypointV2CameraFocusParam focusParam;

        
        T_DJIWaypointV2CameraFocalLengthParam zoomParam;
    };

} T_DJIWaypointV2CameraActuatorParam;

typedef struct T_DJIGimbalRotation

云台旋转参数

typedef struct {

    int16_t x;  
    int16_t y;  
    int16_t z;  
    uint8_t ctrl_mode: 1;   
    uint8_t rollCmdIgnore: 1;
    uint8_t pitchCmdIgnore: 1;
    uint8_t yawCmdIgnore: 1;  
    uint8_t absYawModeRef: 1; 
    uint8_t reserved: 3;
    uint8_t durationTime;  
} T_DJIGimbalRotation;   

typedef struct T_DJIWaypointV2GimbalActuatorParam

这个类定义了DJIWaypointV2Action_DJIWaypointV2Actuator的参数。 它决定了执行航路点任务时云台执行器的执行方式。

typedef struct {
    
    uint16_t operationType;

    
    T_DJIGimbalRotation rotation;
} T_DJIWaypointV2GimbalActuatorParam;   

typedef enum E_DJIWaypointV2ActionActuatorAircraftControlOperationType

飞机控制执行器操作的可能类型。

typedef enum {
    
    DJIWaypointV2ActionActuatorAircraftControlOperationTypeRotateYaw = 1,

    
    DJIWaypointV2ActionActuatorAircraftControlOperationTypeFlyingControl = 2,

    
    DJIWaypointV2ActionActuatorAircraftControlOperationTypeUnknown = 0xFF,
} E_DJIWaypointV2ActionActuatorAircraftControlOperationType;

typedef struct T_DJIWaypointV2AircraftControlRotateHeadingParam

这个类定义了飞机如何在偏航轴上旋转。

typedef struct {
    
    uint8_t isRelative: 1;

    uint8_t reserved: 7;

    
    dji_f32_t yaw;

} T_DJIWaypointV2AircraftControlRotateHeadingParam;

typedef struct T_DJIWaypointV2AircraftControlFlyingParam

此类定义飞机是否开始或停止飞行。

typedef struct {
    
    uint8_t isStartFlying: 1;
    uint8_t reserved: 7;
} T_DJIWaypointV2AircraftControlFlyingParam;

typedef struct T_DJIWaypointV2AircraftControlParam

这个类定义了DJIWaypointV2Action_DJIWaypointV2Actuator的参数。 它决定了执行航路点任务时如何执行飞机控制执行器。

typedef struct {
    
    uint16_t operationType;

    union {
        

        T_DJIWaypointV2AircraftControlRotateHeadingParam yawRotatingParam;

        

        T_DJIWaypointV2AircraftControlFlyingParam flyControlParam;
    };
} T_DJIWaypointV2AircraftControlParam;

typedef struct T_DJIWaypointV2Actuator

此类为“DJIWaypointV2Action”定义了一个执行器。 它决定了在执行航路点任务时如何执行操作。

typedef struct {
    
    uint8_t actuatorType;

    
    uint8_t actuatorIndex;

    union {
        
        T_DJIWaypointV2CameraActuatorParam cameraActuatorParam;

        
        T_DJIWaypointV2GimbalActuatorParam gimbalActuatorParam;

        
        T_DJIWaypointV2AircraftControlParam aircraftControlActuatorParam;
    };
} T_DJIWaypointV2Actuator;

typedef struct T_DJIWaypointV2Action

此类表示“DJIWaypointV2Mission”的动作。 它决定了在执行航路点任务时如何执行操作。

typedef struct {
    
    uint16_t actionId;

    
    T_DJIWaypointV2Trigger trigger;

    
    T_DJIWaypointV2Actuator actuator;
} T_DJIWaypointV2Action;

typedef struct T_WayPointV2InitSettingsInternal

Waypoint V2 任务初始化设置 内部用户无需使用

typedef struct {
    uint16_t version;
    uint8_t reserved;
    uint32_t missionID;
    uint16_t missTotalLen;
    uint16_t waypointCount;
    uint8_t repeatTimes;

    uint8_t finishedAction;
    uint16_t maxFlightSpeed;
    uint16_t autoFlightSpeed;
    uint16_t startIndex;
    uint8_t actionWhenRcLost;

    uint8_t gotoFirstWaypointMode;
    dji_f64_t refLati;
    dji_f64_t refLong;
    dji_f32_t refAlti;
} T_WayPointV2InitSettingsInternal;

typedef union T_DjiFcSubscriptionHomePointInfo

任务事件数据

typedef union {
    
    uint8_t recoverProcess;

    
    uint8_t exitReason;

    
    uint16_t waypointIndex;

    
    struct T_DjiWaypointV2MissionExecEvent {
        uint8_t currentMissionExecTimes;
        uint8_t finishedAllMissExecTimes: 1; 
        uint8_t reserved: 7;
    } T_DjiWaypointV2MissionExecEvent;

    
    uint8_t avoidState;

    
    struct T_DjiWaypointV2ActionExecEvent {
        uint16_t actionId;
        
        uint8_t preActuatorState;
        
        uint8_t curActuatorState;
        
        uint32_t result;
    } T_DjiWaypointV2ActionExecEvent;
} U_DjiWaypointV2EventData;

typedef struct T_DjiWaypointV2MissionEventPush

任务的事件推送确认数据

typedef struct {
    
    uint8_t event;
    uint32_t FCTimestamp;
    U_DjiWaypointV2EventData data;
} T_DjiWaypointV2MissionEventPush;

typedef struct T_DjiWaypointV2MissionStatePush

Mission的状态推送数据

typedef struct {
    uint16_t curWaypointIndex;
    
    uint8_t state;
    uint16_t velocity; 
} T_DjiWaypointV2MissionStatePush;

typedef struct T_DjiWaypointV2MissionStatePush

typedef struct {
    T_DJIWaypointV2Action *actions;
    uint16_t actionNum;
} T_DJIWaypointV2ActionList;

typedef struct T_DjiWayPointV2MissionSettings

Waypoint V2 任务初始化设置

typedef struct {

    
    uint32_t missionID;

    
    uint8_t repeatTimes;

    
    E_DJIWaypointV2MissionFinishedAction finishedAction;

    
    dji_f32_t maxFlightSpeed;

    
    dji_f32_t autoFlightSpeed;

    
    E_DJIWaypointV2MissionActionWhenRcLost actionWhenRcLost;

    
    E_DJIWaypointV2MissionGotoFirstWaypointMode gotoFirstWaypointMode;

    T_DjiWaypointV2 *mission;
    
    uint16_t missTotalLen;

    T_DJIWaypointV2ActionList actionList;
} T_DjiWayPointV2MissionSettings;
若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。