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_AHRS/AP_AHRS_External.h
Views: 1798
1
#pragma once
2
3
/*
4
This program is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
/*
19
* External based AHRS (Attitude Heading Reference System) interface for
20
* ArduPilot
21
*
22
*/
23
24
#include "AP_AHRS_config.h"
25
26
#if AP_AHRS_EXTERNAL_ENABLED
27
28
#include "AP_AHRS_Backend.h"
29
30
class AP_AHRS_External : public AP_AHRS_Backend {
31
public:
32
33
using AP_AHRS_Backend::AP_AHRS_Backend;
34
35
/* Do not allow copies */
36
CLASS_NO_COPY(AP_AHRS_External);
37
38
// reset the current gyro drift estimate
39
// should be called if gyro offsets are recalculated
40
void reset_gyro_drift() override {}
41
42
// Methods
43
bool initialised() const override;
44
void update() override;
45
void get_results(Estimates &results) override;
46
void reset() override {}
47
48
// return a wind estimation vector, in m/s
49
bool wind_estimate(Vector3f &ret) const override {
50
return false;
51
}
52
53
// return a ground vector estimate in meters/second, in North/East order
54
Vector2f groundspeed_vector() override;
55
56
bool use_compass() override {
57
// this is actually never called at the moment; we use dcm's
58
// return value.
59
return true;
60
}
61
62
// return the quaternion defining the rotation from NED to XYZ (body) axes
63
bool get_quaternion(Quaternion &quat) const override WARN_IF_UNUSED;
64
65
void estimate_wind(void);
66
67
// is the AHRS subsystem healthy?
68
bool healthy() const override;
69
70
bool get_velocity_NED(Vector3f &vec) const override;
71
72
// Get a derivative of the vertical position in m/s which is kinematically consistent with the vertical position is required by some control loops.
73
// This is different to the vertical velocity from the EKF which is not always consistent with the vertical position due to the various errors that are being corrected for.
74
bool get_vert_pos_rate_D(float &velocity) const override;
75
76
// returns false if we fail arming checks, in which case the buffer will be populated with a failure message
77
// requires_position should be true if horizontal position configuration should be checked (not used)
78
bool pre_arm_check(bool requires_position, char *failure_msg, uint8_t failure_msg_len) const override;
79
80
// relative-origin functions for fallback in AP_InertialNav
81
bool get_origin(Location &ret) const override;
82
bool get_relative_position_NED_origin(Vector3f &vec) const override;
83
bool get_relative_position_NE_origin(Vector2f &posNE) const override;
84
bool get_relative_position_D_origin(float &posD) const override;
85
86
bool get_filter_status(nav_filter_status &status) const override;
87
void send_ekf_status_report(class GCS_MAVLINK &link) const override;
88
89
void get_control_limits(float &ekfGndSpdLimit, float &controlScaleXY) const override;
90
};
91
92
#endif
93
94