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_Airspeed/AP_Airspeed_External.h
Views: 1798
1
/*
2
external AHRS airspeed backend
3
*/
4
#pragma once
5
6
#include "AP_Airspeed_config.h"
7
8
#if AP_AIRSPEED_EXTERNAL_ENABLED
9
10
#include "AP_Airspeed_Backend.h"
11
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
12
13
class AP_Airspeed_External : public AP_Airspeed_Backend
14
{
15
public:
16
AP_Airspeed_External(AP_Airspeed &airspeed, uint8_t instance);
17
18
bool init(void) override {
19
return true;
20
}
21
22
void handle_external(const AP_ExternalAHRS::airspeed_data_message_t &pkt) override;
23
24
// return the current differential_pressure in Pascal
25
bool get_differential_pressure(float &pressure) override;
26
27
// temperature not available via analog backend
28
bool get_temperature(float &temperature) override;
29
30
private:
31
float sum_pressure;
32
uint8_t press_count;
33
float sum_temperature;
34
uint8_t temperature_count;
35
};
36
37
#endif // AP_AIRSPEED_EXTERNAL_ENABLED
38
39
40