def test_to_ypr(self): # ypr identity: (pi/2, 0, pi) ident_ypr = (math.pi / 2, 0, -math.pi) ident_ypr_float = [float(v) for v in ident_ypr] rot_d = Rotation('d') rot_f = Rotation('f') numpy.testing.assert_almost_equal(rot_d.yaw_pitch_roll(), ident_ypr) numpy.testing.assert_almost_equal(rot_f.yaw_pitch_roll(), ident_ypr)
def test_to_ypr(self): # ypr identity: (pi/2, 0, pi) ident_ypr = (math.pi / 2, 0, -math.pi) ident_ypr_float = [ctypes.c_float(v).value for v in ident_ypr] rot_d = Rotation(ctypes.c_double) rot_f = Rotation(ctypes.c_float) numpy.testing.assert_equal(rot_d.yaw_pitch_roll(), ident_ypr) numpy.testing.assert_equal(rot_f.yaw_pitch_roll(), ident_ypr_float)
def test_to_ypr(self): # ypr identity: (pi/2, 0, pi) ident_ypr = (math.pi / 2, 0, -math.pi) ident_ypr_float = [float(v) for v in ident_ypr] rot_d = Rotation('d') rot_f = Rotation('f') numpy.testing.assert_almost_equal( rot_d.yaw_pitch_roll(), ident_ypr ) numpy.testing.assert_almost_equal( rot_f.yaw_pitch_roll(), ident_ypr )
def test_to_ypr(self): # ypr identity: (pi/2, 0, pi) ident_ypr = (math.pi / 2, 0, -math.pi) ident_ypr_float = map(lambda v: ctypes.c_float(v).value, ident_ypr) rot_d = Rotation(ctypes.c_double) rot_f = Rotation(ctypes.c_float) numpy.testing.assert_equal( rot_d.yaw_pitch_roll(), ident_ypr ) numpy.testing.assert_equal( rot_f.yaw_pitch_roll(), ident_ypr_float )