Skip to content

Commit 111622b

Browse files
Update backend.py
1 parent 001a05c commit 111622b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/reachy_mini/daemon/backend/robot/backend.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,16 +514,16 @@ def decode_hardware_error_byte(err_byte: int) -> list[str]:
514514
return [bits_to_error[b] for b in err_bits if b in bits_to_error]
515515

516516
def check_voltage(
517-
id,
517+
id: int,
518518
allowed_max_voltage: float = 7.3,
519519
) -> bool:
520520
assert self.c is not None, (
521521
"Motor controller not initialized or already closed."
522522
)
523523
# https://emanual.robotis.com/docs/en/dxl/x/xl330-m288/#present-input-voltage
524524
resp_bytes = self.c.async_read_raw_bytes(id, 144, 2)
525-
voltage = struct.unpack("h", bytes(resp_bytes))
526-
voltage = voltage[0] / 10.0 # in Volts
525+
resp = struct.unpack("h", bytes(resp_bytes))[0]
526+
voltage: float = resp / 10.0 # in Volts
527527

528528
return voltage > allowed_max_voltage
529529

0 commit comments

Comments
 (0)