Onboard-SDK-ROS
DJI_Follow.h
Go to the documentation of this file.
1 
13 #ifndef DJI_FOLLOW_H
14 #define DJI_FOLLOW_H
15 
16 #include "DJI_Mission.h"
17 
18 namespace DJI
19 {
20 namespace onboardSDK
21 {
22 
23 #pragma pack(1)
24 
25 typedef struct FollowTarget
26 {
27  float64_t latitude;
28  float64_t longitude;
29  uint16_t height;
30  uint16_t angle;
31 } FollowTarget;
32 
33 typedef struct FollowData
34 {
35  uint8_t mode;
36  uint8_t yaw;
37  FollowTarget target;
38  uint8_t sensitivity;
39 } FollowData;
40 
41 #pragma pack()
42 
44 class Follow
45 {
46  public:
47  enum MODE
48  {
49  MODE_RELATIVE = 0,
50  MODE_ROUTE = 1,
51  MODE_SMART = 2
52  };
53 
54  enum YAW_TYPE
55  {
56  YAW_TOTARGET = 0,
57  YAW_CUSTOM = 1
58  };
59 
61  {
62  SENSE_LOW = 0,
63  SENSE_MID = 1,
64  SENSE_HIGH = 2
65  };
66 
67  public:
68  Follow(CoreAPI *ControlAPI = 0);
69  void resetData();
70  void start(FollowData *Data = 0, CallBack callback = 0, UserData userData = 0);
71  void stop(CallBack callback = 0, UserData userData = 0);
73  void pause(bool isPause, CallBack callback = 0, UserData userData = 0);
74  void updateTarget(FollowTarget target);
75  void updateTarget(float64_t latitude, float64_t longitude, uint16_t height,
76  uint16_t angle);
77 
78  public:
79  void setData(const FollowData &value);
80  void setMode(const MODE mode);
81  void setTarget(FollowTarget target);
82  void setYawType(const YAW_TYPE type);
83  void setSensitivity(const SENSITIVITY sense);
84 
85  FollowData getData() const;
86 
87  private:
88  CoreAPI *api;
89  FollowData followData;
90 };
91 
92 }
93 }
94 
95 #endif
MODE
Definition: DJI_Follow.h:47
CoreAPI implements core Open Protocol communication between M100/M600/A3 and your onboard embedded pl...
Definition: DJI_API.h:195
Definition: DJI_Follow.h:33
Definition: DJI_Follow.h:25
SENSITIVITY
Definition: DJI_Follow.h:60
Follow class encapsulates all follow control related functions provided by the DJI OnboardSDK...
Definition: DJI_Follow.h:44
Definition: DJI_Mission.cpp:16