dji_gimbal_manager.hpp
Go to the documentation of this file.
1 
29 #ifndef ONBOARDSDK_DJI_GIMBAL_MANAGER_HPP
30 #define ONBOARDSDK_DJI_GIMBAL_MANAGER_HPP
31 
32 #include <vector>
33 #include "dji_gimbal_module.hpp"
34 
35 namespace DJI {
36 namespace OSDK {
40  public:
41  GimbalManager(Vehicle *vehiclePtr);
42 
43  ~GimbalManager();
44 
45  public:
56  const char *name);
68 
73  void deinitAllGimbalModule(void);
74 
85  std::string &name);
86 
95  ErrorCode::ErrorCodeType getGimbalModuleIndex(const char *name, uint8_t &index);
96 
107  bool &enable);
108 
120  void resetAsync(PayloadIndexType index,
121  void (*UserCallBack)(ErrorCode::ErrorCodeType retCode,
122  UserData userData),
123  UserData userData);
124 
134  PayloadIndexType index, int timeout);
135 
150  void rotateAsync(PayloadIndexType index, GimbalModule::Rotation rotation,
151  void (*UserCallBack)(ErrorCode::ErrorCodeType retCode,
152  UserData userData),
153  UserData userData);
154 
167  PayloadIndexType index, GimbalModule::Rotation rotation, int timeout);
168  private:
169  Linker *linker;
170 
171  std::vector<GimbalModule *> gimbalModuleVector;
172 
173  GimbalModule *getGimbalModule(PayloadIndexType index);
174 
175  GimbalModule *getGimbalModule(std::string name);
176 
177  const char *defaultGimbalName = "uninitialized_gimbal";
178 };
179 
180 } // namespace OSDK
181 } // namespace DJI
182 
183 #endif // ONBOARDSDK_DJI_GIMBAL_MANAGER_HPP
void * UserData
This is used as the datatype for all data arguments in callbacks.
Definition: dji_type.hpp:75
int64_t ErrorCodeType
Unified error type.
Definition: dji_error.hpp:144
void resetAsync(PayloadIndexType index, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData)
reset the pitch and yaw of the gimbal, non-blocking calls
Definition: dji_gimbal_manager.cpp:136
ErrorCode::ErrorCodeType resetSync(PayloadIndexType index, int timeout)
reset the pitch and yaw of the gimbal, blocking calls
Definition: dji_gimbal_manager.cpp:150
Implementation of gimbal module for payload node.
PayloadIndexType
The payload Index of camera.
Definition: dji_payload_base.hpp:42
The manager of gimbal module.
Definition: dji_gimbal_manager.hpp:39
ErrorCode::ErrorCodeType rotateSync(PayloadIndexType index, GimbalModule::Rotation rotation, int timeout)
rotate the angle of the gimbal, blocking calls
Definition: dji_gimbal_manager.cpp:175
void rotateAsync(PayloadIndexType index, GimbalModule::Rotation rotation, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData)
rotate the angle of the gimbal, non-blocking calls
Definition: dji_gimbal_manager.cpp:160
ErrorCode::ErrorCodeType getGimbalModuleIndex(const char *name, uint8_t &index)
get the index of gimbal module, searched by name
Definition: dji_gimbal_manager.cpp:114
ErrorCode::ErrorCodeType getGimbalModuleEnable(PayloadIndexType index, bool &enable)
get the enable status of gimbal module, searched by index
Definition: dji_gimbal_manager.cpp:125
ErrorCode::ErrorCodeType initGimbalModule(PayloadIndexType index, const char *name)
init the gimbal module
Definition: dji_gimbal_manager.cpp:70
ErrorCode::ErrorCodeType getGimbalModuleName(PayloadIndexType index, std::string &name)
get the name of gimbal module, searched by index
Definition: dji_gimbal_manager.cpp:103
void deinitAllGimbalModule(void)
deinit all the gimbal modules
Definition: dji_gimbal_manager.cpp:96
Definition: dji_ack.cpp:38
gimbal module
Definition: dji_gimbal_module.hpp:45
ErrorCode::ErrorCodeType deinitGimbalModule(PayloadIndexType index)
Deinit the gimbal module. It is a opposite operation to initGimbalModule. It means this gimbal will d...
Definition: dji_gimbal_manager.cpp:84