Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
auterion::Gimbal Class Reference

Gimbal control class. More...

#include <auterion_sdk/gimbal/gimbal.hpp>

Public Member Functions

 Gimbal (SDK &sdk, const std::function< bool(const GimbalDescriptor &candidate)> &find_callback)
 Constructs a gimbal object based on a selection function. More...
 
 Gimbal (SDK &sdk, const GimbalDescriptor &descriptor=GimbalDescriptor{})
 Constructs a gimbal object based on a descriptor. More...
 
void setGimbalMode (const GimbalMode &gimbal_mode)
 Sets gimbal mode. More...
 
bool takeControl (const bool force_takeover=false)
 Take control of the gimbal. More...
 
void releaseControl ()
 Release control of the gimbal.
 
void setRateControl (const float roll_rate_rad_s, const float pitch_rate_rad_s, const float yaw_rate_rad_s) const
 Set rate control. More...
 
void setAttitudeControl (const Eigen::Quaternionf &q) const
 Set attitude control using quaternion. More...
 
void setAttitudeControl (const float roll_deg, const float pitch_deg, const float yaw_deg) const
 Set attitude control using Euler angles. More...
 
void setRoiLocation (const auterion::GlobalPosition &position) const
 Set Region of Interest (ROI) location. More...
 
void setRoiLocationNone () const
 Clear Region of Interest (ROI) location.
 
void subscribeAttitude (std::function< void(const GimbalAttitude &)> callback)
 Subscribe to gimbal attitude updates. More...
 

Detailed Description

Gimbal control class.

Constructor & Destructor Documentation

◆ Gimbal() [1/2]

auterion::Gimbal::Gimbal ( SDK sdk,
const std::function< bool(const GimbalDescriptor &candidate)> &  find_callback 
)

Constructs a gimbal object based on a selection function.

Discovers and selects a gimbal connected to the system based on the given selection function. This method is blocking and waits for a suitable gimbal to be found.

Parameters
sdkReference to SDK instance
find_callbackSelection function to choose a gimbal candidate based on its descriptor

◆ Gimbal() [2/2]

auterion::Gimbal::Gimbal ( SDK sdk,
const GimbalDescriptor descriptor = GimbalDescriptor{} 
)
inline

Constructs a gimbal object based on a descriptor.

Discovers and selects a gimbal connected to the system based on the given descriptor, using a pre-defined selection function. The selection function behaves as follows, in order:

  1. If a custom name is provided, the gimbal candidate must match the custom name.
  2. If vendor or model names are provided, the gimbal candidate must match the vendor and model names.
  3. If no custom name, vendor, or model names are provided, it checks capabilities.

This method is blocking and waits for a suitable gimbal to be found.

Parameters
sdkReference to SDK instance
descriptorGimbal descriptor which the selected gimbal must match

Member Function Documentation

◆ setAttitudeControl() [1/2]

void auterion::Gimbal::setAttitudeControl ( const Eigen::Quaternionf &  q) const

Set attitude control using quaternion.

Parameters
qReference to attitude quaternion

quaternion is w.r.t. to vehicle heading (FLU) if gimbal yaw mode is VehicleFollow (default) quaternion is w.r.t. to world East (ENU) if gimbal yaw mode is WorldLock

◆ setAttitudeControl() [2/2]

void auterion::Gimbal::setAttitudeControl ( const float  roll_deg,
const float  pitch_deg,
const float  yaw_deg 
) const

Set attitude control using Euler angles.

Parameters
roll_degRoll angle [deg], positive is right
pitch_degPitch angle [deg], positive is down
yaw_degYaw angle [deg], positive is left

angles in FLU if gimbal yaw mode is VehicleFollow (default) angles in ENU if gimbal yaw mode is WorldLock

◆ setGimbalMode()

void auterion::Gimbal::setGimbalMode ( const GimbalMode gimbal_mode)

Sets gimbal mode.

Affects subsequent control messages.

Parameters
gimbal_modeGimbal mode to set

◆ setRateControl()

void auterion::Gimbal::setRateControl ( const float  roll_rate_rad_s,
const float  pitch_rate_rad_s,
const float  yaw_rate_rad_s 
) const

Set rate control.

Parameters
roll_rate_rad_sRoll rate [rad/s], FLU, positive is right
pitch_rate_rad_sPitch rate [rad/s], FLU, positive is down
yaw_rate_rad_sYaw rate [rad/s], FLU, positive is left

◆ setRoiLocation()

void auterion::Gimbal::setRoiLocation ( const auterion::GlobalPosition position) const

Set Region of Interest (ROI) location.

Parameters
positionReference to global position

◆ subscribeAttitude()

void auterion::Gimbal::subscribeAttitude ( std::function< void(const GimbalAttitude &)>  callback)

Subscribe to gimbal attitude updates.

Parameters
callbackCallback function to handle attitude updates

◆ takeControl()

bool auterion::Gimbal::takeControl ( const bool  force_takeover = false)

Take control of the gimbal.

This is required before sending control commands.

Parameters
force_takeoverTrue to force takeover despite another component using it
Returns
True if control was taken, false otherwise

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