29 #ifndef HECTOR_UAV_MSGS_ALTIMETER_PRESSURE_HEIGHT_H 30 #define HECTOR_UAV_MSGS_ALTIMETER_PRESSURE_HEIGHT_H 32 #include <hector_uav_msgs/Altimeter.h> 39 static inline Altimeter::_altitude_type
altitudeFromPressure(Altimeter::_pressure_type pressure, Altimeter::_qnh_type qnh = STANDARD_PRESSURE) {
40 return 288.15 / 0.0065 * (1.0 - pow(pressure / qnh, 1.0/5.255));
43 static inline Altimeter::_pressure_type
pressureFromAltitude(Altimeter::_altitude_type altitude, Altimeter::_qnh_type qnh = STANDARD_PRESSURE) {
44 return qnh * pow(1.0 - (0.0065 * altitude) / 288.15, 5.255);
61 #endif // HECTOR_UAV_MSGS_ALTIMETER_PRESSURE_HEIGHT_H static const Altimeter::_qnh_type STANDARD_PRESSURE
static Altimeter::_altitude_type altitudeFromPressure(Altimeter::_pressure_type pressure, Altimeter::_qnh_type qnh=STANDARD_PRESSURE)
static Altimeter::_pressure_type pressureFromAltitude(Altimeter::_altitude_type altitude, Altimeter::_qnh_type qnh=STANDARD_PRESSURE)