Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_Beacon/AP_Beacon_Backend.h
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/14#pragma once1516#include "AP_Beacon.h"1718#if AP_BEACON_ENABLED1920#include <AP_Common/AP_Common.h>21#include <AP_Math/AP_Math.h>22#include <AP_HAL/AP_HAL.h>2324class AP_Beacon_Backend25{26public:27// constructor. This incorporates initialisation as well.28AP_Beacon_Backend(AP_Beacon &frontend);2930// return true if sensor is basically healthy (we are receiving data)31virtual bool healthy() = 0;3233// update34virtual void update() = 0;3536// set vehicle position37// pos should be in meters in NED frame from the beacon's local origin38// accuracy_estimate is also in meters39void set_vehicle_position(const Vector3f& pos, float accuracy_estimate);4041// set individual beacon distance from vehicle in meters in NED frame42void set_beacon_distance(uint8_t beacon_instance, float distance);4344// set beacon's position45// pos should be in meters in NED from the beacon's local origin46void set_beacon_position(uint8_t beacon_instance, const Vector3f& pos);4748float get_beacon_origin_lat(void) const { return _frontend.origin_lat; }49float get_beacon_origin_lon(void) const { return _frontend.origin_lon; }50float get_beacon_origin_alt(void) const { return _frontend.origin_alt; }5152protected:5354// references55AP_Beacon &_frontend;5657// yaw correction58int16_t orient_yaw_deg; // cached version of orient_yaw parameter59float orient_cos_yaw = 0.0f;60float orient_sin_yaw = 1.0f;6162// yaw correction methods63Vector3f correct_for_orient_yaw(const Vector3f &vector);6465AP_HAL::UARTDriver *uart;66};6768#endif // AP_BEACON_ENABLED697071