Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add offboard control docs #53

Merged
merged 4 commits into from Oct 31, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+762 −8
Diff settings

Always

Just for now

Binary file not shown.
@@ -61,6 +61,7 @@ The most important classes are:
- [Action](/api_reference/classdronecore_1_1_action.md): Simple drone actions including arming, taking off, and landing.
- [Mission](/api_reference/classdronecore_1_1_mission.md): Waypoint mission creation and upload/download. Missions are created from [MissionItem](/api_reference/classdronecore_1_1_mission_item.md) objects.
- [Offboard](/api_reference/classdronecore_1_1_offboard.md): Control a drone with velocity commands.
- [Gimbal](/api_reference/classdronecore_1_1_gimbal.md): Control a gimbal.
- [Logging](/api_reference/classdronecore_1_1_logging.md): Data logging and streaming from the vehicle.
- [include/device_plugin_container.h.in](https://github.com/dronecore/DroneCore/blob/master/include/device_plugin_container.h.in): Auto-generated file that is required for DroneCore plugin development - see [DevicePluginContainer](/api_reference/classdronecore_1_1_device_plugin_container.md).

@@ -10,10 +10,12 @@
* [Telemetry](guide/telemetry.md)
* [Taking Off and Landing](guide/taking_off_landing.md)
* [Missions](guide/missions.md)
* [Offboard Control](guide/offboard.md)
* [Building C++ Apps](guide/toolchain.md)
* [Examples](examples/README.md)
* [Takeoff and Land](examples/takeoff_and_land.md)
* [Fly Mission](examples/fly_mission.md)
* [Offboard Mode - Velocity Control](examples/offboard_velocity.md)
* [API Reference](api_reference/README.md)
* [class DroneCore](api_reference/classdronecore_1_1_drone_core.md)
* [class Device](api_reference/classdronecore_1_1_device.md)
@@ -35,6 +37,7 @@
* [class Offboard](api_reference/classdronecore_1_1_offboard.md)
* [struct VelocityBodyYawspeed](api_reference/structdronecore_1_1_offboard_1_1_velocity_body_yawspeed.md)
* [struct VelocityNEDYaw](api_reference/structdronecore_1_1_offboard_1_1_velocity_n_e_d_yaw.md)
* [class Gimbal](api_reference/classdronecore_1_1_gimbal.md)
* [class Logging](api_reference/classdronecore_1_1_logging.md)
* [class DevicePluginContainer](api_reference/classdronecore_1_1_device_plugin_container.md)
* [Contributing](contributing/README.md)
@@ -20,5 +20,6 @@
* [class Offboard](classdronecore_1_1_offboard.md)
* [struct VelocityBodyYawspeed](structdronecore_1_1_offboard_1_1_velocity_body_yawspeed.md)
* [struct VelocityNEDYaw](structdronecore_1_1_offboard_1_1_velocity_n_e_d_yaw.md)
* [class Gimbal](classdronecore_1_1_gimbal.md)
* [class Logging](classdronecore_1_1_logging.md)
* [class DevicePluginContainer](classdronecore_1_1_device_plugin_container.md)
@@ -27,6 +27,7 @@ Type | Name | Description
| [Device](#classdronecore_1_1_device_1aa64ba685fe110fcb0a8e1b92156f144b) (DeviceImpl *impl) | Constructor (internal use only).
| [~Device](#classdronecore_1_1_device_1a65c697e12eed30109074e18a9cfdc836) () | Destructor (internal use only).
[Action](classdronecore_1_1_action.md) & | [action](#classdronecore_1_1_device_plugin_container_1aea48bd55b1ace227ebb56690794c2192) () |
[Gimbal](classdronecore_1_1_gimbal.md) & | [gimbal](#classdronecore_1_1_device_plugin_container_1a2fce9f439c565af9a8510c5746c728f0) () |
[Info](classdronecore_1_1_info.md) & | [info](#classdronecore_1_1_device_plugin_container_1a1509e3d7a469cbc3e33471138b1f4dc7) () |
[Logging](classdronecore_1_1_logging.md) & | [logging](#classdronecore_1_1_device_plugin_container_1a0551f966021bdbd9e41700232c33d379) () |
[Mission](classdronecore_1_1_mission.md) & | [mission](#classdronecore_1_1_device_plugin_container_1a8a05778326d0ef4c74146bc42fdcb52d) () |
@@ -76,6 +77,18 @@ Getter for [Action](classdronecore_1_1_action.md) plugin.
 [Action](classdronecore_1_1_action.md) & - a reference to the action plugin instance
### gimbal() {#classdronecore_1_1_device_plugin_container_1a2fce9f439c565af9a8510c5746c728f0}
```cpp
Gimbal& dronecore::DevicePluginContainer::gimbal()
```
Getter for [Gimbal](classdronecore_1_1_gimbal.md) plugin.
**Returns**
 [Gimbal](classdronecore_1_1_gimbal.md) & - a reference to the gimbal plugin instance
### info() {#classdronecore_1_1_device_plugin_container_1a1509e3d7a469cbc3e33471138b1f4dc7}
```cpp
Info& dronecore::DevicePluginContainer::info()
@@ -17,6 +17,7 @@ Type | Name | Description
---: | --- | ---
| [DevicePluginContainer](#classdronecore_1_1_device_plugin_container_1af4c0f2facc64a99818737971f7f1cc77) (const DevicePluginContainer &)=delete |
[Action](classdronecore_1_1_action.md) & | [action](#classdronecore_1_1_device_plugin_container_1aea48bd55b1ace227ebb56690794c2192) () |
[Gimbal](classdronecore_1_1_gimbal.md) & | [gimbal](#classdronecore_1_1_device_plugin_container_1a2fce9f439c565af9a8510c5746c728f0) () |
[Info](classdronecore_1_1_info.md) & | [info](#classdronecore_1_1_device_plugin_container_1a1509e3d7a469cbc3e33471138b1f4dc7) () |
[Logging](classdronecore_1_1_logging.md) & | [logging](#classdronecore_1_1_device_plugin_container_1a0551f966021bdbd9e41700232c33d379) () |
[Mission](classdronecore_1_1_mission.md) & | [mission](#classdronecore_1_1_device_plugin_container_1a8a05778326d0ef4c74146bc42fdcb52d) () |
@@ -53,6 +54,18 @@ Getter for [Action](classdronecore_1_1_action.md) plugin.
 [Action](classdronecore_1_1_action.md) & - a reference to the action plugin instance
### gimbal() {#classdronecore_1_1_device_plugin_container_1a2fce9f439c565af9a8510c5746c728f0}
```cpp
Gimbal& dronecore::DevicePluginContainer::gimbal()
```
Getter for [Gimbal](classdronecore_1_1_gimbal.md) plugin.
**Returns**
 [Gimbal](classdronecore_1_1_gimbal.md) & - a reference to the gimbal plugin instance
### info() {#classdronecore_1_1_device_plugin_container_1a1509e3d7a469cbc3e33471138b1f4dc7}
```cpp
Info& dronecore::DevicePluginContainer::info()
@@ -0,0 +1,178 @@
# dronecore::Gimbal Class Reference
`#include: gimbal.h`

----


The [Gimbal](classdronecore_1_1_gimbal.md) class enables to control a gimbal.


Synchronous and asynchronous variants of the gimbal methods are supplied.


## Public Types


Type | Description
--- | ---
enum [Result](#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f) | Possible results returned for gimbal commands.
std::function< void([Result](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f))> [result_callback_t](#classdronecore_1_1_gimbal_1a309448760ba62635fce7139be44788ff) | Callback type for asynchronous [Gimbal](classdronecore_1_1_gimbal.md) calls.

## Public Member Functions


Type | Name | Description
---: | --- | ---
| [Gimbal](#classdronecore_1_1_gimbal_1a14f51547abcaabeb212ec04439e497be) (GimbalImpl *impl) | Constructor (internal use only).
| [~Gimbal](#classdronecore_1_1_gimbal_1a4f8b2a6cf5a7347a474f8e47618ad838) () | Destructor (internal use only).
| [Gimbal](#classdronecore_1_1_gimbal_1a82637c62da14ae39db96724d4273cad4) (const Gimbal &)=delete | Copy constructor (object is not copyable).
[Result](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f) | [set_pitch_and_yaw](#classdronecore_1_1_gimbal_1ac8ac49d29f11b2107da6b043bb57b54e) (float pitch_deg, float yaw_deg) | Set gimbal pitch and yaw angles (synchronous).
void | [set_pitch_and_yaw_async](#classdronecore_1_1_gimbal_1a3aea07049f32f8bc5b2edaee8cb2ac16) (float pitch_deg, float yaw_deg, result_callback_t callback) | Set gimbal pitch and yaw angles (asynchronous).
const [Gimbal](classdronecore_1_1_gimbal.md) & | [operator=](#classdronecore_1_1_gimbal_1ad15551254ea56674c576bbcbec6e7eac) (const Gimbal &)=delete | Equality operator (object is not copyable).

## Static Public Member Functions


Type | Name | Description
---: | --- | ---
const char * | [result_str](#classdronecore_1_1_gimbal_1ad60c5378cc7d160be67432f4d6daa30d) (Result result) | Returns a human-readable English string for [Gimbal::Result](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f).


## Constructor & Destructor Documentation


### Gimbal() {#classdronecore_1_1_gimbal_1a14f51547abcaabeb212ec04439e497be}
```cpp
dronecore::Gimbal::Gimbal(GimbalImpl *impl)
```
Constructor (internal use only).
**Parameters**
* GimbalImpl * **impl** - Private internal implementation.
### ~Gimbal() {#classdronecore_1_1_gimbal_1a4f8b2a6cf5a7347a474f8e47618ad838}
```cpp
dronecore::Gimbal::~Gimbal()
```
Destructor (internal use only).
### Gimbal() {#classdronecore_1_1_gimbal_1a82637c62da14ae39db96724d4273cad4}
```cpp
dronecore::Gimbal::Gimbal(const Gimbal &)=delete
```
Copy constructor (object is not copyable).
**Parameters**
* const [Gimbal](classdronecore_1_1_gimbal.md) & -
## Member Typdef Documentation
### typedef result_callback_t {#classdronecore_1_1_gimbal_1a309448760ba62635fce7139be44788ff}
```cpp
typedef std::function<void(Result)> dronecore::Gimbal::result_callback_t
```


Callback type for asynchronous [Gimbal](classdronecore_1_1_gimbal.md) calls.


## Member Enumeration Documentation


### enum Result {#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f}


Possible results returned for gimbal commands.


Value | Description
--- | ---
<span id="classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6fad0749aaba8b833466dfcbb0428e4f89c"></span> `SUCCESS` | Success. The gimbal command was accepted.
<span id="classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6fabb1ca97ec761fc37101737ba0aa2e7c5"></span> `ERROR` | Error. An error occured sending the command.
<span id="classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6fa070a0fb40f6c308ab544b227660aadff"></span> `TIMEOUT` | Timeout. A timeout occured sending the command.
<span id="classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6fa696b031073e74bf2cb98e5ef201d4aa3"></span> `UNKNOWN` | Unspecified error.

## Member Function Documentation


### set_pitch_and_yaw() {#classdronecore_1_1_gimbal_1ac8ac49d29f11b2107da6b043bb57b54e}
```cpp
Result dronecore::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**
&emsp;[Result](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f) - Result of request.
### set_pitch_and_yaw_async() {#classdronecore_1_1_gimbal_1a3aea07049f32f8bc5b2edaee8cb2ac16}
```cpp
void dronecore::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](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a309448760ba62635fce7139be44788ff) **callback** - Function to call with result of request.
### operator=() {#classdronecore_1_1_gimbal_1ad15551254ea56674c576bbcbec6e7eac}
```cpp
const Gimbal& dronecore::Gimbal::operator=(const Gimbal &)=delete
```


Equality operator (object is not copyable).


**Parameters**

* const [Gimbal](classdronecore_1_1_gimbal.md) & -

**Returns**

&emsp;const [Gimbal](classdronecore_1_1_gimbal.md) & -

### result_str() {#classdronecore_1_1_gimbal_1ad60c5378cc7d160be67432f4d6daa30d}
```cpp
static const char* dronecore::Gimbal::result_str(Result result)
```
Returns a human-readable English string for [Gimbal::Result](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f).
**Parameters**
* [Result](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f) **result** -
**Returns**
&emsp;const char * - Human readable string for the [Gimbal::Result](classdronecore_1_1_gimbal.md#classdronecore_1_1_gimbal_1a2404686489b502fbc58e940701ba1e6f).
@@ -39,10 +39,11 @@ Type | Name | Description
| [Offboard](#classdronecore_1_1_offboard_1a8015934ad2d766f8b37b7d5b43f2b089) (OffboardImpl *impl) | Constructor (internal use only).
| [~Offboard](#classdronecore_1_1_offboard_1a7cb4eff36c37fed1c6d973aa41b059b8) () | Destructor (internal use only).
| [Offboard](#classdronecore_1_1_offboard_1ac586be55cb24aa0ccd29c97352dd2ee5) (const Offboard &)=delete | Copy constructor (object is not copyable).
[Offboard::Result](classdronecore_1_1_offboard.md#classdronecore_1_1_offboard_1a0f6e5e9f73289f27dc99abbb3ab572ed) | [start](#classdronecore_1_1_offboard_1a2b3aecd25645101a705cd1d80782311a) () const | Start offboard control (synchronous).
[Offboard::Result](classdronecore_1_1_offboard.md#classdronecore_1_1_offboard_1a0f6e5e9f73289f27dc99abbb3ab572ed) | [stop](#classdronecore_1_1_offboard_1a2cecfbeb40bcd1d314fcfb07eb4dcd60) () const | Stop offboard control (synchronous).
[Offboard::Result](classdronecore_1_1_offboard.md#classdronecore_1_1_offboard_1a0f6e5e9f73289f27dc99abbb3ab572ed) | [start](#classdronecore_1_1_offboard_1a658454f130f7b19d56f23347a448f1b9) () | Start offboard control (synchronous).
[Offboard::Result](classdronecore_1_1_offboard.md#classdronecore_1_1_offboard_1a0f6e5e9f73289f27dc99abbb3ab572ed) | [stop](#classdronecore_1_1_offboard_1ae223c08f1ffc694b26d847cab7738406) () | Stop offboard control (synchronous).
void | [start_async](#classdronecore_1_1_offboard_1a5dd9d18eedb0e4a8f1bbbeebf6f99aa8) (result_callback_t callback) | Start offboard control (asynchronous).
void | [stop_async](#classdronecore_1_1_offboard_1afbe6f50f63d3bc43acc4dfc2f797ca0a) (result_callback_t callback) | Stop offboard control (asynchronous).
bool | [is_active](#classdronecore_1_1_offboard_1a44d9284ef03c8cf6f37a77b2f3cadaf0) () const | Check if offboard control is active.
void | [set_velocity_ned](#classdronecore_1_1_offboard_1a9e7f369a8f7459dc7705f4453a8c307d) (VelocityNEDYaw velocity_ned_yaw) | Set the velocity in NED coordinates and yaw.
void | [set_velocity_body](#classdronecore_1_1_offboard_1ad9dc585be1bc2dba699cf089d4c274cc) (VelocityBodyYawspeed velocity_body_yawspeed) | Set the velocity body coordinates coordinates and yaw angular rate.
const [Offboard](classdronecore_1_1_offboard.md) & | [operator=](#classdronecore_1_1_offboard_1aa6bf966e606cdd361364791d06aca977) (const Offboard &)=delete | Equality operator (object is not copyable).
@@ -129,9 +130,9 @@ Results for offboard requests.
## Member Function Documentation


### start() {#classdronecore_1_1_offboard_1a2b3aecd25645101a705cd1d80782311a}
### start() {#classdronecore_1_1_offboard_1a658454f130f7b19d56f23347a448f1b9}
```cpp
Offboard::Result dronecore::Offboard::start() const
Offboard::Result dronecore::Offboard::start()
```
@@ -143,14 +144,15 @@ Start offboard control (synchronous).
&emsp;[Offboard::Result](classdronecore_1_1_offboard.md#classdronecore_1_1_offboard_1a0f6e5e9f73289f27dc99abbb3ab572ed) - Result of request.
### stop() {#classdronecore_1_1_offboard_1a2cecfbeb40bcd1d314fcfb07eb4dcd60}
### stop() {#classdronecore_1_1_offboard_1ae223c08f1ffc694b26d847cab7738406}
```cpp
Offboard::Result dronecore::Offboard::stop() const
Offboard::Result dronecore::Offboard::stop()
```
Stop offboard control (synchronous).
The vehicle will be put into Hold mode: [https://docs.px4.io/en/flight_modes/hold.html](https://docs.px4.io/en/flight_modes/hold.html)
**Returns**
@@ -178,11 +180,26 @@ void dronecore::Offboard::stop_async(result_callback_t callback)
Stop offboard control (asynchronous).
The vehicle will be put into Hold mode: [https://docs.px4.io/en/flight_modes/hold.html](https://docs.px4.io/en/flight_modes/hold.html)
**Parameters**
* [result_callback_t](classdronecore_1_1_offboard.md#classdronecore_1_1_offboard_1a75eeca649293887ac9d398e6432e431f) **callback** - Callback to receive request result.
### is_active() {#classdronecore_1_1_offboard_1a44d9284ef03c8cf6f37a77b2f3cadaf0}
```cpp
bool dronecore::Offboard::is_active() const
```
Check if offboard control is active.
`true` means that the vehicle is in offboard mode and we are actively sending setpoints.
**Returns**
&emsp;bool - `true` if active
### set_velocity_ned() {#classdronecore_1_1_offboard_1a9e7f369a8f7459dc7705f4453a8c307d}
```cpp
void dronecore::Offboard::set_velocity_ned(VelocityNEDYaw velocity_ned_yaw)
@@ -4,7 +4,7 @@ This section contains examples showing how to use DroneCore.

* [Takeoff and Land](../examples/takeoff_and_land.md) - Shows basic usage of DroneCore (connect to port, detect device, arm, takeoff, land, get telemetry)
* [Fly Mission](../examples/fly_mission.md) - Shows how to create, upload, and run missions.

* [Offboard Velocity Control](../examples/offboard_velocity.md) - Demonstrates how to control a vehicle in Offboard mode using velocity commands (in both the NED and body frames).

All examples are all built and run in the same way, as described in the following section (any exceptions are covered in the page for the associated example).

Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.