Skip to content

Commit e887770

Browse files
committed
feat: Add dummy data entry and enhance read/write type checks in Dynamixel class
1 parent a2c2eeb commit e887770

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

param/dxl_model/ffw_g10_led.model

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Address Size Data Name
2020
104 1 Neopixel_Head_Left_Mode
2121
105 2 Neopixel_Head_Left_Control_Time
2222
107 1 Neopixel_Head_Left_Led_Count
23+
108 2 Dummy_1
2324
110 1 Neopixel_Head_Right_Red
2425
111 1 Neopixel_Head_Right_Green
2526
112 1 Neopixel_Head_Right_Blue

src/dynamixel/dynamixel.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,12 @@ DxlError Dynamixel::WriteMultiDxlData()
864864

865865
bool Dynamixel::checkReadType()
866866
{
867+
if (read_data_list_.size() == 1){
868+
if (CheckIndirectReadAvailable(read_data_list_.at(0).comm_id) != DxlError::OK) {
869+
return BULK;
870+
}
871+
}
872+
867873
for (size_t dxl_index = 1; dxl_index < read_data_list_.size(); dxl_index++) {
868874
// Check if Indirect Data Read address and size are different
869875
uint16_t indirect_addr[2]; // [i-1], [i]
@@ -910,6 +916,12 @@ bool Dynamixel::checkReadType()
910916

911917
bool Dynamixel::checkWriteType()
912918
{
919+
if (write_data_list_.size() == 1){
920+
if (CheckIndirectWriteAvailable(write_data_list_.at(0).comm_id) != DxlError::OK) {
921+
return BULK;
922+
}
923+
}
924+
913925
for (size_t dxl_index = 1; dxl_index < write_data_list_.size(); dxl_index++) {
914926
// Check if Indirect Data Write address and size are different
915927
uint16_t indirect_addr[2]; // [i-1], [i]

0 commit comments

Comments
 (0)