Beispiel #1
0
 def test_move_to_left_no_wait(self, motor : Motor) :
     position_before = 0
     position_target = -environment.MOTOR_STEPS * motor.microstep_resolution
     overshoot = False
     motor.move_to(position_target, False)
     while True :
         position = motor.position
         if overshoot is False :
             self.assertLessEqual(position, position_before)
         position_before = position
         velocity = motor.velocity
         if not motor.moving :
             break
         self.assertNotEqual(velocity, 0.0)
         if overshoot is False and velocity > 0.0 :
             overshoot = True
         if overshoot :
             self.assertGreater(velocity, 0.0)
         else :
             self.assertLess(velocity, 0.0)
     self.assertEqual(motor.position, position_target)
     self.__test_stopped(motor)
Beispiel #2
0
 def test_move_to_left(self, motor : Motor) :
     position_target = -environment.MOTOR_STEPS * motor.microstep_resolution
     motor.move_to(position_target)
     self.assertEqual(motor.position, position_target)
     self.__test_stopped(motor)