19 #include <gtest/gtest.h> 22 #include <geographiclib_conversions/geodetic_conv.hpp> 27 TEST(IsaModel, diffPressureHpaMax){
28 Eigen::Vector3d gpsPosition(55.7544426, 48.742684, 0),
31 geodetic_converter::GeodeticConverter geodeticConverter;
32 geodeticConverter.initialiseReference(gpsPosition[0], gpsPosition[1], gpsPosition[2]);
33 geodeticConverter.enu2Geodetic(enuPosition[0], enuPosition[1], enuPosition[2],
34 &gpsPosition[0], &gpsPosition[1], &gpsPosition[2]);
35 double expectedDiffPressureHpa = 61.25;
37 float temperatureKelvin, absPressureHpa, diffPressureHpa;
39 temperatureKelvin, absPressureHpa, diffPressureHpa);
40 EXPECT_NEAR(diffPressureHpa, expectedDiffPressureHpa, 0.01);
42 TEST(IsaModel, diffPressureHpaZero){
43 Eigen::Vector3d gpsPosition(55.7544426, 48.742684, 0),
46 geodetic_converter::GeodeticConverter geodeticConverter;
47 geodeticConverter.initialiseReference(gpsPosition[0], gpsPosition[1], gpsPosition[2]);
48 geodeticConverter.enu2Geodetic(enuPosition[0], enuPosition[1], enuPosition[2],
49 &gpsPosition[0], &gpsPosition[1], &gpsPosition[2]);
50 double expectedDiffPressureHpa = 0;
52 float temperatureKelvin, absPressureHpa, diffPressureHpa;
54 temperatureKelvin, absPressureHpa, diffPressureHpa);
55 EXPECT_NEAR(diffPressureHpa, expectedDiffPressureHpa, 0.01);
57 TEST(IsaModel, diffPressureHpaMin){
58 Eigen::Vector3d gpsPosition(55.7544426, 48.742684, 0),
59 linVelNed(-100, 0, 0),
61 geodetic_converter::GeodeticConverter geodeticConverter;
62 geodeticConverter.initialiseReference(gpsPosition[0], gpsPosition[1], gpsPosition[2]);
63 geodeticConverter.enu2Geodetic(enuPosition[0], enuPosition[1], enuPosition[2],
64 &gpsPosition[0], &gpsPosition[1], &gpsPosition[2]);
65 double expectedDiffPressureHpa = 61.25;
67 float temperatureKelvin, absPressureHpa, diffPressureHpa;
69 temperatureKelvin, absPressureHpa, diffPressureHpa);
70 EXPECT_NEAR(diffPressureHpa, expectedDiffPressureHpa, 0.01);
74 int main(
int argc,
char *argv[]){
75 testing::InitGoogleTest(&argc, argv);
77 return RUN_ALL_TESTS();
int main(int argc, char *argv[])
void EstimateAtmosphere(const Eigen::Vector3d &gpsPosition, const Eigen::Vector3d &linVelNed, float &temperatureKelvin, float &absPressureHpa, float &diffPressureHpa)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
TEST(IsaModel, diffPressureHpaMax)