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_Baro/AP_Baro_MSP.h
Views: 1798
1
/*
2
MSP backend barometer
3
*/
4
#pragma once
5
6
#include "AP_Baro_Backend.h"
7
8
// AP_BARO_MSP_ENABLED is defined in AP_Baro.h
9
10
#if AP_BARO_MSP_ENABLED
11
12
#define MOVING_AVERAGE_WEIGHT 0.20f // a 5 samples moving average
13
14
class AP_Baro_MSP : public AP_Baro_Backend
15
{
16
public:
17
AP_Baro_MSP(AP_Baro &baro, uint8_t msp_instance);
18
void update(void) override;
19
void handle_msp(const MSP::msp_baro_data_message_t &pkt) override;
20
21
private:
22
uint8_t instance;
23
uint8_t msp_instance;
24
float sum_pressure;
25
float sum_temp;
26
uint16_t count;
27
};
28
29
#endif // AP_BARO_MSP_ENABLED
30
31