From 36f2b4087db63ffb0751f3ae03b7e16c4a4eead3 Mon Sep 17 00:00:00 2001 From: Arnav495 Date: Thu, 25 Sep 2025 15:55:32 -0700 Subject: [PATCH] Fix command. --- .../frc/robot/commands/vision/ShutdownOrangePi.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java b/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java index c9078ca..97b2c67 100644 --- a/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java +++ b/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java @@ -90,8 +90,14 @@ public class ShutdownOrangePi extends Command { if (this.process.isAlive()) this.process.destroy(); // end the process if we've been interrupted - int exitValue = this.process.exitValue(); - if (exitValue != 0) // abnormal termination - System.out.println("OrangePi shutdown failed with exit code " + exitValue + "."); + if (interrupted) { + this.process.destroy(); // end the process if we've been interrupted + } else { + int exitValue = this.process.exitValue(); + if (exitValue != 0) // abnormal termination + System.out.println("OrangePi shutdown failed with exit code " + exitValue + "."); + else + System.out.println("OrangePi shutdown succesful."); + } } } -- 2.39.5