Interbotix / HROS1-Framework

HR-OS1 Framework, based on the Darwin-OP project. Intended for use on HR-OS1 Humanoid Robot platforms.
http://www.trossenrobotics.com/HR-OS1
GNU General Public License v3.0
54 stars 40 forks source link

Improve Arbotix-pro talking to Odroid and RPI2 #13

Closed KurtE closed 8 years ago

KurtE commented 9 years ago

I was running into lots of messages failing. Example dxl_monitor scan would fail reasonably often, likewise id command or wr command... Likewise PS3_Demo would fail to startup maybe half the time.

This modificiation is to add a call to tcdrain which waits until the transmit buffer is empty, before it sets the packet timeout. This appears to resolve most/all of the failures I was seeing.

Note: This may not remove all of the latency issues, but at least if there are delays on sending out the packet the code will wait for this before trying to get a response.

shihuiguo commented 8 years ago

Hi KurtE,

I tried this pull request on my RP2, and found that it fixed most latency issues when setting the IDs. But when writing to the register 30 to control the rotation of the servos, it still fails to write from time to time. So still a bit buggy here.