forked from mavlink/MAVSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.h
61 lines (46 loc) · 1.36 KB
/
action.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include <functional>
namespace dronecore {
class ActionImpl;
class Action
{
public:
explicit Action(ActionImpl *impl);
~Action();
enum class Result {
SUCCESS = 0,
NO_DEVICE,
CONNECTION_ERROR,
BUSY,
COMMAND_DENIED,
COMMAND_DENIED_LANDED_STATE_UNKNOWN,
COMMAND_DENIED_NOT_LANDED,
TIMEOUT,
UNKNOWN
};
static const char *result_str(Result);
typedef std::function<void(Result)> result_callback_t;
Result arm() const;
Result disarm() const;
Result kill() const;
Result takeoff() const;
Result land() const;
Result return_to_launch() const;
void arm_async(result_callback_t callback);
void disarm_async(result_callback_t callback);
void kill_async(result_callback_t callback);
void takeoff_async(result_callback_t callback);
void land_async(result_callback_t callback);
void return_to_launch_async(result_callback_t callback);
void set_takeoff_altitude(float relative_altitude_m);
float get_takeoff_altitude_m() const;
void set_max_speed(float speed_m_s);
float get_max_speed_m_s() const;
// Non-copyable
Action(const Action &) = delete;
const Action &operator=(const Action &) = delete;
private:
// Underlying implementation, set at instantiation
ActionImpl *_impl;
};
} // namespace dronecore