I use 2 Dynamixel XM540 in Slave/Master with python. I am in Curent-based Position control mode, and I can read and write values and move the motor as I want, but I can’t modify the value of Goal Current(102). The Current Limitation(38) is set to 100.
Here is the code I use to write for changing the Goal Current(102) :
#Set the Current limitation
dxl_comm_result, dxl_error = packetHandler.write1ByteTxRx(portHandler, DXL_ID, 102, 30)
if dxl_comm_result != COMM_SUCCESS:
print(“13 %s” % packetHandler.getTxRxResult(dxl_comm_result))
elif dxl_error != 0:
print(“14 %s” % packetHandler.getRxPacketError(dxl_error))
The code is running fine, but the current goal(102) isn’t modified and I get a dxl_error 5:
14 [RxPacketError] The data length does not match as expected!
It probably is a stupid error, but I couldn’t find anything helpful on internet and the error message isn’t very helpful, I tried other values for the goal current such as 0 or 1, but still the same.
Also probably worth saying that I can modify the goal current in dynamixel wizard.
Thanks for anyone willing to help me !