dji_mission_type.hpp
Go to the documentation of this file.
1 
30 #ifndef ONBOARDSDK_DJI_MISSION_TYPE_H
31 #define ONBOARDSDK_DJI_MISSION_TYPE_H
32 #include <vector>
33 #include "dji_type.hpp"
34 
35 namespace DJI
36 {
37 
38 namespace OSDK
39 {
40  const float32_t EARTH_RADIUS = 6378137.0;
41 
42 // clang-format off
43 /**********Mission structs/Enums***********/
44 
45 #pragma pack(1)
46 
52 typedef struct HotPointSettings
53 {
54  uint8_t version;
55  float64_t latitude;
56  float64_t longitude;
57  float64_t height;
58  float64_t radius;
59  float32_t yawRate;
60  uint8_t clockwise;
61  uint8_t startPoint;
67  uint8_t yawMode;
73  uint8_t reserved[11];
74 } HotPointSettings; // pack(1)
75 
81 typedef struct WayPointInitSettings
82 {
83  uint8_t indexNumber;
84  float32_t maxVelocity;
85  float32_t idleVelocity;
87  uint8_t finishAction;
93  uint8_t executiveTimes;
96  uint8_t yawMode;
101  uint8_t traceMode;
108  uint8_t RCLostAction;
111  uint8_t gimbalPitch;
114  float64_t latitude;
115  float64_t longitude;
116  float32_t altitude;
117  uint8_t reserved[16];
119 } WayPointInitSettings; // pack(1)
120 
126 typedef struct WayPointSettings
127 {
128  uint8_t index;
129  float64_t latitude;
130  float64_t longitude;
131  float32_t altitude;
132  float32_t damping;
133  int16_t yaw;
134  int16_t gimbalPitch;
135  uint8_t turnMode;
138  uint8_t reserved[8];
139  uint8_t hasAction;
142  uint16_t actionTimeLimit;
143  uint8_t actionNumber : 4;
144  uint8_t actionRepeat : 4;
145  uint8_t commandList[16];
146  int16_t commandParameter[16];
147 } WayPointSettings; // pack(1)
148 
150 {
158 
162 typedef enum WayPointIncidentType
164 {
165  NAVI_UPLOAD_FINISH,
166  NAVI_MISSION_FINISH,
167  NAVI_MISSION_WP_REACH_POINT
169 
174 {
175  NAVI_MODE_ATTI,
176  NAVI_MISSION_WAYPOINT,
177  NAVI_MISSION_HOTPOINT,
178  NAVI_MISSION_FOLLOWME,
179  NAVI_MISSION_IOC,
181 
185 typedef struct WayPointFinishData
186 {
187  uint8_t incident_type;
188  uint8_t repeat;
189  uint16_t reserved_1;
190  uint16_t reserved_2;
191 } WayPointFinishData; // pack(1)
192 
193 
194 /**********Mission waypoint V2 structs/Enums***********/
195 
200 
201 
206 
211 };
212 
213 
218 
224 
230 
235 
240 
248 };
249 
250 
255 
263 
268 };
269 
270 
276 
281 
286 
291 };
292 
293 
303 
308 
309 
310 
315 };
316 
326 
332 
338 
344 
349 };
350 
351 
356 
362 
368 
374 
379 };
380 
381 
386 
392 
397  // DJIWaypointV2ActionActuatorGimbalOperationTypeAircraftControlGimbal,
398 
403 };
404 
405 
410 
415 
420 
425 
430 
435 
439  // DJIWaypointV2ActionActuatorCameraOperationTypeUnknown = 0xFF,
440 };
441 
442 
447 
452 
457 
462 };
463 
464 
469 
474 
479 
484 
489 
494 
501 
508 
515 
520 };
521 
522 
531 
536 
541 };
542 
546 typedef enum DJIWaypointV2FlightPathMode:uint8_t {
547 
552 
557 
562 
569 
575 
580 
586 
590 typedef enum DJIWaypointV2HeadingMode:uint8_t {
591 
596 
604 
609 
615 
622 
627 
633 
637 typedef enum DJIWaypointV2TurnMode:uint8_t {
638 
643 
648 
654 
655 
665 
671 
676 
681 
686 
691 
696 
701 };
702 
703 typedef uint8_t RetCodeType;
704 
705 typedef uint32_t WaypointV2CommonAck;
706 
711 typedef float32_t GlobalCruiseSpeed;
712 
715 typedef struct UploadMissionRawAck
716 {
718  uint32_t result;
719 
721  uint16_t startIndex;
722 
724  uint16_t endIndex;
726 
729 typedef struct UploadActionsRawAck
730 {
732  uint32_t result;
733 
735  uint16_t errorActionId;
737 
740 typedef struct DownloadMissionRsp
741 {
742  uint16_t startIndex;
743  uint16_t endIndex;
745 
748 typedef struct DownloadMissionAck
749 {
751  uint32_t result;
752 
754  uint16_t startIndex;
755 
757  uint16_t endIndex;
759 
762 typedef struct GetGlobalCruiseVelAck{
763 
765  uint32_t result;
766 
768  uint16_t globalCruiseVel;
770 
773 typedef struct GetRemainRamAck
774 {
775  uint16_t totalMemory;
776  uint16_t remainMemory;
778 
782 {
783  uint32_t result;
784  uint16_t startIndex;
785  uint16_t endIndex;
787 
791 {
792  uint16_t curWaypointIndex;
793  uint8_t reserved1:4;
794  uint8_t state:4; //0x0:ground station not start. 0x1:mission prepared. 0x2:enter mission.
795  //0x3:execute flying route mission.
796  //0x4:pause state. 0x5:enter mission after ending pause.
797  //0x6:exit mission.
798  uint16_t velocity; //uint:0.01m/s
799  uint8_t reserved2;
801 
804 typedef struct MissionStatePushAck
805 {
806  uint8_t commonDataVersion = 1;
807  uint16_t commonDataLen;
810 
813 typedef union Eventdata
814 {
815  /*ID:0x01*/
816  uint8_t interruptReason; //0x00:rc triggered interrupt
817 
818  /*ID:0x02*/
819  uint8_t recoverProcess; //0x00:finished pause recover
820 
821  /*ID:0x03*/
822  uint8_t finishReason; //0x00:finished normally; 0x10:External user trigger ended successfully
823 
824  /*ID:0x10*/
825  uint16_t waypointIndex;
826 
827  /*ID:0x11*/
828  struct MissionExecEvent{
829  uint8_t currentMissionExecNum;
830  uint8_t finishedAllExecNum:1; //0:not finished; 1:finished all exec num
831  uint8_t reserved:7;
832  }MissionExecEvent;
833 
834  // /*ID:0x12*/
835  // uint8_t avoidState;
836 
837  /*ID:0x20*/
838  // struct MissionValidityEvent {
839  // uint8_t misValidityFlag;
840  // float32_t estimateRunTime;
841  // }MissionValidityEvent;
842 
843  /*ID:0x30*/
844  // struct ActionExecEvent{
845  // uint16_t actionId;
846  // uint8_t preActuatorState;
847  // uint8_t curActuatorState;
848  // uint32_t result;
849  // }ActionExecEvent;
850 }Eventdata;
851 
854 typedef struct MissionEventPushAck
855 {
856  uint8_t event ;
857  uint32_t FCTimestamp;
858  Eventdata data;
860 
866 
867  uint16_t version = 0x6500;
868 
869  uint8_t reserved = 0;
870 
871  uint32_t missionID;
872 
873  uint16_t missTotalLen;
874 
875  uint16_t waypointCount = 2;
876 
877  uint8_t repeatTimes;
878 
879  DJIWaypointV2MissionFinishedAction finishedAction;
880 
881  uint16_t maxFlightSpeed;
882 
883  uint16_t autoFlightSpeed;
884 
885  uint16_t startIndex;
886 
887  uint8_t exitMissionOnRCSignalLost;
888 
889  DJIWaypointV2MissionGotoFirstWaypointMode gotoFirstWaypointMode;
890 
891  float64_t refLati;
892 
893  float64_t refLong;
894 
895  float32_t refAlti;
896 
898 
899 typedef struct DownloadInitSettingRawAck
900 {
902  uint32_t result;
903  WayPointV2InitSettingsInternal initSettingsInternal;
904 
905 }DownloadInitSettingRawAck;
906 
910 typedef struct RelativePosition{
911  float32_t positionX;
912  float32_t positionY;
913  float32_t positionZ;
915 
919 typedef struct WaypointV2Config
920  {
923  uint16_t useLocalCruiseVel:1;
924 
927  uint16_t useLocalMaxVel:1;
928 
929  uint16_t reserved :14;
930 
932 
937 typedef struct WaypointV2Internal
938 {
942  float32_t positionX;
943  float32_t positionY;
944  float32_t positionZ;
950 
955 
960 
961  uint16_t dampingDistance;
962 
970  float32_t heading;
971 
977 
985 
990  uint16_t maxFlightSpeed;
991 
996  uint16_t autoFlightSpeed;
998 
1003 typedef struct WaypointV2
1004 {
1008  float64_t longitude;
1009  float64_t latitude;
1010  float32_t relativeHeight;
1016 
1021 
1026 
1027  uint16_t dampingDistance;
1028 
1036  float32_t heading;
1037 
1043 
1051 
1065  float32_t maxFlightSpeed;
1066 
1080  float32_t autoFlightSpeed;
1081 }WaypointV2;
1082 
1088 typedef struct WayPointV2InitSettings{
1089 
1093  uint32_t missionID;
1094 
1098  uint16_t missTotalLen;
1099 
1105  uint8_t repeatTimes;
1106 
1111 
1126  float32_t maxFlightSpeed;
1127 
1140  float32_t autoFlightSpeed;
1141 
1147 
1153 
1154  std::vector<WaypointV2> mission;
1155 
1157 
1158 typedef struct FCGroundStationDataPush
1159 {
1160  // If (use_rtk_flag && in_rtk_mode)=1 , longitude is rtk lon, otherwise it's (gps_lon - gps2rtk_lon_offset).
1161  // (The use_rtk_flag and in_rtk_mode are the members in the later section. )
1162  // Unit: rad
1163  double longitude;
1164  // If (use_rtk_flag && in_rtk_mode)=1 , latitude is rtk lat, otherwise it's (gps_lat - gps2rtk_lat_offset).
1165  // Unit: rad
1166  double latitude;
1167  // If (use_rtk_flag && in_rtk_mode && set_rtk_takeoff_alti_flag)=1 , relative_height is rtk_type, otherwise it's press_type.
1168  // Unit: m
1169  float relative_height;
1170  // Unit: 0.1 degree
1171  int16_t heading;
1172  // use rtk or not 0: rtk switch is off or rtk device is not connect, 1: us rtk position。
1173  uint8_t use_rtk_flag;
1174  // 0: rtk not healthy, 1: rtk 3d healthy
1175  uint8_t in_rtk_mode;
1176  // utc time's seconds
1177  uint32_t sec;
1178  // utc time's nano seconds
1179  uint32_t nano_sec;
1180  // home type。0=NA,1=gps_type,2=rtk_type
1181  uint8_t home_type :2;
1182  // use rtk height:0=no,1=yes
1183  uint8_t set_rtk_takeoff_alti_flag:1;
1184  // distance to home type。0=NA,1=gps_type,2=rtk_type
1185  uint8_t d2h_type :2;
1186  // reserve
1187  uint8_t resv :3;
1188  // RTK or GPS's svn
1189  uint8_t rtk_or_gps_svn;
1190  // Unit: rad
1191  double home_lon;
1192  // Unit: rad
1193  double home_lat;
1194  // take off altitude。
1195  // Unit: m
1196  float takeoff_alti;
1197  // aircraft's distance to home.
1198  // Unit: m
1199  float d2h;
1200  float abs_height;
1201  float gps_height;
1202 } FCGroundStationDataPush;
1203 #pragma pack()
1204 
1205 
1206 // clang-format on
1207 } // OSDK
1208 
1209 } // DJI
1210 
1211 #endif // ONBOARDSDK_DJI_MISSION_TYPE_H
DJIWaypointV2ActionActuatorType
Definition: dji_mission_type.hpp:355
HotPoint Mission Initialization settings.
Definition: dji_mission_type.hpp:52
Definition: dji_mission_type.hpp:910
Definition: dji_mission_type.hpp:500
DJIWaypointV2ActionExecutionEvent
Definition: dji_mission_type.hpp:526
uint16_t autoFlightSpeed
Definition: dji_mission_type.hpp:996
Definition: dji_mission_type.hpp:937
uint16_t useLocalCruiseVel
Definition: dji_mission_type.hpp:923
WayPointIncidentType
WayPoint Reached Data Incident Type enumerator.
Definition: dji_mission_type.hpp:163
Definition: dji_mission_type.hpp:595
RelativePosition pointOfInterest
Definition: dji_mission_type.hpp:984
Definition: dji_mission_type.hpp:331
uint8_t startPoint
Definition: dji_mission_type.hpp:61
Definition: dji_mission_type.hpp:361
struct DJI::OSDK::WaypointV2 WaypointV2
Definition: dji_mission_type.hpp:652
Definition: dji_mission_type.hpp:631
uint8_t RCLostAction
Definition: dji_mission_type.hpp:108
DJIWaypointV2TurnMode
Definition: dji_mission_type.hpp:637
float64_t latitude
Definition: dji_mission_type.hpp:129
struct DJI::OSDK::MissionStatePushAck MissionStatePushAck
float32_t autoFlightSpeed
Definition: dji_mission_type.hpp:1140
Definition: dji_mission_type.hpp:675
Definition: dji_mission_type.hpp:695
Definition: dji_mission_type.hpp:579
uint16_t maxFlightSpeed
Definition: dji_mission_type.hpp:990
DJIWaypointV2ActionActuatorCameraOperationType
Definition: dji_mission_type.hpp:409
uint16_t endIndex
Definition: dji_mission_type.hpp:724
Definition: dji_mission_type.hpp:378
float64_t longitude
Definition: dji_mission_type.hpp:130
Definition: dji_mission_type.hpp:608
struct DJI::OSDK::HotPointSettings HotPointSettings
HotPoint Mission Initialization settings.
DJIWaypointV2TriggerAssociatedTimingType
Definition: dji_mission_type.hpp:275
uint16_t globalCruiseVel
Definition: dji_mission_type.hpp:768
uint8_t finishAction
Definition: dji_mission_type.hpp:87
Definition: dji_mission_type.hpp:223
DJIWaypointV2MissionFinishedAction
Definition: dji_mission_type.hpp:217
float32_t yawRate
Definition: dji_mission_type.hpp:59
Definition: dji_mission_type.hpp:790
Waypoint V2 Mission Initialization settings.
Definition: dji_mission_type.hpp:1088
float64_t latitude
Definition: dji_mission_type.hpp:114
struct DJI::OSDK::DownloadMissionAck DownloadMissionAck
Definition: dji_mission_type.hpp:584
Definition: dji_mission_type.hpp:680
float32_t autoFlightSpeed
Definition: dji_mission_type.hpp:1080
Definition: dji_mission_type.hpp:1003
DJIWaypointV2MissionV2RCLostAction
Definition: dji_mission_type.hpp:199
uint8_t repeatTimes
Definition: dji_mission_type.hpp:1105
Definition: dji_mission_type.hpp:781
uint16_t startIndex
Definition: dji_mission_type.hpp:721
struct DJI::OSDK::WayPointV2InitSettings WayPointV2InitSettings
Waypoint V2 Mission Initialization settings.
Definition: dji_mission_type.hpp:642
WaypointV2Config config
Definition: dji_mission_type.hpp:1025
DJIWaypointV2FlightPathMode
Definition: dji_mission_type.hpp:546
Definition: dji_mission_type.hpp:919
Definition: dji_mission_type.hpp:621
Definition: dji_mission_type.hpp:493
uint8_t clockwise
Definition: dji_mission_type.hpp:60
uint8_t gimbalPitch
Definition: dji_mission_type.hpp:111
struct DJI::OSDK::MissionEventPushAck MissionEventPushAck
uint8_t repeat
Definition: dji_mission_type.hpp:188
float32_t heading
Definition: dji_mission_type.hpp:970
DJIWaypointV2HeadingMode
Definition: dji_mission_type.hpp:590
uint8_t turnMode
Definition: dji_mission_type.hpp:135
float64_t longitude
Definition: dji_mission_type.hpp:56
RelativePosition pointOfInterest
Definition: dji_mission_type.hpp:1050
DJIWaypointV2HeadingMode headingMode
Definition: dji_mission_type.hpp:1020
uint16_t errorActionId
Definition: dji_mission_type.hpp:735
Definition: dji_mission_type.hpp:729
float32_t altitude
Definition: dji_mission_type.hpp:116
uint8_t reserved[11]
Definition: dji_mission_type.hpp:73
Definition: dji_mission_type.hpp:314
struct DJI::OSDK::MissionStateCommanData MissionStateCommanData
struct DJI::OSDK::UploadMissionRawAck UploadMissionRawAck
float32_t maxVelocity
Definition: dji_mission_type.hpp:84
uint8_t executiveTimes
Definition: dji_mission_type.hpp:93
Definition: dji_mission_type.hpp:740
DJIWaypointV2ActionActuatorGimbalOperationType
Definition: dji_mission_type.hpp:385
Waypoint Mission Initialization settings.
Definition: dji_mission_type.hpp:81
float32_t altitude
Definition: dji_mission_type.hpp:131
Definition: dji_mission_type.hpp:614
Definition: dji_mission_type.hpp:568
float32_t maxFlightSpeed
Definition: dji_mission_type.hpp:1126
Definition: dji_mission_type.hpp:156
uint16_t useLocalMaxVel
Definition: dji_mission_type.hpp:927
struct DJI::OSDK::WayPointInitSettings WayPointInitSettings
Waypoint Mission Initialization settings.
DJIWaypointV2FlightPathMode waypointType
Definition: dji_mission_type.hpp:1015
DJIWaypointV2MissionGotoFirstWaypointMode
Definition: dji_mission_type.hpp:254
struct DJI::OSDK::WaypointV2Internal WaypointV2Internal
uint8_t actionRepeat
Definition: dji_mission_type.hpp:144
float64_t radius
Definition: dji_mission_type.hpp:58
DJIWaypointV2ActionTriggerType
Definition: dji_mission_type.hpp:320
uint16_t endIndex
Definition: dji_mission_type.hpp:757
DJIWaypointV2ActionIntervalType
Definition: dji_mission_type.hpp:298
uint8_t version
Definition: dji_mission_type.hpp:54
Definition: dji_mission_type.hpp:540
Waypoint Mission Finish Event Push Data.
Definition: dji_mission_type.hpp:185
Definition: dji_mission_type.hpp:154
uint8_t commandList[16]
Definition: dji_mission_type.hpp:145
float32_t positionY
Definition: dji_mission_type.hpp:943
int16_t gimbalPitch
Definition: dji_mission_type.hpp:134
float64_t latitude
Definition: dji_mission_type.hpp:55
Definition: dji_mission_type.hpp:603
uint8_t reserved[16]
Definition: dji_mission_type.hpp:117
float32_t heading
Definition: dji_mission_type.hpp:1036
uint8_t traceMode
Definition: dji_mission_type.hpp:101
uint8_t reserved[8]
Definition: dji_mission_type.hpp:138
struct DJI::OSDK::WayPointV2InitSettingsInternal WayPointV2InitSettingsInternal
Waypoint V2 Mission Initialization Settings Internal User have no need to use it.
uint32_t result
Definition: dji_mission_type.hpp:751
Definition: dji_mission_type.hpp:348
Definition: dji_mission_type.hpp:715
Definition: dji_mission_type.hpp:647
uint32_t result
Definition: dji_mission_type.hpp:732
Definition: dji_mission_type.hpp:152
Definition: dji_mission_type.hpp:155
Waypoint settings for individual waypoints being added to the mission.
Definition: dji_mission_type.hpp:126
Definition: dji_mission_type.hpp:234
uint16_t missTotalLen
Definition: dji_mission_type.hpp:1098
uint32_t result
Definition: dji_mission_type.hpp:718
DJIWaypointV2MissionState
Definition: dji_mission_type.hpp:659
struct DJI::OSDK::WaypointV2Config WaypointV2Config
float32_t positionY
Definition: dji_mission_type.hpp:912
struct DJI::OSDK::RelativePosition RelativePosition
Definition: dji_mission_type.hpp:804
struct DJI::OSDK::UploadActionsRawAck UploadActionsRawAck
Definition: dji_mission_type.hpp:773
float32_t idleVelocity
Definition: dji_mission_type.hpp:85
float64_t longitude
Definition: dji_mission_type.hpp:115
uint8_t yawMode
Definition: dji_mission_type.hpp:96
Definition: dji_mission_type.hpp:670
Definition: dji_mission_type.hpp:483
float32_t positionZ
Definition: dji_mission_type.hpp:913
float32_t damping
Definition: dji_mission_type.hpp:132
Definition: dji_mission_type.hpp:337
uint8_t index
Definition: dji_mission_type.hpp:128
struct DJI::OSDK::GetGlobalCruiseVelAck GetGlobalCruiseVelAck
Definition: dji_mission_type.hpp:854
Data type and Data Structure definitions for use throughout DJI OSDK.
Definition: dji_mission_type.hpp:153
Definition: dji_mission_type.hpp:229
DJIWaypointV2FlightPathMode waypointType
Definition: dji_mission_type.hpp:949
int16_t commandParameter[16]
Definition: dji_mission_type.hpp:146
union DJI::OSDK::Eventdata Eventdata
float64_t height
Definition: dji_mission_type.hpp:57
struct DJI::OSDK::GetWaypontStartEndIndexAck GetWaypontStartEndIndexAck
uint8_t indexNumber
Definition: dji_mission_type.hpp:83
uint32_t missionID
Definition: dji_mission_type.hpp:1093
Definition: dji_mission_type.hpp:210
WaypointV2Config config
Definition: dji_mission_type.hpp:959
struct DJI::OSDK::WayPointFinishData WayPointFinishData
Waypoint Mission Finish Event Push Data.
Definition: dji_mission_type.hpp:307
struct DJI::OSDK::DownloadMissionRsp DownloadMissionRsp
Definition: dji_mission_type.hpp:748
float32_t positionX
Definition: dji_mission_type.hpp:942
DJIWaypointV2MissionExecutionState
Definition: dji_mission_type.hpp:468
Definition: dji_ack.cpp:38
struct DJI::OSDK::WayPointSettings WayPointSettings
Waypoint settings for individual waypoints being added to the mission.
struct DJI::OSDK::GetRemainRamAck getRemainRamAck
uint16_t startIndex
Definition: dji_mission_type.hpp:754
WaypointActionTypeFormat
Definition: dji_mission_type.hpp:149
DJIWaypointV2MissionFinishedAction finishedAction
Definition: dji_mission_type.hpp:1110
DJIWaypointV2HeadingMode headingMode
Definition: dji_mission_type.hpp:954
DJIWaypointV2TurnMode turnMode
Definition: dji_mission_type.hpp:1042
Definition: dji_mission_type.hpp:813
WayPointPushDataIncidentType
WayPoint Push Data Incident Type enumerator.
Definition: dji_mission_type.hpp:173
int16_t yaw
Definition: dji_mission_type.hpp:133
Definition: dji_mission_type.hpp:519
uint8_t hasAction
Definition: dji_mission_type.hpp:139
uint8_t actionNumber
Definition: dji_mission_type.hpp:143
float32_t GlobalCruiseSpeed
Definition: dji_mission_type.hpp:711
uint8_t yawMode
Definition: dji_mission_type.hpp:67
DJIWaypointV2MissionGotoFirstWaypointMode gotoFirstWaypointMode
Definition: dji_mission_type.hpp:1152
Definition: dji_mission_type.hpp:685
Definition: dji_mission_type.hpp:626
float64_t longitude
Definition: dji_mission_type.hpp:1008
DJIWaypointV2TurnMode turnMode
Definition: dji_mission_type.hpp:976
Definition: dji_mission_type.hpp:302
Definition: dji_mission_type.hpp:151
uint32_t result
Definition: dji_mission_type.hpp:765
Definition: dji_mission_type.hpp:762
float32_t maxFlightSpeed
Definition: dji_mission_type.hpp:1065
uint8_t exitMissionOnRCSignalLost
Definition: dji_mission_type.hpp:1146
float32_t positionZ
Definition: dji_mission_type.hpp:944
Definition: dji_mission_type.hpp:367
DJIWaypointV2ActionActuatorAircraftControlOperationType
Definition: dji_mission_type.hpp:446
Definition: dji_mission_type.hpp:507
Waypoint V2 Mission Initialization Settings Internal User have no need to use it.
Definition: dji_mission_type.hpp:865
Definition: dji_mission_type.hpp:700
uint16_t actionTimeLimit
Definition: dji_mission_type.hpp:142