File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
photon-core/src/main/java/org/photonvision/vision/pipeline Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2323import java .util .concurrent .atomic .AtomicBoolean ;
2424import org .opencv .core .Mat ;
2525import org .opencv .imgcodecs .Imgcodecs ;
26+ import org .photonvision .common .hardware .HardwareManager ;
2627import org .photonvision .common .logging .LogGroup ;
2728import org .photonvision .common .logging .Logger ;
2829import org .photonvision .vision .opencv .CVMat ;
@@ -67,6 +68,17 @@ static RecordFrame poison() {
6768 public FrameRecorder (Path outputPath , RecordingStrategy strat ) {
6869 this .logger = new Logger (FrameRecorder .class , LogGroup .VisionModule );
6970
71+ double availableSpace = HardwareManager .getInstance ().metricsManager .getDiskSpaceAvailable ();
72+
73+ // Check if we're under 4 GB of available space, if so exit
74+ if (availableSpace < 4 * 1024 * 1024 ) {
75+ logger .error (
76+ "Low disk space available ("
77+ + availableSpace / 1024
78+ + " MB). FrameRecorder will not start." );
79+ throw new IllegalStateException ("Insufficient disk space for FrameRecorder" );
80+ }
81+
7082 logger .info ("Initializing FrameRecorder with output path: " + outputPath .toString ());
7183 this .outputPath = outputPath ;
7284
You can’t perform that action at this time.
0 commit comments