File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
photon-core/src/main/java/org/photonvision/vision/processes Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -101,13 +101,17 @@ private void update() {
101
101
continue ;
102
102
}
103
103
104
- // There's no guarantee the processing type change will occur this tick, so pipelines should
105
- // check themselves
106
- try {
107
- var pipelineResult = pipeline .run (frame , cameraQuirks );
108
- pipelineResultConsumer .accept (pipelineResult );
109
- } catch (Exception ex ) {
110
- logger .error ("Exception on loop " + loopCount , ex );
104
+ // If the pipeline has changed while we are getting our frame we should scrap that frame it
105
+ // may result in incorrect frame settings like hsv values
106
+ if (pipeline == pipelineSupplier .get ()) {
107
+ // There's no guarantee the processing type change will occur this tick, so pipelines should
108
+ // check themselves
109
+ try {
110
+ var pipelineResult = pipeline .run (frame , cameraQuirks );
111
+ pipelineResultConsumer .accept (pipelineResult );
112
+ } catch (Exception ex ) {
113
+ logger .error ("Exception on loop " + loopCount , ex );
114
+ }
111
115
}
112
116
113
117
loopCount ++;
You can’t perform that action at this time.
0 commit comments