Onboard-SDK-ROS
DJI_HotPoint.h
Go to the documentation of this file.
1 
20 #ifndef DJI_HOTPOINT_H
21 #define DJI_HOTPOINT_H
22 
23 #include "DJI_Mission.h"
24 
25 namespace DJI
26 {
27 namespace onboardSDK
28 {
29 
30 #pragma pack(1)
31 
32 typedef struct HotPointData
33 {
34  uint8_t version;
35 
36  float64_t latitude;
37  float64_t longitude;
38  float64_t height;
39 
40  float64_t radius;
41  float32_t yawRate; // degree
42 
43  uint8_t clockwise;
44  uint8_t startPoint;
45  uint8_t yawMode;
46  uint8_t reserved[11];
47 } HotPointData;
48 
49 #pragma pack()
50 
51 class HotPoint
52 {
53  public:
54 #pragma pack(1)
55  typedef struct StartACK
56  {
57  uint8_t ack;
58  float32_t maxRadius;
59  } StartACK;
60 
61  typedef struct YawRate
62  {
63  uint8_t clockwise;
64  float32_t yawRate;
65  } YawRate;
66 
67  typedef struct ReadACK
68  {
69  MissionACK ack;
70  HotPointData data;
71  } ReadACK;
72 #pragma pack()
73 
74  enum View
75  {
76  VIEW_NORTH = 0,
77  VIEW_SOUTH = 1,
78  VIEW_WEST = 2,
79  VIEW_EAST = 3,
80  VIEW_NEARBY = 4
81  };
82 
83  enum YawMode
84  {
85  YAW_AUTO = 0,
86  YAW_INSIDE = 1,
87  YAW_OUTSIDE = 2,
88  YAW_CUSTOM = 3,
89  YAW_STATIC = 4,
90  };
91 
92  public:
93  HotPoint(CoreAPI *ControlAPI = 0);
94  void initData();
95 
103  void start(CallBack callback = 0, UserData userData = 0);
104  void stop(CallBack callback = 0, UserData userData = 0);
105  void pause(bool isPause, CallBack callback = 0, UserData userData = 0);
106 
107  void updateYawRate(YawRate &Data, CallBack callback = 0, UserData userData = 0);
108  void updateYawRate(float32_t yawRate, bool isClockwise, CallBack callback = 0,
109  UserData userData = 0);
110  void updateRadius(float32_t meter, CallBack callback = 0, UserData userData = 0);
111  void resetYaw(CallBack callback = 0, UserData userData = 0);
112 
113  void readData(CallBack callback = 0, UserData userData = 0);
114 
115  public:
117  void setData(const HotPointData &value);
118  void setHotPoint(float64_t longtitude, float64_t latitude, float64_t altitude);
119  void setHotPoint(GPSPositionData gps);
120  void setRadius(float64_t meter);
121  void setYawRate(float32_t defree);
122  void setClockwise(bool isClockwise);
123  void setCameraView(View view);
124  void setYawMode(YawMode mode);
125 
126  HotPointData getData() const;
127 
128  public:
129  static void startCallback(CoreAPI *api, Header *protocolHeader, UserData userdata = 0);
130  static void readCallback(CoreAPI *api, Header *protoclHeader, UserData userdata);
131 
132  private:
133  CoreAPI *api;
134  HotPointData hotPointData;
135 };
136 
137 } // namespace onboardSDK
138 } // namespace DJI
139 
140 #endif // DJI_HOTPOINT_H
Definition: DJI_HotPoint.h:55
Definition: DJI_HotPoint.h:51
CoreAPI implements core Open Protocol communication between M100/M600/A3 and your onboard embedded pl...
Definition: DJI_API.h:195
Definition: DJI_HotPoint.h:61
Definition: DJI_HotPoint.h:32
Definition: DJI_Type.h:118
Definition: DJI_HotPoint.h:67
Definition: DJI_Mission.cpp:16
Definition: DJI_Type.h:326