dronecode_sdk::Gimbal Class Reference
#include: gimbal.h
The Gimbal class provides control over a gimbal.
Synchronous and asynchronous variants of the gimbal methods are supplied.
Public Types
Type | Description |
---|---|
enum Result | Possible results returned for gimbal commands. |
std::function< void(Result)> result_callback_t | Callback type for asynchronous Gimbal calls. |
Public Member Functions
Type | Name | Description |
---|---|---|
Gimbal (System & system) | Constructor. Creates the plugin for a specific System. | |
~Gimbal () | Destructor (internal use only). | |
Gimbal (const Gimbal &)=delete | Copy constructor (object is not copyable). | |
Result | set_pitch_and_yaw (float pitch_deg, float yaw_deg) | Set gimbal pitch and yaw angles (synchronous). |
void | set_pitch_and_yaw_async (float pitch_deg, float yaw_deg, result_callback_t callback) | Set gimbal pitch and yaw angles (asynchronous). |
Result | set_roi_location (double latitude_deg, double longitude_deg, float altitude_m) | Set gimbal region of interest (ROI). |
void | set_roi_location_async (double latitude_deg, double longitude_deg, float altitude_m, result_callback_t callback) | Set gimbal region of interest (ROI) (asynchronous). |
const Gimbal & | operator= (const Gimbal &)=delete | Equality operator (object is not copyable). |
Static Public Member Functions
Type | Name | Description |
---|---|---|
const char * | result_str (Result result) | Returns a human-readable English string for Gimbal::Result. |
Constructor & Destructor Documentation
Gimbal()
dronecode_sdk::Gimbal::Gimbal(System &system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto gimbal = std::make_shared<Gimbal>(system);
Parameters
- System& system - The specific system associated with this plugin.
~Gimbal()
dronecode_sdk::Gimbal::~Gimbal()
Destructor (internal use only).
Gimbal()
dronecode_sdk::Gimbal::Gimbal(const Gimbal &)=delete
Copy constructor (object is not copyable).
Parameters
- const Gimbal& -
Member Typdef Documentation
typedef result_callback_t
typedef std::function<void(Result)> dronecode_sdk::Gimbal::result_callback_t
Callback type for asynchronous Gimbal calls.
Member Enumeration Documentation
enum Result
Possible results returned for gimbal commands.
Value | Description |
---|---|
SUCCESS |
Success. The gimbal command was accepted. |
ERROR |
Error. An error occured sending the command. |
TIMEOUT |
Timeout. A timeout occured sending the command. |
UNKNOWN |
Unspecified error. |
Member Function Documentation
set_pitch_and_yaw()
Result dronecode_sdk::Gimbal::set_pitch_and_yaw(float pitch_deg, float yaw_deg)
Set gimbal pitch and yaw angles (synchronous).
This sets the desired pitch and yaw angles of a gimbal. The function will return when the command is accepted, however, it might take the gimbal longer to actually be set to the new angles.
Parameters
- float pitch_deg - The pitch angle in degrees. Negative to point down.
- float yaw_deg - The yaw angle in degrees. Positive for clock-wise, range -180..180 or 0..360.
Returns
Result - Result of request.
set_pitch_and_yaw_async()
void dronecode_sdk::Gimbal::set_pitch_and_yaw_async(float pitch_deg, float yaw_deg, result_callback_t callback)
Set gimbal pitch and yaw angles (asynchronous).
This sets the desired pitch and yaw angles of a gimbal. The callback will be called when the command is accepted, however, it might take the gimbal longer to actually be set to the new angles.
Parameters
- float pitch_deg - The pitch angle in degrees. Negative to point down.
- float yaw_deg - The yaw angle in degrees. Positive for clock-wise, range -180..180 or 0..360.
- result_callback_t callback - Function to call with result of request.
set_roi_location()
Result dronecode_sdk::Gimbal::set_roi_location(double latitude_deg, double longitude_deg, float altitude_m)
Set gimbal region of interest (ROI).
This sets a region of interest that the gimbal will point to. The gimbal will continue to point to the specified region until it receives a new command. The function will return when the command is accepted, however, it might take the gimbal longer to actually rotate to the ROI.
Parameters
- double latitude_deg - Latitude in degrees.
- double longitude_deg - Longitude in degrees.
- float altitude_m - Altitude in meters (ASML).
Returns
Result - Result of request.
set_roi_location_async()
void dronecode_sdk::Gimbal::set_roi_location_async(double latitude_deg, double longitude_deg, float altitude_m, result_callback_t callback)
Set gimbal region of interest (ROI) (asynchronous).
This sets a region of interest that the gimbal will point to. The gimbal will continue to point to the specified region until it receives a new command. The callback will be called when the command is accepted, however, it might take the gimbal longer to actually be set to the new angles.
Parameters
- double latitude_deg - Latitude in degrees.
- double longitude_deg - Longitude in degrees.
- float altitude_m - Altitude in meters (ASML).
- result_callback_t callback - Function to call with result of request.
operator=()
const Gimbal& dronecode_sdk::Gimbal::operator=(const Gimbal &)=delete
Equality operator (object is not copyable).
Parameters
- const Gimbal& -
Returns
const Gimbal & -
result_str()
static const char* dronecode_sdk::Gimbal::result_str(Result result)
Returns a human-readable English string for Gimbal::Result.
Parameters
- Result result - The enum value for which a human readable string is required.
Returns
const char * - Human readable string for the Gimbal::Result.