Skip to main content

Gimbal Management

Macros

Defines the rotational properties of the gimbal:

typedef struct {
E_UAVGimbalRotationMode rotationMode; /*!< Rotation gimbal mode. */
float pitch; /*!< Pitch angle in degree, unit: deg */
float roll; /*!< Roll angle in degree, unit: deg */
float yaw; /*!< Yaw angle in degree, unit: deg */
int64_t time; /*!< Expect execution time of gimbal rotation, unit: second. */
} T_UAVGimbalManagerRotation;

Function Prototypes

UAV_GimbalManager_Init

  • Function: Initializes the gimbal management module.

    note:

    • This interface should be initialized after UAV_Core_Init().
T_UAVReturnCode UAV_GimbalManager_Init(void)

UAV_GimbalManager_Deinit

  • Function: Deinitializes the gimbal management module.
T_UAVReturnCode UAV_GimbalManager_Deinit(void)

UAV_GimbalManager_SetMode

  • Function: Set gimbal working mode.
T_UAVReturnCode UAV_GimbalManager_SetMode(E_UAVGimbalMode mode)
  • Parameter
    • mode: Gimbal working mode. The input restrictions are defined in E_UAVGimbalMode.

UAV_GimbalManager_Reset

  • Function: Reset the gimbal's pitch and yaw angles.
T_UAVReturnCode UAV_GimbalManager_Reset(E_UAVGimbalResetMode resetMode)
  • Parameter
    • mode:Reset mode, input restrictions are defined in E_UAVGimbalResetMode.

UAV_GimbalManager_Rotate

  • Function: Rotate the gimbal angle.
T_UAVReturnCode UAV_GimbalManager_Rotate(T_UAVGimbalManagerRotation rotation)
  • Parameters
    • rotation:Rotation parameters for the target gimbal, including rotation mode, target angle value, and execution time, defined in T_UAVGimbalManagerRotation.
    • mountPosition:The gimbal mounting position, input restrictions are defined in E_UAVMountPosition.

UAV_GimbalManager_SetPitchRangeExtensionEnabled

  • Function: Set the maximum speed percentage of the gimbal controller.
T_UAVReturnCode UAV_GimbalManager_SetPitchRangeExtensionEnabled(bool enabledFlag)
  • Parameter
    • enabledFlag:Specify whether to enable or disable the gimbal pitch limit extension.

UAV_GimbalManager_SetControllerMaxSpeedPercentage

  • Function: Set the maximum speed percentage of the gimbal controller.
T_UAVReturnCode UAV_GimbalManager_SetControllerMaxSpeedPercentage(E_UAVGimbalAxis axis, uint8_t maxSpeedPercentage)
  • Parameters
    • maxSpeedPercentage: Maximum speed value, the recommended calculation formula is "spd = default_max_spd * x / 100", where x is the default maximum speed. The range is from 1 to 100.
    • axis:Set the axis.

UAV_GimbalManager_SetControllerSmoothFactor

  • Function:Set the smoothing factor of the gimbal controller.
T_UAVReturnCode UAV_GimbalManager_SetControllerSmoothFactor(E_UAVGimbalAxis axis, uint8_t smoothingFactor)
  • Parameters
    • smoothingFactor: Smoothing factor, the higher the value, the smaller the gimbal's rotation acceleration. The recommended calculation formula is "acc = 10000 * (0.8 ^ (1 + x)) deg/s^2", where x is the smoothing factor, ranging from 1 to 30.
    • axis:The axis to be set.

UAV_GimbalManager_RestoreFactorySettings

  • Function:Restore the gimbal to factory settings.
T_UAVReturnCode UAV_GimbalManager_RestoreFactorySettings()