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_DAL/AP_DAL_Compass.h
Views: 1798
#pragma once12#include <AP_Logger/LogStructure.h>34#include <AP_Compass/AP_Compass.h>56class AP_DAL_Compass {7public:89// Compass-like methods:10bool use_for_yaw(uint8_t i) const {11return _RMGI[i].use_for_yaw;12}1314bool healthy(uint8_t i) const {15return _RMGI[i].healthy;16}1718const Vector3f &get_offsets(uint8_t i) const {19return _RMGI[i].offsets;20}2122bool have_scale_factor(uint8_t i) const {23return _RMGI[i].have_scale_factor;24}2526bool auto_declination_enabled() const {27return _RMGH.auto_declination_enabled;28}2930uint8_t get_count() const {31return _RMGH.count;32}3334float get_declination() const {35return _RMGH.declination;36}3738bool available() const {39return _RMGH.available;40}4142// return the number of enabled sensors43uint8_t get_num_enabled(void) const { return _RMGH.num_enabled; }4445// learn offsets accessor46bool learn_offsets_enabled() const { return _RMGH.learn_offsets_enabled; }4748// return last update time in microseconds49uint32_t last_update_usec(uint8_t i) const { return _RMGI[i].last_update_usec; }5051/// Return the current field as a Vector3f in milligauss52const Vector3f &get_field(uint8_t i) const { return _RMGI[i].field; }5354// check if the compasses are pointing in the same direction55bool consistent() const { return _RMGH.consistent; }5657// returns first usable compass58uint8_t get_first_usable() const { return _RMGH.first_usable; }5960// AP_DAL methods:61AP_DAL_Compass();6263void start_frame();6465void handle_message(const log_RMGH &msg) {66_RMGH = msg;67}68void handle_message(const log_RMGI &msg) {69_RMGI[msg.instance] = msg;70}7172private:7374struct log_RMGH _RMGH;75struct log_RMGI _RMGI[COMPASS_MAX_INSTANCES];76};777879