mirror of
https://github.com/Team4388/Robot-Essentials.git
synced 2026-06-08 16:28:02 -06:00
add diagonostic for swevedrive
This commit is contained in:
@@ -21,6 +21,7 @@ import frc4388.utility.RobotGyro;
|
|||||||
import frc4388.utility.RobotUnits;
|
import frc4388.utility.RobotUnits;
|
||||||
import frc4388.utility.Status;
|
import frc4388.utility.Status;
|
||||||
import frc4388.utility.Subsystem;
|
import frc4388.utility.Subsystem;
|
||||||
|
import frc4388.utility.Status.Report;
|
||||||
import frc4388.utility.Status.ReportLevel;
|
import frc4388.utility.Status.ReportLevel;
|
||||||
|
|
||||||
public class SwerveDrive extends Subsystem {
|
public class SwerveDrive extends Subsystem {
|
||||||
@@ -329,26 +330,31 @@ public class SwerveDrive extends Subsystem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSubsystemName() {
|
public String getSubsystemName() {
|
||||||
return "Swerve Drive Controller";
|
return "Swerve Drive Controller";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status queryStatus() {
|
public Status queryStatus() {
|
||||||
Status status = new Status();
|
Status status = new Status();
|
||||||
|
|
||||||
status.addReport(ReportLevel.INFO, "Gyro Angle: " + this.gyro.getAngle());
|
status.addReport(ReportLevel.INFO, "Gyro Angle: " + this.gyro.getAngle());
|
||||||
status.addReport(ReportLevel.INFO, "Shift State: " + this.speedAdjust);
|
status.addReport(ReportLevel.INFO, "Shift State: " + this.speedAdjust);
|
||||||
//TODO: Add more status things
|
//TODO: Add more status things
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
Log("Diagnostic info for this has not been inplemented!"); //TODO
|
Status status = new Status();
|
||||||
return new Status();
|
for (SwerveModule module : modules) {
|
||||||
|
for (Report moduleDignostic : module.diagnosticStatus().reports) {
|
||||||
|
status.addReport(moduleDignostic.reportLevel, "[" + module.getSubsystemName() + "] " + moduleDignostic.description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
status.diagnoseHardwareCTRE("Swerve Gyro", gyro.getPigeon());
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user