DJI::OSDK::GimbalModule Class Reference

gimbal module More...

#include <dji_gimbal_module.hpp>

Inheritance diagram for DJI::OSDK::GimbalModule:

Classes

struct  callbackWarpperHandler
 

Public Types

enum  GimbalWorkMode : uint8_t {
  WORK_MODE_FREE = 0,
  WORK_MODE_FPV = 1,
  WORK_MODE_TAW_FOLLOW = 2,
  WORK_MODE_DONT_CHANGE = 254
}
 the work mode of gimbal More...
 
enum  ReturnCenterCMD : uint8_t {
  CENTER = 1,
  SELFIE = 2,
  PITCH_AND_YAW = 3,
  PITCH_ONLY = 4,
  ROLL_ONLY = 5,
  YAW_ONLY = 6
}
 the work mode of gimbal More...
 
typedef uint8_t retCodeType
 
typedef struct DJI::OSDK::GimbalModule::Rotation Rotation
 
typedef struct DJI::OSDK::GimbalModule::gimbalAngleSetting gimbalAngleSetting
 
typedef struct DJI::OSDK::GimbalModule::gimbalWorkModeAndReturnCenterSetting gimbalWorkModeAndReturnCenterSetting
 
typedef struct DJI::OSDK::GimbalModule::callbackWarpperHandler callbackWarpperHandler
 

Public Member Functions

 GimbalModule (Linker *linker, PayloadIndexType payloadIndex, std::string name, bool enable)
 
void resetAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData)
 reset gimbal in pitch and yaw, non-blocking calls More...
 
ErrorCode::ErrorCodeType resetSync (int timeout)
 reset gimbal in pitch and yaw, blocking calls More...
 
void rotateAsync (Rotation rotation, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData)
 reset gimbal in pitch and yaw, non-blocking calls More...
 
ErrorCode::ErrorCodeType rotateSync (Rotation rotation, int timeout)
 rotate gimbal angle, blocking calls More...
 
- Public Member Functions inherited from DJI::OSDK::PayloadBase
 PayloadBase (Linker *linker, PayloadIndexType index, std::string name, bool enable)
 
void setEnable (bool en)
 set the enable status of this payload module More...
 
bool getEnable ()
 get the enable status of this payload module More...
 
PayloadIndexType getIndex ()
 
std::string getName ()
 
void setName (std::string name)
 
Linker * getLinker ()
 

Detailed Description

gimbal module

Member Typedef Documentation

◆ callbackWarpperHandler

Used as the type of userData to be passed in the callbackWrapperFunc to wrapper the callback handling.

Member Enumeration Documentation

◆ GimbalWorkMode

the work mode of gimbal

Enumerator
WORK_MODE_FREE 

Free mode

WORK_MODE_FPV 

FPV mode

WORK_MODE_TAW_FOLLOW 

Follow mode

◆ ReturnCenterCMD

the work mode of gimbal

Enumerator
CENTER 

yaw return center for drone, pry return center for osmo

SELFIE 

pry return toward user

PITCH_AND_YAW 

pitch and yaw return center

PITCH_ONLY 

only pitch return center

ROLL_ONLY 

only roll return center

YAW_ONLY 

only yaw return center

Member Function Documentation

◆ resetAsync()

void DJI::OSDK::GimbalModule::resetAsync ( void(*)(ErrorCode::ErrorCodeType retCode, UserData userData)  UserCallBack,
UserData  userData 
)

reset gimbal in pitch and yaw, non-blocking calls

Parameters
UserCallBackcallback function defined by user
  • retCode is the ErrorCode::ErrorCodeType error code
  • userData the interface to pass userData in when the callback is called
userDatawhen UserCallBack is called, used in UserCallBack

◆ resetSync()

ErrorCode::ErrorCodeType DJI::OSDK::GimbalModule::resetSync ( int  timeout)

reset gimbal in pitch and yaw, blocking calls

Parameters
timeoutblocking timeout in seconds
Returns
ErrorCode::ErrorCodeType error code

◆ rotateAsync()

void DJI::OSDK::GimbalModule::rotateAsync ( Rotation  rotation,
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData)  UserCallBack,
UserData  userData 
)

reset gimbal in pitch and yaw, non-blocking calls

Parameters
rotationrotation parameter to be set, ref to DJI::OSDK::GimbalModule::Rotation
UserCallBackcallback function defined by user
  • retCode is the ErrorCode::ErrorCodeType error code
  • userData the interface to pass userData in when the callback is called
userDatawhen UserCallBack is called, used in UserCallBack
Returns
ErrorCode::ErrorCodeType error code

◆ rotateSync()

ErrorCode::ErrorCodeType DJI::OSDK::GimbalModule::rotateSync ( Rotation  rotation,
int  timeout 
)

rotate gimbal angle, blocking calls

Parameters
rotationrotation parameter to be set, ref to DJI::OSDK::GimbalModule::Rotation
timeoutblocking timeout in seconds
Returns
ErrorCode::ErrorCodeType error code

The documentation for this class was generated from the following file: