mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-17 06:51:48 +00:00
Merge branch 'main' into feat/accelerate-melt-gpus
This commit is contained in:
@@ -270,8 +270,15 @@ class HomunculusArm(Teleoperator):
|
|||||||
raw_values = None
|
raw_values = None
|
||||||
with self.serial_lock:
|
with self.serial_lock:
|
||||||
if self.serial.in_waiting > 0:
|
if self.serial.in_waiting > 0:
|
||||||
self.serial.flush()
|
lines = []
|
||||||
raw_values = self.serial.readline().decode("utf-8").strip().split(" ")
|
while self.serial.in_waiting > 0:
|
||||||
|
line = self.serial.read_until().decode("utf-8").strip()
|
||||||
|
if line:
|
||||||
|
lines.append(line.split(" "))
|
||||||
|
|
||||||
|
if lines:
|
||||||
|
raw_values = lines[-1]
|
||||||
|
|
||||||
if raw_values is None or len(raw_values) != 21: # 16 raw + 5 angle values
|
if raw_values is None or len(raw_values) != 21: # 16 raw + 5 angle values
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -304,8 +304,15 @@ class HomunculusGlove(Teleoperator):
|
|||||||
positions = None
|
positions = None
|
||||||
with self.serial_lock:
|
with self.serial_lock:
|
||||||
if self.serial.in_waiting > 0:
|
if self.serial.in_waiting > 0:
|
||||||
self.serial.flush()
|
lines = []
|
||||||
positions = self.serial.readline().decode("utf-8").strip().split(" ")
|
while self.serial.in_waiting > 0:
|
||||||
|
line = self.serial.read_until().decode("utf-8").strip()
|
||||||
|
if line:
|
||||||
|
lines.append(line.split(" "))
|
||||||
|
|
||||||
|
if lines:
|
||||||
|
positions = lines[-1]
|
||||||
|
|
||||||
if positions is None or len(positions) != len(self.joints):
|
if positions is None or len(positions) != len(self.joints):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user