Skip to content

Commit 897bfe5

Browse files
committed
post-merge fix
1 parent 74c9ee5 commit 897bfe5

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

lerobot/common/motors/feetech/feetech.py

-37
Original file line numberDiff line numberDiff line change
@@ -508,43 +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-
def avoid_rotation_reset(self, values, motor_names, data_name):
512-
if data_name not in self.track_positions:
513-
self.track_positions[data_name] = {
514-
"prev": [None] * len(self.motor_names),
515-
# Assume False at initialization
516-
"below_zero": [False] * len(self.motor_names),
517-
"above_max": [False] * len(self.motor_names),
518-
}
519-
520-
track = self.track_positions[data_name]
521-
522-
if motor_names is None:
523-
motor_names = self.motor_names
524-
525-
for i, name in enumerate(motor_names):
526-
idx = self.motor_names.index(name)
527-
528-
if track["prev"][idx] is None:
529-
track["prev"][idx] = values[i]
530-
continue
531-
532-
# Detect a full rotation occurred
533-
if abs(track["prev"][idx] - values[i]) > 2048:
534-
# Position went below 0 and got reset to 4095
535-
if track["prev"][idx] < values[i]:
536-
# So we set negative value by adding a full rotation
537-
values[i] -= 4096
538-
539-
# Position went above 4095 and got reset to 0
540-
elif track["prev"][idx] > values[i]:
541-
# So we add a full rotation
542-
values[i] += 4096
543-
544-
track["prev"][idx] = values[i]
545-
546-
return values
547-
548511
def read_with_motor_ids(self, motor_models, motor_ids, data_name, num_retry=NUM_READ_RETRY):
549512
if self.mock:
550513
import tests.mock_scservo_sdk as scs

lerobot/common/teleoperators/so100/teleop_so100.py

-5
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ def connect(self) -> None:
8686
self.arm.write("Torque_Enable", TorqueMode.DISABLED.value)
8787
self.calibrate()
8888

89-
# Enable torque on the gripper and move it to 45 degrees so that we can use it as a trigger.
90-
logging.info("Activating torque.")
91-
self.arm.write("Torque_Enable", TorqueMode.ENABLED.value, "gripper")
92-
self.arm.write("Goal_Position", self.config.gripper_open_degree, "gripper")
93-
9489
# Check arm can be read
9590
self.arm.read("Present_Position")
9691

0 commit comments

Comments
 (0)