This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/tests/geo/TestEarth.cpp
kazu c0cef979bb added helper methods for debug printing
fixed issue when reading wifi entries within old walk files
worked on earth-registration
added corresponding test-cases
other minor changes
2017-03-24 10:07:08 +01:00

51 lines
1016 B
C++

#ifdef WITH_TESTS
#include "../Tests.h"
#include "../../geo/EarthMapping.h"
TEST(Earth, fordwardBackward) {
const Point3 mapCenter(20, 30, 10);
const EarthPos earthCenter(50, 10, 100);
// earth-mapping including rotation
EarthMapping em(mapCenter, earthCenter, 40);
// as-is
const Point3 p1 = em.worldToMap( earthCenter );
ASSERT_EQ(mapCenter.x, p1.x);
ASSERT_EQ(mapCenter.y, p1.y);
ASSERT_EQ(mapCenter.z, p1.z);
// as-is
const EarthPos ep1 = em.mapToWorld( mapCenter );
ASSERT_EQ(earthCenter.lat, ep1.lat);
ASSERT_EQ(earthCenter.lon, ep1.lon);
ASSERT_EQ(earthCenter.height, ep1.height);
// + 20 height
const Point3 p2 = em.worldToMap( EarthPos(50,10,120) );
ASSERT_EQ(mapCenter.x, p2.x);
ASSERT_EQ(mapCenter.y, p2.y);
ASSERT_EQ(30, p2.z);
// - 20 height
const EarthPos ep2 = em.mapToWorld( Point3(20, 30, -10) );
ASSERT_EQ(earthCenter.lat, ep2.lat);
ASSERT_EQ(earthCenter.lon, ep2.lon);
ASSERT_EQ(earthCenter.height-20, ep2.height);
}
TEST(Earth, estimateNorth) {
}
#endif