Skip to content

Commit ffb8a5f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e6af3a9 commit ffb8a5f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lerobot/common/robot_devices/motors/feetech.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@
127127

128128
def convert_ticks_to_degrees(ticks, model):
129129
resolutions = MODEL_RESOLUTION[model]
130-
# Convert the ticks to degrees
131-
return ticks * (360.0/resolutions)
130+
# Convert the ticks to degrees
131+
return ticks * (360.0 / resolutions)
132132

133133

134134
def convert_degrees_to_ticks(degrees, model):
135135
resolutions = MODEL_RESOLUTION[model]
136136
# Convert degrees to motor ticks
137-
return int(degrees * (resolutions/360.0))
137+
return int(degrees * (resolutions / 360.0))
138138

139139

140140
def adjusted_to_homing_ticks(
@@ -158,7 +158,7 @@ def adjusted_to_homing_ticks(
158158
drive_mode = 0
159159
if motorbus.calibration is not None:
160160
drive_mode = motorbus.calibration["drive_mode"][motor_id - 1]
161-
161+
162162
if drive_mode:
163163
ticks *= -1
164164

@@ -177,7 +177,7 @@ def adjusted_to_motor_ticks(
177177
drive_mode = 0
178178
if motorbus.calibration is not None:
179179
drive_mode = motorbus.calibration["drive_mode"][motor_id - 1]
180-
180+
181181
if drive_mode:
182182
adjusted_pos *= -1
183183

@@ -508,7 +508,6 @@ def revert_calibration(self, values: np.ndarray | list, motor_names: list[str] |
508508
values = np.round(values).astype(np.int32)
509509
return values
510510

511-
512511
def read_with_motor_ids(self, motor_models, motor_ids, data_name, num_retry=NUM_READ_RETRY):
513512
if self.mock:
514513
import tests.mock_scservo_sdk as scs
@@ -736,4 +735,3 @@ def disconnect(self):
736735
def __del__(self):
737736
if getattr(self, "is_connected", False):
738737
self.disconnect()
739-

lerobot/common/robot_devices/robots/feetech_calibration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def run_full_arm_calibration(arm: MotorsBus, robot_type: str, arm_name: str, arm
161161
print(f"\n calibration of {robot_type} {arm_name} {arm_type} done!")
162162

163163
# Force drive_mode values: motors 2 and 5 -> drive_mode 1; all others -> 0. 1 = clockwise = positive range (0..180), 0 = clockwise = negative range (0..-180)
164-
drive_modes = [0, 1, 0, 0, 1, 0]
164+
drive_modes = [0, 1, 0, 0, 1, 0]
165165

166166
calib_dict = {
167167
"homing_offset": encoder_offsets.astype(int).tolist(),

0 commit comments

Comments
 (0)