mavsdk::Winch Class Reference ​
#include: winch.h
Allows users to send winch actions, as well as receive status information from winch systems.
Data Structures ​
struct Status
struct StatusFlags
Public Types ​
Type | Description |
---|---|
enum WinchAction | Winch Action type. |
enum Result | Possible results returned for winch action requests. |
std::function< void(Result)> ResultCallback | Callback type for asynchronous Winch calls. |
std::function< void(Status)> StatusCallback | Callback type for subscribe_status. |
Handle< Status > StatusHandle | Handle type for subscribe_status. |
Public Member Functions ​
Type | Name | Description |
---|---|---|
 | Winch (System & system) | Constructor. Creates the plugin for a specific System. |
 | Winch (std::shared_ptr< System > system) | Constructor. Creates the plugin for a specific System. |
 | ~Winch () override | Destructor (internal use only). |
 | Winch (const Winch & other) | Copy constructor. |
StatusHandle | subscribe_status (const StatusCallback & callback) | Subscribe to 'winch status' updates. |
void | unsubscribe_status (StatusHandle handle) | Unsubscribe from subscribe_status. |
Status | status () const | Poll for 'Status' (blocking). |
void | relax_async (uint32_t instance, const ResultCallback callback) | Allow motor to freewheel. |
Result | relax (uint32_t instance)const | Allow motor to freewheel. |
void | relative_length_control_async (uint32_t instance, float length_m, float rate_m_s, const ResultCallback callback) | Wind or unwind specified length of line, optionally using specified rate. |
Result | relative_length_control (uint32_t instance, float length_m, float rate_m_s)const | Wind or unwind specified length of line, optionally using specified rate. |
void | rate_control_async (uint32_t instance, float rate_m_s, const ResultCallback callback) | Wind or unwind line at specified rate. |
Result | rate_control (uint32_t instance, float rate_m_s)const | Wind or unwind line at specified rate. |
void | lock_async (uint32_t instance, const ResultCallback callback) | Perform the locking sequence to relieve motor while in the fully retracted position. |
Result | lock (uint32_t instance)const | Perform the locking sequence to relieve motor while in the fully retracted position. |
void | deliver_async (uint32_t instance, const ResultCallback callback) | Sequence of drop, slow down, touch down, reel up, lock. |
Result | deliver (uint32_t instance)const | Sequence of drop, slow down, touch down, reel up, lock. |
void | hold_async (uint32_t instance, const ResultCallback callback) | Engage motor and hold current position. |
Result | hold (uint32_t instance)const | Engage motor and hold current position. |
void | retract_async (uint32_t instance, const ResultCallback callback) | Return the reel to the fully retracted position. |
Result | retract (uint32_t instance)const | Return the reel to the fully retracted position. |
void | load_line_async (uint32_t instance, const ResultCallback callback) | Load the reel with line. |
Result | load_line (uint32_t instance)const | Load the reel with line. |
void | abandon_line_async (uint32_t instance, const ResultCallback callback) | Spool out the entire length of the line. |
Result | abandon_line (uint32_t instance)const | Spool out the entire length of the line. |
void | load_payload_async (uint32_t instance, const ResultCallback callback) | Spools out just enough to present the hook to the user to load the payload. |
Result | load_payload (uint32_t instance)const | Spools out just enough to present the hook to the user to load the payload. |
const Winch & | operator= (const Winch &)=delete | Equality operator (object is not copyable). |
Constructor & Destructor Documentation ​
Winch() ​
mavsdk::Winch::Winch(System &system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto winch = Winch(system);
Parameters
- System& system - The specific system associated with this plugin.
Winch() ​
mavsdk::Winch::Winch(std::shared_ptr< System > system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto winch = Winch(system);
Parameters
- std::shared_ptr< System > system - The specific system associated with this plugin.
~Winch() ​
mavsdk::Winch::~Winch() override
Destructor (internal use only).
Winch() ​
mavsdk::Winch::Winch(const Winch &other)
Copy constructor.
Parameters
- const Winch& other -
Member Typdef Documentation ​
typedef ResultCallback ​
using mavsdk::Winch::ResultCallback = std::function<void(Result)>
Callback type for asynchronous Winch calls.
typedef StatusCallback ​
using mavsdk::Winch::StatusCallback = std::function<void(Status)>
Callback type for subscribe_status.
typedef StatusHandle ​
using mavsdk::Winch::StatusHandle = Handle<Status>
Handle type for subscribe_status.
Member Enumeration Documentation ​
enum WinchAction ​
Value | Description |
---|---|
Relaxed | Allow motor to freewheel. |
RelativeLengthControl | Wind or unwind specified length of line, optionally using specified rate. |
RateControl | Wind or unwind line at specified rate. |
Lock | Perform the locking sequence to relieve motor while in the fully retracted position. |
Deliver | Sequence of drop, slow down, touch down, reel up, lock. |
Hold | Engage motor and hold current position. |
Retract | Return the reel to the fully retracted position. |
LoadLine | Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. |
AbandonLine | Spool out the entire length of the line. |
LoadPayload | Spools out just enough to present the hook to the user to load the payload. |
enum Result ​
Possible results returned for winch 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 ​
subscribe_status() ​
StatusHandle mavsdk::Winch::subscribe_status(const StatusCallback &callback)
Subscribe to 'winch status' updates.
Parameters
- const StatusCallback& callback -
Returns
 StatusHandle -
unsubscribe_status() ​
void mavsdk::Winch::unsubscribe_status(StatusHandle handle)
Unsubscribe from subscribe_status.
Parameters
- StatusHandle handle -
status() ​
Status mavsdk::Winch::status() const
Poll for 'Status' (blocking).
Returns
 Status - One Status update.
relax_async() ​
void mavsdk::Winch::relax_async(uint32_t instance, const ResultCallback callback)
Allow motor to freewheel.
This function is non-blocking. See 'relax' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
relax() ​
Result mavsdk::Winch::relax(uint32_t instance) const
Allow motor to freewheel.
This function is blocking. See 'relax_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
relative_length_control_async() ​
void mavsdk::Winch::relative_length_control_async(uint32_t instance, float length_m, float rate_m_s, const ResultCallback callback)
Wind or unwind specified length of line, optionally using specified rate.
This function is non-blocking. See 'relative_length_control' for the blocking counterpart.
Parameters
- uint32_t instance -
- float length_m -
- float rate_m_s -
- const ResultCallback callback -
relative_length_control() ​
Result mavsdk::Winch::relative_length_control(uint32_t instance, float length_m, float rate_m_s) const
Wind or unwind specified length of line, optionally using specified rate.
This function is blocking. See 'relative_length_control_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
- float length_m -
- float rate_m_s -
Returns
 Result - Result of request.
rate_control_async() ​
void mavsdk::Winch::rate_control_async(uint32_t instance, float rate_m_s, const ResultCallback callback)
Wind or unwind line at specified rate.
This function is non-blocking. See 'rate_control' for the blocking counterpart.
Parameters
- uint32_t instance -
- float rate_m_s -
- const ResultCallback callback -
rate_control() ​
Result mavsdk::Winch::rate_control(uint32_t instance, float rate_m_s) const
Wind or unwind line at specified rate.
This function is blocking. See 'rate_control_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
- float rate_m_s -
Returns
 Result - Result of request.
lock_async() ​
void mavsdk::Winch::lock_async(uint32_t instance, const ResultCallback callback)
Perform the locking sequence to relieve motor while in the fully retracted position.
This function is non-blocking. See 'lock' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
lock() ​
Result mavsdk::Winch::lock(uint32_t instance) const
Perform the locking sequence to relieve motor while in the fully retracted position.
This function is blocking. See 'lock_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
deliver_async() ​
void mavsdk::Winch::deliver_async(uint32_t instance, const ResultCallback callback)
Sequence of drop, slow down, touch down, reel up, lock.
This function is non-blocking. See 'deliver' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
deliver() ​
Result mavsdk::Winch::deliver(uint32_t instance) const
Sequence of drop, slow down, touch down, reel up, lock.
This function is blocking. See 'deliver_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
hold_async() ​
void mavsdk::Winch::hold_async(uint32_t instance, const ResultCallback callback)
Engage motor and hold current position.
This function is non-blocking. See 'hold' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
hold() ​
Result mavsdk::Winch::hold(uint32_t instance) const
Engage motor and hold current position.
This function is blocking. See 'hold_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
retract_async() ​
void mavsdk::Winch::retract_async(uint32_t instance, const ResultCallback callback)
Return the reel to the fully retracted position.
This function is non-blocking. See 'retract' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
retract() ​
Result mavsdk::Winch::retract(uint32_t instance) const
Return the reel to the fully retracted position.
This function is blocking. See 'retract_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
load_line_async() ​
void mavsdk::Winch::load_line_async(uint32_t instance, const ResultCallback callback)
Load the reel with line.
The winch will calculate the total loaded length and stop when the tension exceeds a threshold.
This function is non-blocking. See 'load_line' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
load_line() ​
Result mavsdk::Winch::load_line(uint32_t instance) const
Load the reel with line.
The winch will calculate the total loaded length and stop when the tension exceeds a threshold.
This function is blocking. See 'load_line_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
abandon_line_async() ​
void mavsdk::Winch::abandon_line_async(uint32_t instance, const ResultCallback callback)
Spool out the entire length of the line.
This function is non-blocking. See 'abandon_line' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
abandon_line() ​
Result mavsdk::Winch::abandon_line(uint32_t instance) const
Spool out the entire length of the line.
This function is blocking. See 'abandon_line_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
load_payload_async() ​
void mavsdk::Winch::load_payload_async(uint32_t instance, const ResultCallback callback)
Spools out just enough to present the hook to the user to load the payload.
This function is non-blocking. See 'load_payload' for the blocking counterpart.
Parameters
- uint32_t instance -
- const ResultCallback callback -
load_payload() ​
Result mavsdk::Winch::load_payload(uint32_t instance) const
Spools out just enough to present the hook to the user to load the payload.
This function is blocking. See 'load_payload_async' for the non-blocking counterpart.
Parameters
- uint32_t instance -
Returns
 Result - Result of request.
operator=() ​
const Winch& mavsdk::Winch::operator=(const Winch &)=delete
Equality operator (object is not copyable).
Parameters
- const Winch& -
Returns
 const Winch & -