dji_waypoint_v2.hpp
Go to the documentation of this file.
1 
29 #ifndef DJI_WAYPOINT_MISSION_V2_HPP
30 #define DJI_WAYPOINT_MISSION_V2_HPP
31 
32 #include <vector>
33 #include "osdk_command.h"
34 #include "dji_mission_base.hpp"
36 
37 namespace DJI
38 {
39 namespace OSDK
40 {
45  typedef E_OsdkStat (*PushCallback)(struct _CommandHandle *cmdHandle,
46  const T_CmdInfo *cmdInfo,
47  const uint8_t *cmdData, void *userData);
48 
53  {
54  public:
55  const uint16_t MAX_WAYPOINT_NUM_SIGNAL_PUSH = 260;
56 
57  WaypointV2MissionOperator(Vehicle* vehiclePtr);
58 
60 
69 
78 
85  ErrorCode::ErrorCodeType start(int timeout);
86 
93  ErrorCode::ErrorCodeType stop(int timeout);
94 
101  ErrorCode::ErrorCodeType pause(int timeout);
102 
109  ErrorCode::ErrorCodeType resume(int timeout);
110 
120 
129  ErrorCode::ErrorCodeType downloadMission(std::vector<WaypointV2> &mission, int timeout);
130 
140 
150  ErrorCode::ErrorCodeType setGlobalCruiseSpeed(const GlobalCruiseSpeed &cruiseSpeed, int timeout);
151 
160  ErrorCode::ErrorCodeType uploadAction(std::vector<DJIWaypointV2Action> &actions, int timeout);
161 
171 
181 
187  inline DJIWaypointV2MissionState getCurrentState() { return currentState; }
188 
194  inline DJIWaypointV2MissionState getPrevState() { return prevState; }
195 
200  void setPrevState(DJIWaypointV2MissionState state) {prevState = state; }
201 
206  void setCurrentState(DJIWaypointV2MissionState state) {currentState = state; }
207 
213  float32_t getTakeoffAltitude(){return takeoffAltitude;};
214 
219  void setTakeoffAltitude(float32_t altitude){ takeoffAltitude = altitude;};
220 
226  void RegisterMissionEventCallback(void *userData, PushCallback cb = NULL);
227 
233  void RegisterMissionStateCallback(void *userData, PushCallback cb = NULL) ;
234 
235  private:
236  std::vector<WaypointV2> missionV2;
237  DJIWaypointV2MissionState currentState;
238  DJIWaypointV2MissionState prevState;
239  Vehicle *vehiclePtr;
240 
241  float32_t takeoffAltitude;
242 
243  void RegisterOSDInfoCallback(Vehicle *vehiclePtr);
244 
245  };
246 
247 } // namespace OSDK
248 } // namespace DJI
249 
250 #endif // DJI_WAYPOINT_MISSION_V2_HPP
ErrorCode::ErrorCodeType getWaypointIndexInList(GetWaypontStartEndIndexAck &startEndIndexAck, int timeout)
Get mission's waypoint start index and end index.
Definition: dji_waypoint_v2.cpp:745
ErrorCode::ErrorCodeType pause(int timeout)
Pause waypoint v2 mission.
Definition: dji_waypoint_v2.cpp:866
Definition: dji_waypoint_v2.hpp:52
ErrorCode::ErrorCodeType getActionRemainMemory(GetRemainRamAck &remainRamAck, int timeout)
Get action's remain memory.
Definition: dji_waypoint_v2.cpp:725
int64_t ErrorCodeType
Unified error type.
Definition: dji_error.hpp:144
void setPrevState(DJIWaypointV2MissionState state)
Set previous status of the mission executing process.
Definition: dji_waypoint_v2.hpp:200
Implementation of Waypoint V2 action.
ErrorCode::ErrorCodeType downloadInitSetting(WayPointV2InitSettingsInternal &info, int timeout)
Download the waypoint v2 init settings.
Definition: dji_waypoint_v2.cpp:542
Waypoint V2 Mission Initialization settings.
Definition: dji_mission_type.hpp:1088
Definition: dji_mission_type.hpp:781
float32_t getTakeoffAltitude()
Get the take-off altitude of waypoint V2 mission.
Definition: dji_waypoint_v2.hpp:213
void RegisterMissionEventCallback(void *userData, PushCallback cb=NULL)
Subscribe to waypointV2 event with a callback function.
Definition: dji_waypoint_v2.cpp:418
ErrorCode::ErrorCodeType getGlobalCruiseSpeed(GlobalCruiseSpeed &cruiseSpeed, int timeout)
Get the global cruise speed setting from flight controller.
Definition: dji_waypoint_v2.cpp:776
ErrorCode::ErrorCodeType downloadMission(std::vector< WaypointV2 > &mission, int timeout)
Download all the waypoint v2 mission.
Definition: dji_waypoint_v2.cpp:607
ErrorCode::ErrorCodeType uploadMission(int timeout)
Upload all the waypoint v2 mission.
Definition: dji_waypoint_v2.cpp:567
ErrorCode::ErrorCodeType uploadAction(std::vector< DJIWaypointV2Action > &actions, int timeout)
Upload all actions to flight controller.
Definition: dji_waypoint_v2.cpp:686
void setTakeoffAltitude(float32_t altitude)
set the take-off altitude of waypoint V2 mission
Definition: dji_waypoint_v2.hpp:219
ErrorCode::ErrorCodeType init(WayPointV2InitSettings *info, int timeout)
Init waypoint v2 mission settings.
Definition: dji_waypoint_v2.cpp:486
ErrorCode::ErrorCodeType stop(int timeout)
Stop execute waypoint v2 mission.
Definition: dji_waypoint_v2.cpp:845
void setCurrentState(DJIWaypointV2MissionState state)
Set current state of the waypoint V2 mission.
Definition: dji_waypoint_v2.hpp:206
ErrorCode::ErrorCodeType setGlobalCruiseSpeed(const GlobalCruiseSpeed &cruiseSpeed, int timeout)
Set the global cruise speed to flight controller.
Definition: dji_waypoint_v2.cpp:799
DJIWaypointV2MissionState getCurrentState()
Get current status of the mission executing process.
Definition: dji_waypoint_v2.hpp:187
DJIWaypointV2MissionState
Definition: dji_mission_type.hpp:659
Definition: dji_mission_type.hpp:773
ErrorCode::ErrorCodeType start(int timeout)
Start execute waypoint v2 mission.
Definition: dji_waypoint_v2.cpp:822
ErrorCode::ErrorCodeType resume(int timeout)
Resume waypoint v2 mission.
Definition: dji_waypoint_v2.cpp:888
Definition: dji_ack.cpp:38
DJIWaypointV2MissionState getPrevState()
Get previous status of the mission executing process.
Definition: dji_waypoint_v2.hpp:194
float32_t GlobalCruiseSpeed
Definition: dji_mission_type.hpp:711
Mission-Base abstract class for DJI OSDK library.
void RegisterMissionStateCallback(void *userData, PushCallback cb=NULL)
Subscribe to waypointV2 mission state with a callback function.
Definition: dji_waypoint_v2.cpp:437
E_OsdkStat(* PushCallback)(struct _CommandHandle *cmdHandle, const T_CmdInfo *cmdInfo, const uint8_t *cmdData, void *userData)
callback type to get the pushing data from waypoint 2.0
Definition: dji_waypoint_v2.hpp:45
Waypoint V2 Mission Initialization Settings Internal User have no need to use it.
Definition: dji_mission_type.hpp:865