Add support for feetech protocol 1 to _split_into_byte_chunks
This commit is contained in:
@@ -5,7 +5,8 @@ import dynamixel_sdk as dxl
|
||||
import serial
|
||||
from mock_serial.mock_serial import MockSerial
|
||||
|
||||
from lerobot.common.motors.dynamixel import X_SERIES_CONTROL_TABLE, DynamixelMotorsBus
|
||||
from lerobot.common.motors.dynamixel import X_SERIES_CONTROL_TABLE
|
||||
from lerobot.common.motors.dynamixel.dynamixel import _split_into_byte_chunks
|
||||
|
||||
from .mock_serial_patch import WaitableStub
|
||||
|
||||
@@ -237,7 +238,7 @@ class MockInstructionPacket(MockDynamixelPacketv2):
|
||||
+2 is for the length bytes,
|
||||
+2 is for the CRC at the end.
|
||||
"""
|
||||
data = DynamixelMotorsBus._split_into_byte_chunks(value, data_length)
|
||||
data = _split_into_byte_chunks(value, data_length)
|
||||
params = [
|
||||
dxl.DXL_LOBYTE(start_address),
|
||||
dxl.DXL_HIBYTE(start_address),
|
||||
@@ -315,7 +316,7 @@ class MockInstructionPacket(MockDynamixelPacketv2):
|
||||
"""
|
||||
data = []
|
||||
for id_, value in ids_values.items():
|
||||
split_value = DynamixelMotorsBus._split_into_byte_chunks(value, data_length)
|
||||
split_value = _split_into_byte_chunks(value, data_length)
|
||||
data += [id_, *split_value]
|
||||
params = [
|
||||
dxl.DXL_LOBYTE(start_address),
|
||||
@@ -389,7 +390,7 @@ class MockStatusPacket(MockDynamixelPacketv2):
|
||||
Returns:
|
||||
bytes: The raw 'Present_Position' status packet ready to be sent through serial.
|
||||
"""
|
||||
params = DynamixelMotorsBus._split_into_byte_chunks(value, param_length)
|
||||
params = _split_into_byte_chunks(value, param_length)
|
||||
length = param_length + 4
|
||||
return cls.build(dxl_id, params=params, length=length)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user