-
Notifications
You must be signed in to change notification settings - Fork 109
Add operation to save image snapshots to local disk. #573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The period and path prefix and suffix can be set, and the operation enabled and disabled at will (this is particularly useful in combination with PR #572).
Current coverage is 53.49%
@@ master #573 diff @@
=====================================
Files 158 159 +1
Lines 4699 4776 +77
Methods 0 0
Branches 500 507 +7
=====================================
+ Hits 2522 2555 +33
- Misses 2037 2077 +40
- Partials 140 144 +4
|
| suffix = this.suffix; | ||
| } | ||
| } catch (InterruptedException e) { | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to reset the interrupt flag here.
Thread.interrupt()
|
Thanks for this. This is not something I thought people would want. I like the idea though. |
| private final BytePointer imagePointer = new BytePointer(); | ||
| private Optional<Thread> saveThread = Optional.empty(); | ||
| private volatile boolean connected = false; | ||
| private long startTime = System.nanoTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guava has the stopwatch that may be more apropreate here. Up to you though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this even needs to be timed; it'll only run when the pipeline gets fired anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's nice to not necessarily save every frame all the time. For example, my team saves images twice a second during a match but switches to saving every image when actually auto-aiming.
|
This is very useful for testing and debugging at competition where you don't have realtime access because you can load up the saved images to play them back through the pipeline and adjust thresholds etc. I'll fix up based on the comments so far. |
|
I'm debating adding a directory chooser for the output directory instead of or in addition to the prefix. However, I'm not sure if adding those sorts of controls is frowned upon in operations. |
|
No, a directory chooser would be a good control to add. |
The period and path prefix and suffix can be set, and the operation enabled
and disabled at will (this is particularly useful in combination with PR #572).