CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_ExternalControl/AP_ExternalControl.h
Views: 1798
1
/*
2
external control library for MAVLink, DDS and scripting
3
*/
4
5
#pragma once
6
7
#include "AP_ExternalControl_config.h"
8
9
#if AP_EXTERNAL_CONTROL_ENABLED
10
11
#include <AP_Arming/AP_Arming.h>
12
#include <AP_Common/Location.h>
13
#include <AP_Math/AP_Math.h>
14
15
class AP_ExternalControl
16
{
17
public:
18
19
AP_ExternalControl();
20
/*
21
Set linear velocity and yaw rate. Pass NaN for yaw_rate_rads to not control yaw.
22
Velocity is in earth frame, NED [m/s].
23
Yaw is in earth frame, NED [rad/s].
24
*/
25
virtual bool set_linear_velocity_and_yaw_rate(const Vector3f &linear_velocity, float yaw_rate_rads) WARN_IF_UNUSED {
26
return false;
27
}
28
29
/*
30
Sets the target global position with standard guided mode behavior.
31
*/
32
virtual bool set_global_position(const Location& loc) WARN_IF_UNUSED {
33
return false;
34
}
35
36
/*
37
Arm the vehicle
38
*/
39
virtual bool arm(AP_Arming::Method method, bool do_arming_checks) WARN_IF_UNUSED;
40
41
/*
42
Disarm the vehicle
43
*/
44
virtual bool disarm(AP_Arming::Method method, bool do_disarm_checks) WARN_IF_UNUSED;
45
46
static AP_ExternalControl *get_singleton(void) WARN_IF_UNUSED {
47
return singleton;
48
}
49
protected:
50
~AP_ExternalControl() {}
51
52
private:
53
static AP_ExternalControl *singleton;
54
};
55
56
57
namespace AP
58
{
59
AP_ExternalControl *externalcontrol();
60
};
61
62
#endif // AP_EXTERNAL_CONTROL_ENABLED
63
64