-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2384ff
commit d3fcf6b
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package frc.robot.util; | ||
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import org.littletonrobotics.junction.Logger; | ||
|
||
public abstract class GeneralUtil { | ||
public static void logSubsystem(SubsystemBase s, String sName) { | ||
String key = sName + "/command"; | ||
Logger.recordOutput( | ||
key, s.getCurrentCommand() != null ? s.getCurrentCommand().getName() : "none"); | ||
} | ||
|
||
public static void logFullSubsystem(SubsystemBase s, String sName) { | ||
sName += "/cmdInfo/"; | ||
Logger.recordOutput(sName + "hasDefault", s.getDefaultCommand() != null); | ||
Logger.recordOutput( | ||
sName + "default", | ||
s.getDefaultCommand() != null ? s.getDefaultCommand().getName() : "none"); | ||
Logger.recordOutput(sName + "hasCommand", s.getCurrentCommand() != null); | ||
Logger.recordOutput( | ||
sName + "command", | ||
s.getCurrentCommand() != null ? s.getCurrentCommand().getName() : "none"); | ||
} | ||
} |