40 Pitot(std::function<
float()> getTotalPressure,
41 std::function<
float()> getStaticPressure)
42 : getTotalPressure(getTotalPressure),
43 getStaticPressure(getStaticPressure)
47 bool init()
override {
return true; }
53 this->reference = reference;
61 float totalPressure = getTotalPressure();
62 float staticPressure = getStaticPressure();
64 if (totalPressure > 0 && staticPressure > 0 &&
65 totalPressure > staticPressure)
71 pitotSpeed.deltaP = totalPressure - staticPressure;
75 pitotSpeed.airspeed = 0;
76 pitotSpeed.deltaP = 0;
84 std::function<float()> getTotalPressure;
85 std::function<float()> getStaticPressure;
void setReferenceValues(const ReferenceValues reference)
bool init() override
Initialize the sensor.
ReferenceValues getReferenceValues()
bool selfTest() override
Check if the sensor is working.
PitotData sampleImpl() override
Read a data sample from the sensor. In case of errors, the method should return the last available co...
Pitot(std::function< float()> getTotalPressure, std::function< float()> getStaticPressure)
Base sensor class with has to be extended by any sensor driver.
float computePitotAirspeed(float pressureTotal, float pressureStatic, float d, float t0)
Computes air speed relative to the pitot tube.
uint64_t getTimestamp()
Returns the current timer value in microseconds.
This file includes all the types the logdecoder script will decode.
Reference values for the Apogee Detection Algorithm.