dji_mission_manager.hpp
Go to the documentation of this file.
1 
31 #ifndef ONBOARDSDK_DJI_MISSIONMANAGER_H
32 #define ONBOARDSDK_DJI_MISSIONMANAGER_H
33 
34 #include "dji_hotpoint.hpp"
35 #include "dji_waypoint.hpp"
36 #include <vector>
37 
38 namespace DJI
39 {
40 namespace OSDK
41 {
42 
43 enum DJI_MISSION_TYPE
44 {
45  WAYPOINT = 0,
46  HOTPOINT = 1,
47 };
48 
49 enum MISSION_ACTION
50 {
51  START = 0,
52  STOP = 1,
53  PAUSE = 2,
54  RESUME = 3,
55 };
56 
57 class WaypointMission;
58 class HotpointMission;
63 {
64 public:
65  MissionManager(Vehicle* vehiclePtr = 0);
66  ~MissionManager();
67 
77  ACK::ErrorCode init(DJI_MISSION_TYPE type, int timeout,
78  UserData missionData = 0);
88  void init(DJI_MISSION_TYPE type, VehicleCallBack callback = 0,
89  UserData missionData = 0);
97  static void missionCallback(Vehicle* vehiclePtr, RecvContainer recvFrame,
98  UserData userData);
99 
100 private:
109  ACK::ErrorCode initWayptMission(int timeout = 10, UserData wayptData = 0);
118  void initWayptMission(VehicleCallBack callback = 0, UserData wayptData = 0);
119 
120 
129  ACK::ErrorCode initHotptMission(int timeout = 10, UserData wayptData = 0);
138  void initHotptMission(VehicleCallBack callback = 0, UserData wayptData = 0);
139 
140 public:
148  WaypointMission* getWaypt(int index);
156  HotpointMission* getHotpt(int index);
163  void printInfo();
164 
165 
166  Vehicle* vehicle;
167  WaypointMission* wpMission;
168  HotpointMission* hpMission;
169 
170  std::vector<WaypointMission*> wpMissionVector;
171  std::vector<HotpointMission*> hpMissionVector;
172 };
173 
174 } // OSDK
175 } // DJI
176 
177 #endif // ONBOARDSDK_DJI_MISSIONMANAGER_H
void * UserData
This is used as the datatype for all data arguments in callbacks.
Definition: dji_type.hpp:75
ACK::ErrorCode init(DJI_MISSION_TYPE type, int timeout, UserData missionData=0)
init missions, could be hotpt or waypt, blocking calls
Definition: dji_mission_manager.cpp:54
HotpointMission * getHotpt(int index)
get hotpt ptr from hotpt container
Definition: dji_mission_manager.cpp:155
This struct is returned from all blocking calls, except certain mission calls that have explicit type...
Definition: dji_ack.hpp:146
void(* VehicleCallBack)(Vehicle *vehicle, RecvContainer recvFrame, UserData userData)
Function prototype for all callback functions used in the OSDK.
Definition: dji_vehicle_callback.hpp:76
WaypointMission * getWaypt(int index)
get waypt ptr from waypt container
Definition: dji_mission_manager.cpp:146
Implementation of HotPoint (Point of Interest) Missions for DJI OSDK.
Implementation of GPS Waypoint Missions for DJI OSDK.
MissionManager class for chaining/managing missions.
Definition: dji_mission_manager.hpp:62
APIs for Hotpoint (Point of Interest) Missions.
Definition: dji_hotpoint.hpp:45
Received info.
Definition: dji_vehicle_callback.hpp:59
void printInfo()
Definition: dji_mission_manager.cpp:164
Definition: dji_ack.cpp:38
APIs for GPS Waypoint Missions.
Definition: dji_waypoint.hpp:44
static void missionCallback(Vehicle *vehiclePtr, RecvContainer recvFrame, UserData userData)
a callback function for waypoint non-blocking calls
Definition: dji_mission_manager.cpp:127