Skip to content

Slave library not adhering correctly to protocol 2.0 #151

@JustLuckyRobotics

Description

@JustLuckyRobotics

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions