Closed v-r-a closed 1 year ago
Found my mistake:
The packet building happens in dxl.syncWrite()
step.
All all_info_xels_sw[i].p_data
were pointing to myswdata
which was getting overwritten! There is no memcopy happening here.
Sorted by the following redefinitions:
uint8_t myswdata[NMOTOR][SW_ADDR_LEN];
myswdata[i][0] = DXL_LOBYTE(home_pos_list[i]); // low byte
myswdata[i][1] = DXL_HIBYTE(home_pos_list[i]); // high byte
myswdata[i][2] = DXL_LOBYTE(home_vel_list[i]); // low byte
myswdata[i][3] = DXL_HIBYTE(home_vel_list[i]); // high byte
all_info_xels_sw[i].p_data = myswdata[i];
Hello,
I am trying to synchronously write to 12 motors at a time using Dynamixel Arduino Shield on Arduino Uno. I am using a separate usb2serial converter to read data on PC.
I want to write Goal Position as well as Moving Speed to all the motors. (Starting address 30, data length 4 bytes).
I am getting the wrong robot pose. I have previously tested similar (the only difference is in the library functions of Dynamixel SDK vs Dynamixel2Arduino) code using Dynamixel SDK in C++ language using USB2Dynamixel. It worked perfectly fine.
Something is going wrong while defining the sync write packet. Also, there is no example of sync write with multiple sequential control table items written together, e.g., cw compliance slope + ccw compliance slope + goal position + moving speed.
Kindly help me debug the sync write part of the code:
Also, can you elaborate on when to update the following structure elements?