예제 #1
0
 def testForwardTwoMetres(self):
     d = DriveSystem(2)
     d.forward(2)
     self.assertEqual(d.get_position(), (0, 2))
     self.assertEqual(d.get_bearing(), 0)
예제 #2
0
 def testForwardHalfMetre(self):
     d = DriveSystem(2)
     d.forward(0.5)
     self.assertEqual(d.get_position(), (0,0.5))
     self.assertEqual(d.get_bearing(), 0)
예제 #3
0
 def test360DegreeTravel(self):
     d = DriveSystem(2)
     d.spin(360)
     d.forward(5)
     self.assertAlmostEqual(d.get_position()[0], 0)
     self.assertAlmostEqual(d.get_position()[1], 5)
예제 #4
0
 def testForwardOneMetre(self):
     d = DriveSystem(2)
     d.forward(1)
     self.assertEqual(d.get_position(), (0, 1))
     self.assertEqual(d.get_bearing(), 0)
예제 #5
0
 def test330DegreeTravel(self):
     d = DriveSystem(2)
     d.spin(330)
     d.forward(5)
     self.assertAlmostEqual(d.get_position()[0], -2.5)
     self.assertAlmostEqual(d.get_position()[1], 4.330127)