DJI::OSDK::GimbalManager Class Reference

The manager of gimbal module. More...

#include <dji_gimbal_manager.hpp>

Public Member Functions

 GimbalManager (Vehicle *vehiclePtr)
 
ErrorCode::ErrorCodeType initGimbalModule (PayloadIndexType index, const char *name)
 init the gimbal module More...
 
ErrorCode::ErrorCodeType deinitGimbalModule (PayloadIndexType index)
 Deinit the gimbal module. It is a opposite operation to initGimbalModule. It means this gimbal will disable. In the deinit, the gimbal module will set name to be defaultGimbalName and set enable to be false. More...
 
void deinitAllGimbalModule (void)
 deinit all the gimbal modules More...
 
ErrorCode::ErrorCodeType getGimbalModuleName (PayloadIndexType index, std::string &name)
 get the name of gimbal module, searched by index More...
 
ErrorCode::ErrorCodeType getGimbalModuleIndex (const char *name, uint8_t &index)
 get the index of gimbal module, searched by name More...
 
ErrorCode::ErrorCodeType getGimbalModuleEnable (PayloadIndexType index, bool &enable)
 get the enable status of gimbal module, searched by index More...
 
void resetAsync (PayloadIndexType index, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData)
 reset the pitch and yaw of the gimbal, non-blocking calls More...
 
ErrorCode::ErrorCodeType resetSync (PayloadIndexType index, int timeout)
 reset the pitch and yaw of the gimbal, blocking calls More...
 
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 More...
 
ErrorCode::ErrorCodeType rotateSync (PayloadIndexType index, GimbalModule::Rotation rotation, int timeout)
 rotate the angle of the gimbal, blocking calls More...
 

Detailed Description

The manager of gimbal module.

Member Function Documentation

◆ deinitAllGimbalModule()

void GimbalManager::deinitAllGimbalModule ( void  )

deinit all the gimbal modules

Supported Platforms : M210V2, M300

◆ deinitGimbalModule()

ErrorCode::ErrorCodeType GimbalManager::deinitGimbalModule ( PayloadIndexType  index)

Deinit the gimbal module. It is a opposite operation to initGimbalModule. It means this gimbal will disable. In the deinit, the gimbal module will set name to be defaultGimbalName and set enable to be false.

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
Returns
ErrorCode::ErrorCodeType error code

◆ getGimbalModuleEnable()

ErrorCode::ErrorCodeType GimbalManager::getGimbalModuleEnable ( PayloadIndexType  index,
bool &  enable 
)

get the enable status of gimbal module, searched by index

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
enableget the enable status of GimbalModule. If get fail, this parameter will not do any assignment
Returns
ErrorCode::ErrorCodeType error code

◆ getGimbalModuleIndex()

ErrorCode::ErrorCodeType GimbalManager::getGimbalModuleIndex ( const char *  name,
uint8_t &  index 
)

get the index of gimbal module, searched by name

Supported Platforms : M210V2, M300
Parameters
namename of gimbal module
indexgimbal module index, see enum DJI::OSDK::PayloadIndexType. If get fail, this parameter will not do any assignment
Returns
ErrorCode::ErrorCodeType error code

◆ getGimbalModuleName()

ErrorCode::ErrorCodeType GimbalManager::getGimbalModuleName ( PayloadIndexType  index,
std::string &  name 
)

get the name of gimbal module, searched by index

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
namename of the gimbal module, it's a output parameter. If get fail, this parameter will not do any assignment
Returns
ErrorCode::ErrorCodeType error code

◆ initGimbalModule()

ErrorCode::ErrorCodeType GimbalManager::initGimbalModule ( PayloadIndexType  index,
const char *  name 
)

init the gimbal module

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
namegimbal module name used in initialization
Returns
ErrorCode::ErrorCodeType error code

◆ resetAsync()

void GimbalManager::resetAsync ( PayloadIndexType  index,
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData)  UserCallBack,
UserData  userData 
)

reset the pitch and yaw of the gimbal, non-blocking calls

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
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 GimbalManager::resetSync ( PayloadIndexType  index,
int  timeout 
)

reset the pitch and yaw of the gimbal, blocking calls

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
timeoutblocking timeout in seconds.
Returns
ErrorCode::ErrorCodeType error code

◆ rotateAsync()

void GimbalManager::rotateAsync ( PayloadIndexType  index,
GimbalModule::Rotation  rotation,
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData)  UserCallBack,
UserData  userData 
)

rotate the angle of the gimbal, non-blocking calls

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
rotationthe rotation parameters to be executed on the target gimbal, including the rotation mode, target angle value and executed time, 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

◆ rotateSync()

ErrorCode::ErrorCodeType GimbalManager::rotateSync ( PayloadIndexType  index,
GimbalModule::Rotation  rotation,
int  timeout 
)

rotate the angle of the gimbal, blocking calls

Supported Platforms : M210V2, M300
Parameters
indexgimbal module index, input limit see enum DJI::OSDK::PayloadIndexType
rotationthe rotation parameters to be executed on the target gimbal, including the rotation mode, target angle value and executed time, 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 files: