mavsdk::Gripper Class Reference ​
#include: gripper.h
Allows users to send gripper actions.
Public Types ​
Type | Description |
---|---|
enum GripperAction | Gripper Actions. |
enum Result | Possible results returned for gripper action requests. |
std::function< void(Result)> ResultCallback | Callback type for asynchronous Gripper calls. |
Public Member Functions ​
Type | Name | Description |
---|---|---|
 | Gripper (System & system) | Constructor. Creates the plugin for a specific System. |
 | Gripper (std::shared_ptr< System > system) | Constructor. Creates the plugin for a specific System. |
 | ~Gripper () override | Destructor (internal use only). |
 | Gripper (const Gripper & other) | Copy constructor. |
void | grab_async (uint32_t instance, const ResultCallback callback) | Gripper grab cargo. |
Result | grab (uint32_t instance)const | Gripper grab cargo. |
void | release_async (uint32_t instance, const ResultCallback callback) | Gripper release cargo. |
Result | release (uint32_t instance)const | Gripper release cargo. |
const Gripper & | operator= (const Gripper &)=delete | Equality operator (object is not copyable). |
Constructor & Destructor Documentation ​
Gripper() ​
mavsdk::Gripper::Gripper(System &system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto gripper = Gripper(system);
Parameters
- System& system - The specific system associated with this plugin.
Gripper() ​
mavsdk::Gripper::Gripper(std::shared_ptr< System > system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto gripper = Gripper(system);
Parameters
- std::shared_ptr< System > system - The specific system associated with this plugin.
~Gripper() ​
mavsdk::Gripper::~Gripper() override
Destructor (internal use only).
Gripper() ​
mavsdk::Gripper::Gripper(const Gripper &other)
Copy constructor.
Parameters
- const Gripper& other -
Member Typdef Documentation ​
typedef ResultCallback ​
using mavsdk::Gripper::ResultCallback = std::function<void(Result)>
Callback type for asynchronous Gripper calls.
Member Enumeration Documentation ​
enum GripperAction ​
Gripper Actions.
Available gripper actions are defined in mavlink under https://mavlink.io/en/messages/common.html#GRIPPER_ACTIONS
Value | Description |
---|---|
Release | Open the gripper to release the cargo. |
Grab | Close the gripper and grab onto cargo. |
enum Result ​
Possible results returned for gripper action requests.
Value | Description |
---|---|
Unknown | Unknown result. |
Success | Request was successful. |
NoSystem | No system is connected. |
Busy | Temporarily rejected. |
Timeout | Request timed out. |
Unsupported | Action not supported. |
Failed | Action failed. |
Member Function Documentation ​
grab_async() ​
void mavsdk::Gripper::grab_async(uint32_t instance, const ResultCallback callback)
Gripper grab cargo.
This function is non-blocking. See 'grab' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
grab() ​
Result mavsdk::Gripper::grab(uint32_t instance) const
Gripper grab cargo.
This function is blocking. See 'grab_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
release_async() ​
void mavsdk::Gripper::release_async(uint32_t instance, const ResultCallback callback)
Gripper release cargo.
This function is non-blocking. See 'release' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
release() ​
Result mavsdk::Gripper::release(uint32_t instance) const
Gripper release cargo.
This function is blocking. See 'release_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
operator=() ​
const Gripper& mavsdk::Gripper::operator=(const Gripper &)=delete
Equality operator (object is not copyable).
Parameters
- const Gripper& -
Returns
 const Gripper & -