View Single Post
  #2   Spotlight this post!  
Unread 23-02-2016, 22:45
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: How to pause GRIP data input?

This feature hasn't been documented yet, but yes, you can pause GRIP using NetworkTables if you're using the very latest release candidate (v1.3-rc1).


Code:
NetworkTable table = NetworkTable.getTable("GRIP");

table.putBoolean("run", false); // Stop GRIP without killing the process

doSomeStuffThatDoesntNeedVision();

table.putBoolean("run", true); // Start GRIP again
This should work if you just want to process a "snapshot" of the input, but keep in mind that there's always a little latency with NetworkTables updates, so you can't precisely control when GRIP starts and stops.

Quote:
This doesn't work because the smaller contours fluctuate a lot and the position of the goal/largest contour changes from the first time we get the data (area) to the second time we get the data (centerX, or height).
The latest NetworkTables protocol supports RPC "transactions", which should help fix this, but currently there's still work to be done in bringing support for this feature to the Java bindings.
__________________
GRIP (Graphically Represented Image Processing) - rapidly develop computer vision algorithms for FRC