dji_hotpoint.hpp
Go to the documentation of this file.
1 
29 #ifndef DJI_HOTPOINT_H
30 #define DJI_HOTPOINT_H
31 
32 #include "dji_mission_base.hpp"
33 #include "dji_telemetry.hpp"
34 
35 namespace DJI
36 {
37 namespace OSDK
38 {
39 
46 {
47 public:
48 #pragma pack(1)
49  typedef struct YawRate
50  {
51  uint8_t clockwise;
52  float32_t yawRate;
53  } YawRate;
54 #pragma pack()
55 
56  enum View
57  {
58  VIEW_NORTH = 0,
59  VIEW_SOUTH = 1,
60  VIEW_WEST = 2,
61  VIEW_EAST = 3,
62  VIEW_NEARBY = 4
63  };
64 
65  enum YawMode
66  {
67  YAW_AUTO = 0,
68  YAW_INSIDE = 1,
69  YAW_OUTSIDE = 2,
70  YAW_CUSTOM = 3,
71  YAW_STATIC = 4,
72  };
73 
80 public:
81  HotpointMission(Vehicle* vehicle = 0);
82  ~HotpointMission();
83 
84  VehicleCallBackHandler hotPointCallback;
85 
92  void initData();
99  HotPointSettings getData() const;
108  void start(VehicleCallBack callback = 0, UserData userData = 0);
116  ACK::ErrorCode start(int timer);
125  void stop(VehicleCallBack callback = 0, UserData userData = 0);
133  ACK::ErrorCode stop(int timer);
142  void pause(VehicleCallBack callback = 0, UserData userData = 0);
150  ACK::ErrorCode pause(int timer);
159  void resume(VehicleCallBack callback = 0, UserData userData = 0);
167  ACK::ErrorCode resume(int timer);
177  void updateYawRate(YawRate& Data);
187  void updateYawRate(float32_t yawRate, bool isClockwise);
195  void updateRadius(float32_t meter);
204  void resetYaw(VehicleCallBack callback = 0, UserData userData = 0);
212  ACK::ErrorCode resetYaw(int timer);
221  void getHotpointSettings(VehicleCallBack callback = 0, UserData userData = 0);
237  static void startCallback(RecvContainer recvFrame, UserData userData);
245  static void getHotpointSettingsCallback(Vehicle* vehiclePtr,
246  RecvContainer recvFrame,
247  UserData userData);
256  void setHotpointCallback(VehicleCallBack callback, UserData userData);
264  void setData(HotPointSettings* data);
274  void setHotPoint(float64_t longitude, float64_t latitude, float64_t altitude);
290  void setRadius(float64_t meter);
298  void setYawRate(float32_t degree);
306  void setClockwise(bool isClockwise);
314  void setCameraView(View view);
322  void setYawMode(YawMode mode);
323 
324 private:
325  HotPointSettings hotPointData;
326 };
327 
328 } // namespace OSDK
329 } // namespace DJI
330 
331 #endif // DJI_HOTPOINT_H
void resetYaw(VehicleCallBack callback=0, UserData userData=0)
reset yaw of hotpoint mission
Definition: dji_hotpoint.cpp:226
HotPoint Mission Initialization settings.
Definition: dji_mission_type.hpp:52
void * UserData
This is used as the datatype for all data arguments in callbacks.
Definition: dji_type.hpp:75
HotpointMission(Vehicle *vehicle=0)
Definition: dji_hotpoint.cpp:36
This struct is returned from all blocking calls, except certain mission calls that have explicit type...
Definition: dji_ack.hpp:146
Mission Base class for commonality between SDK Missions.
Definition: dji_mission_base.hpp:58
void setClockwise(bool isClockwise)
Set hotpoint data for initialization purpose.
Definition: dji_hotpoint.cpp:386
This struct is returned from the DJI::OSDK::HotpointMission::readData blocking API.
Definition: dji_ack.hpp:193
void(* VehicleCallBack)(Vehicle *vehicle, RecvContainer recvFrame, UserData userData)
Function prototype for all callback functions used in the OSDK.
Definition: dji_vehicle_callback.hpp:76
void setHotPoint(float64_t longitude, float64_t latitude, float64_t altitude)
Set hotpoint data for initialization purpose.
Definition: dji_hotpoint.cpp:357
void resume(VehicleCallBack callback=0, UserData userData=0)
resume the hotpoint mission
Definition: dji_hotpoint.cpp:167
APIs for Hotpoint (Point of Interest) Missions.
Definition: dji_hotpoint.hpp:45
HotPointSettings getData() const
getting hotpoint data
Definition: dji_hotpoint.cpp:67
Received info.
Definition: dji_vehicle_callback.hpp:59
The CallBackHandler struct allows users to encapsulate callbacks and data in one struct.
Definition: dji_vehicle_callback.hpp:83
void setRadius(float64_t meter)
Set hotpoint data for initialization purpose.
Definition: dji_hotpoint.cpp:374
struct for data broadcast, return GPS data
Definition: dji_telemetry.hpp:272
void setCameraView(View view)
Set hotpoint data for initialization purpose.
Definition: dji_hotpoint.cpp:392
void pause(VehicleCallBack callback=0, UserData userData=0)
pause the hotpoint mission
Definition: dji_hotpoint.cpp:135
void setYawMode(YawMode mode)
Set hotpoint data for initialization purpose.
Definition: dji_hotpoint.cpp:398
void getHotpointSettings(VehicleCallBack callback=0, UserData userData=0)
Read hotpoint mission information from flight controller.
Definition: dji_hotpoint.cpp:258
static void startCallback(RecvContainer recvFrame, UserData userData)
A callback function for start non-blocking calls.
Definition: dji_hotpoint.cpp:322
void updateYawRate(YawRate &Data)
update yaw rate and orientation of hotpoint mission
Definition: dji_hotpoint.cpp:199
void setData(HotPointSettings *data)
Set hotpoint data for initialization purpose.
Definition: dji_hotpoint.cpp:350
Enumeration of all telemetry data types, structures and maps.
void initData()
init hotpoint default data
Definition: dji_hotpoint.cpp:49
void start(VehicleCallBack callback=0, UserData userData=0)
start the hotpoint mission
Definition: dji_hotpoint.cpp:73
void setYawRate(float32_t degree)
Set hotpoint data for initialization purpose.
Definition: dji_hotpoint.cpp:380
void setHotpointCallback(VehicleCallBack callback, UserData userData)
Set hotpoint callback.
Definition: dji_hotpoint.cpp:342
Definition: dji_ack.cpp:38
static void getHotpointSettingsCallback(Vehicle *vehiclePtr, RecvContainer recvFrame, UserData userData)
A callback function for read non-blocking calls.
Definition: dji_hotpoint.cpp:280
void stop(VehicleCallBack callback=0, UserData userData=0)
stop the hotpoint mission
Definition: dji_hotpoint.cpp:103
Mission-Base abstract class for DJI OSDK library.
void updateRadius(float32_t meter)
update radius of hotpoint mission
Definition: dji_hotpoint.cpp:219