Skip to content

Commit

Permalink
[#520] - made some constants and orientation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeistHo committed Apr 4, 2024
1 parent 8d9b8aa commit 3cc479b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,13 @@ public class VisionConstants {
public static final Translation3d BLUE_SPEAKER_LOCATION = new Translation3d(0, 5.547593, 1.2);
public static final Translation3d RED_SPEAKER_LOCATION = new Translation3d(16.4592, 5.547593, 1.2);


public static class LimelightOrientation {
public static final double STOPME_YAW = 180d;
public static final double STOPME_PITCH = 55.5;
public static final double STOPME_ROLL = 0d;
}

public class Pipelines { // TODO get real
public static final int TAG_PIPELINE = 0;
public static final int SPEAKER_PIPELINE = 1;
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/frc/robot/subsystems/Limelights.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants.VisionConstants;
import frc.robot.Constants.VisionConstants.LimelightOrientation;
import frc.robot.Constants.VisionConstants.Pipelines;
import frc.thunder.util.Pose4d;
import frc.thunder.vision.Limelight;
Expand All @@ -28,6 +29,8 @@ public Limelights() {
dust.setPipeline(0);
champs.setPipeline(0);

setOrientations();

this.poseProducer = new Thread(() -> {
while (true) {
try {
Expand Down Expand Up @@ -97,5 +100,15 @@ public int getChampsPipeline() {

@Override
public void periodic() {
setOrientations();
}

public void setOrientations(){
stopMe.setRobotOrientation(LimelightOrientation.STOPME_YAW,0,
LimelightOrientation.STOPME_PITCH, 0,
LimelightOrientation.STOPME_ROLL, 0);

// champs.setRobotOrientation(0, 0, 0, 0, 0, 0);
}

}
2 changes: 1 addition & 1 deletion src/main/java/frc/thunder
Submodule thunder updated 1 files
+32 −1 vision/Limelight.java

0 comments on commit 3cc479b

Please sign in to comment.