-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Within the 2.0 protocol and on all your servos you have a mandated return time delay (500us default), within the slave library it fails to adhere to this principal.
I assume it is because the library assumes users code will effectively inject delays > than this due to normal running, however if you try to minimise latency and have the library poll fast enough or use interrupts, the library can reply fast enough to clash on the bus as the master still has ownership of the line by driving DIR high on its side.
Its a simple remedy by adding a delayMicroseconds(500); in the txStatusPacket() here:
if(err == DXL_LIB_OK){
delayMicroseconds(500);
p_port_->write(info_tx_packet_.p_packet_buf, info_tx_packet_.generated_packet_length);
ret = true;
}
fixes the issue and makes the library more performant and adheres to the protocol correctly. It shouldn't impact those who aren't seeking low latency as a 0.5ms added delay is nothing.