@@ -1929,7 +1929,7 @@ class MoveJoystick(MoveTank):
19291929 Used to control a pair of motors via a single joystick vector.
19301930 """
19311931
1932- def on (self , x , y , max_speed = 100.0 , radius = 100.0 ):
1932+ def on (self , x , y , radius = 100.0 ):
19331933 """
19341934 Convert x,y joystick coordinates to left/right motor speed percentages
19351935 and move the motors.
@@ -1944,13 +1944,9 @@ def on(self, x, y, max_speed=100.0, radius=100.0):
19441944 The X and Y coordinates of the joystick's position, with
19451945 (0,0) representing the center position. X is horizontal and Y is vertical.
19461946
1947- max_speed (default 100%):
1948- A percentage or other SpeedValue, controlling the maximum motor speed.
1949-
19501947 radius (default 100):
19511948 The radius of the joystick, controlling the range of the input (x, y) values.
19521949 e.g. if "x" and "y" can be between -1 and 1, radius should be set to "1".
1953-
19541950 """
19551951
19561952 # If joystick is in the middle stop the tank
@@ -1987,8 +1983,9 @@ def on(self, x, y, max_speed=100.0, radius=100.0):
19871983 # init_left_speed_percentage, init_right_speed_percentage,
19881984 # left_speed_percentage, right_speed_percentage))
19891985
1990- MoveTank .on (self , SpeedNativeUnits (left_speed_percentage / 100 * self .left_motor ._speed_native_units (max_speed )), SpeedNativeUnits (right_speed_percentage / 100 * self .right_motor ._speed_native_units (max_speed )))
1991-
1986+ MoveTank .on (self ,
1987+ SpeedPercent (left_speed_percentage ),
1988+ SpeedPercent (right_speed_percentage ))
19921989
19931990 @staticmethod
19941991 def angle_to_speed_percentage (angle ):
0 commit comments