Quote:
Originally Posted by gnunes
While many would have ideas, I would most appreciate hearing from actual NI employees and similarly knowledgeable folks.
|
Your dashboard sends UDP packets every 20 milliseconds. Your UDP receive loop on the robot will wait 20 milliseconds between checking for new packets. This is a recipe for slowly degrading performance, as slight timing discrepancies will cause packets to be produced slightly faster than the robot will consume them.
This might not be the only thing that is causing issues with your code, but it is an obvious one that jumped out at me quickly. Remove the 20 ms delay in the UDP receive loop, and let the UDP receive function itself control the loop execution rate. By the way, there's no need for such a short timeout on the UDP receive. The default of 25 seconds would be fine.