示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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
        )
示例#4
0
    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
        )