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_ExternalAHRS/AP_ExternalAHRS_MicroStrain5.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.5This program is distributed in the hope that it will be useful,6but WITHOUT ANY WARRANTY; without even the implied warranty of7MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the8GNU General Public License for more details.9You should have received a copy of the GNU General Public License10along with this program. If not, see <http://www.gnu.org/licenses/>.11*/12/*13support for MicroStrain CX5/GX5-45 serially connected AHRS Systems14*/1516#pragma once1718#include "AP_ExternalAHRS_config.h"1920#if AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED2122#include "AP_ExternalAHRS_backend.h"23#include <AP_GPS/AP_GPS.h>24#include <AP_HAL/AP_HAL.h>25#include "MicroStrain_common.h"2627class AP_ExternalAHRS_MicroStrain5: public AP_ExternalAHRS_backend, public AP_MicroStrain28{29public:3031AP_ExternalAHRS_MicroStrain5(AP_ExternalAHRS *frontend, AP_ExternalAHRS::state_t &state);3233// get serial port number, -1 for not enabled34int8_t get_port(void) const override;3536// Get model/type name37const char* get_name() const override;3839// accessors for AP_AHRS40bool healthy(void) const override;41bool initialised(void) const override;42bool pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const override;43void get_filter_status(nav_filter_status &status) const override;44bool get_variances(float &velVar, float &posVar, float &hgtVar, Vector3f &magVar, float &tasVar) const override;4546// check for new data47void update() override {48build_packet();49};5051protected:5253uint8_t num_gps_sensors(void) const override {54return 1;55}5657private:5859uint32_t baudrate;60int8_t port_num;61bool port_open = false;62636465void build_packet();6667void post_imu() const;68void post_gnss() const;69void post_filter() const;7071void update_thread();7273AP_HAL::UARTDriver *uart;74HAL_Semaphore sem;7576};7778#endif // AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED798081