Line data Source code
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 3 : const char *shortname() const override { return "External"; } 39 : 40 : // reset the current gyro drift estimate 41 : // should be called if gyro offsets are recalculated 42 7 : void reset_gyro_drift() override {} 43 : 44 : // Methods 45 : void update() override; 46 : void get_results(Estimates &results) override; 47 2115 : void reset() override {} 48 : 49 0 : bool use_compass() override { 50 : // this is actually never called at the moment; we use dcm's 51 : // return value. 52 0 : return true; 53 : } 54 : 55 : void estimate_wind(void); 56 : 57 : // returns false if we fail arming checks, in which case the buffer will be populated with a failure message 58 : // requires_position should be true if horizontal position configuration should be checked (not used) 59 : bool pre_arm_check(bool requires_position, char *failure_msg, uint8_t failure_msg_len) const override; 60 : 61 : // relative-origin functions for fallback in AP_InertialNav 62 : // set the origin, allowing a common origin established by another 63 : // AHRS backend to be shared with the external AHRS 64 : bool set_origin(const Location &loc) override; 65 : bool get_origin(Location &ret) const override; 66 : }; 67 : 68 : #endif