comparison src/Tests/compass_test.cpp @ 285:cd2320cd6f9a

NEW unit tests for gas volumes...
author jdg@air
date Fri, 29 May 2015 01:25:45 +0200
parents 7d9edd3b8c86
children
comparison
equal deleted inserted replaced
284:d1117b99fd99 285:cd2320cd6f9a
54 float r2 = sqr(compass_CX_f/32768.0f - cx) 54 float r2 = sqr(compass_CX_f/32768.0f - cx)
55 + sqr(compass_CY_f/32768.0f - cy) 55 + sqr(compass_CY_f/32768.0f - cy)
56 + sqr(compass_CZ_f/32768.0f - cz); 56 + sqr(compass_CZ_f/32768.0f - cz);
57 57
58 // Calibration error less than 2 bits: 58 // Calibration error less than 2 bits:
59 EXPECT_NEAR(0, sqrtf(r2), 3.0f/32768.0f) 59 EXPECT_NEAR(0, sqrtf(r2), 4.0f/32768.0f)
60 << "Center at (" << compass_CX_f/32768.0f << ", " 60 << "Center at (" << compass_CX_f/32768.0f << ", "
61 << compass_CY_f/32768.0f << ", " 61 << compass_CY_f/32768.0f << ", "
62 << compass_CZ_f/32768.0f << ")." 62 << compass_CZ_f/32768.0f << ")."
63 << " Error = " << sqrtf(r2); 63 << " Error = " << sqrtf(r2);
64 } 64 }