Gimbal Management
The header file for log management related functions is dji_gimbal_manager.h
. This document describes the key information and usage of the structure and function prototypes in the dji_gimbal_manager.h
file.
For the log management concepts and functions, please read the Gimbal Management of the PSDK Tutorial.
The header file of the PSDK PTZ management related functions is dji_gimbal_manager.h
. This document describes the key information and usage of the structure and function prototypes in the dji_gimbal_manager.h
file.
Catalog
DjiGimbalManager_Init
DjiGimbalManager_Deinit
DjiGimbalManager_SetMode
DjiGimbalManager_Reset
DjiGimbalManager_Rotate
DjiGimbalManager_SetPitchRangeExtensionEnabled
DjiGimbalManager_SetControllerMaxSpeedPercentage
DjiGimbalManager_SetControllerSmoothFactor
DjiGimbalManager_RestoreFactorySettings
Gimbal manager rotation command property.
typedef struct {
E_DjiGimbalRotationMode rotationMode; /*!< Rotation gimbal mode. */
dji_f32_t pitch; /*!< Pitch angle in degree, unit: deg */
dji_f32_t roll; /*!< Roll angle in degree, unit: deg */
dji_f32_t yaw; /*!< Yaw angle in degree, unit: deg */
dji_f64_t time; /*!< Expected execution time for gimbal rotation, in seconds. */
} T_DjiGimbalManagerRotation;
Function
Initialize the gimbal manager module.
Note: This interface must be initialized after DjiCore_Init.
T_DjiReturnCode DjiGimbalManager_Init(void);
Return
The details for the return code please refer to: DjiErrorCode
DeInitialize the gimbal manager module.
T_DjiReturnCode DjiGimbalManager_Deinit(void);
Return
The details for the return code please refer to: DjiErrorCode
Set the work mode of the gimbal.
T_DjiReturnCode DjiGimbalManager_SetMode(E_DjiMountPosition mountPosition, E_DjiGimbalMode mode);
mountPosition:gimbal mount position, input limit see enum E_DjiMountPosition
mode:gimbal work mode, input limit see enum E_DjiGimbalMode
Return
The details for the return code please refer to: DjiErrorCode
Reset the pitch and yaw of the gimbal.
T_DjiReturnCode DjiGimbalManager_Reset(E_DjiMountPosition mountPosition, E_DjiGimbalResetMode resetMode);
mountPosition:gimbal mount position, input limit see enum E_DjiMountPosition
mode:reset mode, input limit see enum E_DjiGimbalResetMode
Return
The details for the return code please refer to: DjiErrorCode
Rotate the angle of the gimbal.
T_DjiReturnCode DjiGimbalManager_Rotate(E_DjiMountPosition mountPosition, T_DjiGimbalManagerRotation rotation);
mountPosition:gimbal mount position, input limit see enum E_DjiMountPosition
rotation:the rotation parameters to be executed on the target gimbal, including the rotation mode, target
Return
The details for the return code please refer to: DjiErrorCode
! Prototype of callback function used to enable or disable extended pitch axis angle range.
Note: Switching the gimbal limit euler angle of pitch axis to the extended limit angle or the default limit angle.
T_DjiReturnCode DjiGimbalManager_SetPitchRangeExtensionEnabled(E_DjiMountPosition mountPosition, bool enabledFlag);
mountPosition:gimbal mount position, input limit see enum E_DjiMountPosition
enabledFlag:flag specifying whether to enable or disable the extended pitch axis angle range..
Return
The details for the return code please refer to: DjiErrorCode
Set max speed percentage for gimbal controller.
T_DjiReturnCode DjiGimbalManager_SetControllerMaxSpeedPercentage(E_DjiMountPosition mountPosition, E_DjiGimbalAxis axis, uint8_t maxSpeedPercentage);
mountPosition:gimbal mount position, input limit see enum E_DjiMountPosition
axis:axis to be set.
maxSpeedPercentage:max speed value. Recommended calculation formula is "spd = default_max_spd x / 100",
Return
The details for the return code please refer to: DjiErrorCode
Set smooth factor for gimbal controller, using for smooth control.
T_DjiReturnCode DjiGimbalManager_SetControllerSmoothFactor(E_DjiMountPosition mountPosition, E_DjiGimbalAxis axis, uint8_t smoothingFactor);
mountPosition:gimbal mount position, input limit see enum E_DjiMountPosition
axis:axis to be set.
smoothingFactor:smooth factor. A larger value results in slower gimbal acceleration. Recommended
Return
The details for the return code please refer to: DjiErrorCode
Restore factory settings of gimbal, including fine tune angle, pitch angle extension enable flag and max speed etc.
T_DjiReturnCode DjiGimbalManager_RestoreFactorySettings(E_DjiMountPosition mountPosition);
mountPosition:gimbal mount position, input limit see enum E_DjiMountPosition
Return
The details for the return code please refer to: DjiErrorCode