pioneers / runtime

Firmware for the PiE kit robots and devices
7 stars 2 forks source link

[TEST] Fixed latency bug #160

Closed DanielMolina24 closed 3 years ago

DanielMolina24 commented 3 years ago

Resolves #156. It seems that the bug can be tracked down to commit #8213292. A removal of a sleep(40000) inside the send_gamepad_state function of net_handler_cli was what caused the issue. Inside the test case, we send a gamepad state where button A is pressed and immediately follow with sending another gamepad state with button A unsent. I believe what may have happened was that perhaps it probably wasn't done processing the first gamepad_state received allowing for the virtual device to update its timestamp before the second gamepad state was received, or it received them out of order, which could explain why the test worked successfully like 1/20 times that I ran the test yesterday. I'm honestly not too sure if a bug like this can happen with real robots and gamepads/keyboards since this seemed more like a client issue. Either way this was an easy fix