dji_gimbal.hpp
Go to the documentation of this file.
1 
29 #ifndef GIMBAL_H
30 #define GIMBAL_H
31 
32 #include "dji_command.hpp"
33 #include "dji_type.hpp"
34 
35 namespace DJI
36 {
37 namespace OSDK
38 {
39 
40 // Forward Declaration
41 class Vehicle;
42 
46 class Gimbal
47 {
48 public:
49 #pragma pack(1)
50 
66  typedef struct AngleData
67  {
68  int16_t yaw;
69  int16_t roll;
70  int16_t pitch;
71  // clang-format off
81  // clang-format on
82  uint8_t mode;
83  uint8_t duration;
87  } AngleData; // pack(1)
88 
93  typedef struct SpeedData
94  {
95  int16_t yaw;
96  int16_t roll;
97  int16_t
99  uint8_t reserved0 : 1;
100  uint8_t reserved1 : 1;
101  uint8_t extend_control_range : 1;
102  uint8_t disable_fov_zoom : 1;
104  uint8_t yaw_return_neutral : 1;
105  uint8_t ignore_user_stick : 1;
107  } SpeedData; // pack(1)
108 #pragma pack()
109 public:
110  Gimbal(Vehicle* vehicle);
111  ~Gimbal();
112 
113 public:
124  void setAngle(Gimbal::AngleData* data);
125 
136  void setSpeed(Gimbal::SpeedData* data);
137 
138 private:
139  Vehicle* vehicle;
140 };
141 
142 } // OSDK
143 } // DJI
144 
145 #endif // GIMBAL_H
uint8_t disable_fov_zoom
Definition: dji_gimbal.hpp:102
uint8_t mode
Definition: dji_gimbal.hpp:82
int16_t roll
Definition: dji_gimbal.hpp:96
uint8_t ignore_user_stick
Definition: dji_gimbal.hpp:105
uint8_t extend_control_range
Definition: dji_gimbal.hpp:101
int16_t pitch
Definition: dji_gimbal.hpp:98
int16_t yaw
Definition: dji_gimbal.hpp:95
void setAngle(Gimbal::AngleData *data)
Function for setting Gimbal Angle.
Definition: dji_gimbal.cpp:45
struct DJI::OSDK::Gimbal::AngleData AngleData
The Angle Data struct for gimbal control.
int16_t pitch
Definition: dji_gimbal.hpp:70
All DJI OSDK OpenProtocol Command IDs.
The Speed Data struct for gimbal control.
Definition: dji_gimbal.hpp:93
int16_t roll
Definition: dji_gimbal.hpp:69
uint8_t duration
Definition: dji_gimbal.hpp:83
Data type and Data Structure definitions for use throughout DJI OSDK.
void setSpeed(Gimbal::SpeedData *data)
Function for setting Gimbal Speed.
Definition: dji_gimbal.cpp:52
uint8_t yaw_return_neutral
Definition: dji_gimbal.hpp:104
uint8_t gimbal_control_authority
Definition: dji_gimbal.hpp:106
The Gimbal class for controlling gimbal-related functions.
Definition: dji_gimbal.hpp:46
Definition: dji_ack.cpp:38
int16_t yaw
Definition: dji_gimbal.hpp:68
The Angle Data struct for gimbal control.
Definition: dji_gimbal.hpp:66
uint8_t ignore_aircraft_motion
Definition: dji_gimbal.hpp:103
struct DJI::OSDK::Gimbal::SpeedData SpeedData
The Speed Data struct for gimbal control.