mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
Mira goofy test
This commit is contained in:
@@ -30,11 +30,15 @@ public class LED extends SubsystemBase implements Queryable {
|
||||
|
||||
private static Spark LEDController = new Spark(LEDConstants.LED_SPARK_ID);
|
||||
private LEDPatterns mode = LEDConstants.DEFAULT_PATTERN;
|
||||
//hello
|
||||
|
||||
public void setMode(LEDPatterns pattern){
|
||||
this.mode = pattern;
|
||||
}
|
||||
|
||||
public String getMode(){
|
||||
return mode.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
update();
|
||||
|
||||
@@ -2,15 +2,11 @@ package frc4388.robot.subsystems.vision;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.littletonrobotics.junction.AutoLogOutput;
|
||||
import org.littletonrobotics.junction.Logger;
|
||||
|
||||
import com.ctre.phoenix6.Utils;
|
||||
import com.ctre.phoenix6.hardware.CANcoder;
|
||||
import com.ctre.phoenix6.hardware.TalonFX;
|
||||
import com.ctre.phoenix6.swerve.SwerveDrivetrain;
|
||||
|
||||
import edu.wpi.first.math.geometry.Pose2d;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
@@ -18,20 +14,22 @@ import frc4388.robot.subsystems.vision.VisionIO.PoseObservation;
|
||||
import frc4388.utility.status.FaultReporter;
|
||||
import frc4388.utility.status.Queryable;
|
||||
import frc4388.utility.status.Status;
|
||||
import frc4388.utility.structs.LEDPatterns;
|
||||
|
||||
public class Vision extends SubsystemBase implements Queryable {
|
||||
public class Vision extends SubsystemBase implements Queryable{
|
||||
VisionIO[] io;
|
||||
VisionStateAutoLogged[] state;
|
||||
|
||||
|
||||
public Pose2d lastVisionPose = new Pose2d();
|
||||
public Pose2d lastPhysOdomPose = new Pose2d();
|
||||
public LED m_robotLED;
|
||||
|
||||
public Vision(VisionIO... devices) {
|
||||
FaultReporter.register(this);
|
||||
io = devices;
|
||||
state = new VisionStateAutoLogged[io.length];
|
||||
|
||||
m_robotLED = new LED();
|
||||
for(int i = 0; i < io.length; i++) {
|
||||
state[i] = new VisionStateAutoLogged();
|
||||
}
|
||||
@@ -44,6 +42,10 @@ public class Vision extends SubsystemBase implements Queryable {
|
||||
Logger.processInputs("Vision/Camera" + i , state[i]);
|
||||
}
|
||||
Logger.recordOutput("Vision/isTagDectected", isTag());
|
||||
|
||||
if (isTag()){
|
||||
m_robotLED.setMode(LEDPatterns.SOLID_GREEN_DARK);
|
||||
}
|
||||
}
|
||||
|
||||
public List<PoseObservation> getPosesToAdd(){
|
||||
@@ -93,4 +95,10 @@ public class Vision extends SubsystemBase implements Queryable {
|
||||
// throw new UnsupportedOperationException("Unimplemented method 'diagnosticStatus'");
|
||||
}
|
||||
|
||||
// Simple LED helper class for compilation and basic usage; replace with real implementation if available.
|
||||
private static class LED {
|
||||
public void setMode(LEDPatterns mode) {
|
||||
// no-op stub for compilation; integrate with hardware driver as needed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user