@@ -26,7 +26,7 @@ def get_default_differential_drive(cls):
26
26
27
27
return cls ._DEFAULT_DIFFERENTIAL_DRIVE_INSTANCE
28
28
29
- def __init__ (self , left_motor : EncodedMotor , right_motor : EncodedMotor , imu : IMU | None = None , wheel_diam :float = 6.0 , wheel_track :float = 13 .5 ):
29
+ def __init__ (self , left_motor : EncodedMotor , right_motor : EncodedMotor , imu : IMU | None = None , wheel_diam :float = 6.0 , wheel_track :float = 15 .5 ):
30
30
"""
31
31
A Differential Drive class designed for the XRP two-wheeled drive robot.
32
32
@@ -36,9 +36,9 @@ def __init__(self, left_motor: EncodedMotor, right_motor: EncodedMotor, imu: IMU
36
36
:type rightMotor: EncodedMotor
37
37
:param imu: The IMU of the robot. If None, the robot will not use the IMU for turning or maintaining heading.
38
38
:type imu: IMU
39
- :param wheelDiam: The diameter of the wheels in inches. Defaults to 6 inches .
39
+ :param wheelDiam: The diameter of the wheels in inches. Defaults to 6 cm .
40
40
:type wheelDiam: float
41
- :param wheelTrack: The distance between the wheels in inches. Defaults to 13 .5 inches .
41
+ :param wheelTrack: The distance between the wheels in inches. Defaults to 15 .5 cm .
42
42
:type wheelTrack: float
43
43
"""
44
44
@@ -110,12 +110,12 @@ def get_right_encoder_position(self) -> float:
110
110
def straight (self , distance : float , max_effort : float = 0.5 , timeout : float = None , main_controller : Controller = None , secondary_controller : Controller = None ) -> bool :
111
111
"""
112
112
Go forward the specified distance in centimeters, and exit function when distance has been reached.
113
- Speed is bounded from -1 (reverse at full speed) to 1 (forward at full speed)
113
+ Max_effort is bounded from -1 (reverse at full speed) to 1 (forward at full speed)
114
114
115
115
:param distance: The distance for the robot to travel (In Centimeters)
116
116
:type distance: float
117
- :param speed : The speed for which the robot to travel (Bounded from -1 to 1). Default is half speed forward
118
- :type speed : float
117
+ :param max_effort : The max effort for which the robot to travel (Bounded from -1 to 1). Default is half effort forward
118
+ :type max_effort : float
119
119
:param timeout: The amount of time before the robot stops trying to move forward and continues to the next step (In Seconds)
120
120
:type timeout: float
121
121
:param main_controller: The main controller, for handling the distance driven forwards
@@ -125,8 +125,8 @@ def straight(self, distance: float, max_effort: float = 0.5, timeout: float = No
125
125
:return: if the distance was reached before the timeout
126
126
:rtype: bool
127
127
"""
128
- # ensure distance is always positive while speed could be either positive or negative
129
- if distance < 0 :
128
+ # ensure effort is always positive while distance could be either positive or negative
129
+ if max_effort < 0 :
130
130
max_effort *= - 1
131
131
distance *= - 1
132
132
@@ -199,8 +199,8 @@ def turn(self, turn_degrees: float, max_effort: float = 0.5, timeout: float = No
199
199
200
200
:param turnDegrees: The number of angle for the robot to turn (In Degrees)
201
201
:type turnDegrees: float
202
- :param speed : The speed for which the robot to travel (Bounded from -1 to 1). Default is half speed forward.
203
- :type speed : float
202
+ :param max_effort : The max effort for which the robot to travel (Bounded from -1 to 1). Default is half effort forward.
203
+ :type max_effort : float
204
204
:param timeout: The amount of time before the robot stops trying to turn and continues to the next step (In Seconds)
205
205
:type timeout: float
206
206
:param main_controller: The main controller, for handling the angle turned
0 commit comments