1 from __future__
import absolute_import, division
3 from .coordConvLib
import wrapCtr
6 """Assert that two PVTs are almost equal
8 @param[in] pvt1 first coordConv.PVT
9 @param[in] pvt2 second coordConv.PVT
10 @param[in] doWrap if True then wrap position difference to [-180, 180] before comparing
11 (ignored for velocity and time comparison).
12 @param[in] posPlaces number of decimal places for position difference
13 @param[in] velPlaces number of decimal places for velocity difference
14 @param[in] tPlaces number of decimal places for time difference
16 For the places arguments the associated value must be less than 10^-places
18 if abs(pvt1.t - pvt2.t) > 10.0**-tPlaces:
19 raise AssertionError(
"%s.t != %s.t to within %s places" % (pvt1, pvt2, tPlaces))
20 if abs(pvt1.vel - pvt2.vel) > 10.0**-velPlaces:
21 raise AssertionError(
"%s.vel != %s.vel to within %s places" % (pvt1, pvt2, velPlaces))
23 if abs(
wrapCtr(pvt1.pos - pvt2.pos)) > 10.0**-posPlaces:
24 raise AssertionError(
"%s.pos != %s.pos to within %s places (wrapped)" % (pvt1, pvt2, posPlaces))
26 if abs(pvt1.pos - pvt2.pos) > 10.0**-posPlaces:
27 raise AssertionError(
"%s.pos != %s.pos to within %s places" % (pvt1, pvt2, posPlaces))
30 """Assert that two PVTs are almost equal
32 @param[in] angle1 first angle
33 @param[in] angle second angle
34 @param[in] places number of decimal places for position difference
35 @throw AssertionError if abs(angle1 - angle2) > 10.0**-places
37 if abs(
wrapCtr(angle1 - angle2)) > 10.0**-places:
38 raise AssertionError(
"%r != %r to within %s places (wrapped)" % (angle1, angle2, places))
double wrapCtr(double ang)
def assertAnglesAlmostEqual
def assertPVTsAlmostEqual