예제 #1
0
def test_clip_min():
    expect(clip(-1)).to(equal(0))
예제 #2
0
def test_clip_max():
    expect(clip(101)).to(equal(100))
예제 #3
0
def test_unclipped():
    expect(clip(1)).to(equal(1))
예제 #4
0
 def forward_increase(self, turning=True):
     self.speed = clip(ForwardMotorCommands.increase_speed(self.speed, turning), -100)
예제 #5
0
 def reverse_decrease(self, turning=True):
     self.speed = clip(ReverseMotorCommands.decrease_speed(self.speed, turning), -100)
예제 #6
0
 def _set_speed(self, speed):
     speed = clip(abs(speed))
     self._speed_control.ChangeDutyCycle(speed)
     return speed