View Single Post
  #12   Spotlight this post!  
Unread 12-28-2012, 11:53 AM
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: TCP Listening in C++ -- BUG in WPILib

We used UDP on the 'bot last season for communicating from Arduinos to the cRIO. The one thing that we found is that the WPILib has issues with unread UDP packets. Evidently, the WPILib is always monitoring and hooking UDP traffic (it may do something similar with TCP traffic) so that rather than dropping a packet on the floor as it should, WPILib tries to buffer everything. I can see why they want to do this (in case things start to fall behind, you don't want important control packets dropped), but it's against what UDP was built to do. Nonetheless, if you don't service the UDP packets (say, it's a periodic transmission from your RPM sensor), they eventually cause the whole robot to lock up when the internal WPILib buffers overflow. This is clearly a bug in WPILib. However, you can get around it by always reading the UDP socket and tossing the packet away in your teleop disabled routine.

Good Luck,

Mike
Reply With Quote