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.