Skip to content

Commit d24d473

Browse files
committed
Fix motor_group issues
1 parent 9054eac commit d24d473

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

XRPLib/motor_group.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def get_position_counts(self) -> int:
5353
"""
5454
avg = 0
5555
for motor in self.motors:
56-
avg += motor.get_position_ticks()
56+
avg += motor.get_position_counts()
5757
return round(avg / len(self.motors))
5858

5959
def reset_encoder_position(self):
@@ -74,7 +74,7 @@ def get_speed(self) -> float:
7474
return avg / len(self.motors)
7575

7676

77-
def set_target_speed(self, target_speed_rpm: float = None):
77+
def set_speed(self, target_speed_rpm: float = None):
7878
"""
7979
Sets target speed (in rpm) to be maintained passively by all motors in this group
8080
Call with no parameters to turn off speed control
@@ -83,7 +83,7 @@ def set_target_speed(self, target_speed_rpm: float = None):
8383
:type target_speed_rpm: float, or None
8484
"""
8585
for motor in self.motors:
86-
motor.set_target_speed(target_speed_rpm)
86+
motor.set_speed(target_speed_rpm)
8787

8888
def set_speed_controller(self, new_controller):
8989
"""

0 commit comments

Comments
 (0)