View Single Post
  #2   Spotlight this post!  
Unread 02-24-2016, 04:35 PM
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: GRIP, Network Tables, and mutual exclusion

NetworkTables guarantees individual reads and writes are atomic, so you should be good there.

It's possible that GRIP is writing, for example, the area array and the centerX array, and one in a while you happen to read both of them after only one has updated. In this case, the arrays could have different lengths, so you could get an error if you use the same loop counter for them.

The solution right now would be to check that the arrays have the same length, although in the future it would be good to support NetworkTables RPCs.

If you're only reading a single snapshot, you can also set "GRIP/run" to false and wait a little bit before reading anything.
__________________
GRIP (Graphically Represented Image Processing) - rapidly develop computer vision algorithms for FRC
Reply With Quote