working on vision

This commit is contained in:
Team 2648 2025-03-06 15:48:02 -05:00
parent 87c0772982
commit 05e9202592
3 changed files with 13 additions and 3 deletions

View File

@ -245,6 +245,7 @@ public class RobotContainer {
private void configureShuffleboard() { private void configureShuffleboard() {
ShuffleboardTab autoTab = Shuffleboard.getTab(OIConstants.kAutoTab); ShuffleboardTab autoTab = Shuffleboard.getTab(OIConstants.kAutoTab);
ShuffleboardTab sensorTab = Shuffleboard.getTab(OIConstants.kSensorsTab); ShuffleboardTab sensorTab = Shuffleboard.getTab(OIConstants.kSensorsTab);
ShuffleboardTab apriltagTab = Shuffleboard.getTab(OIConstants.kApriltagTab);
Shuffleboard.selectTab(OIConstants.kAutoTab); Shuffleboard.selectTab(OIConstants.kAutoTab);
@ -320,6 +321,14 @@ public class RobotContainer {
//sensorTab.add("odometry", drivetrain::getPose); //sensorTab.add("odometry", drivetrain::getPose);
sensorTab.addDouble("Orange ID", vision::getOrangeClosestTag);
sensorTab.addDouble("Orange x", vision::getOrangeRelativeX);
sensorTab.addDouble("Orange y", vision::getOrangeRelativeY);
sensorTab.addDouble("Orange z", vision::getOrangeRelativeZ);
// sensorTab.addDouble(" ID", vision::getOrangeClosestTag);
} }
public Command getAutonomousCommand() { public Command getAutonomousCommand() {

View File

@ -8,4 +8,5 @@ public class OIConstants {
public static final String kAutoTab = "Auto Tab"; public static final String kAutoTab = "Auto Tab";
public static final String kSensorsTab = "Sensors Tab"; public static final String kSensorsTab = "Sensors Tab";
public static final String kApriltagTab = "Apriltag Tab";
} }

View File

@ -49,9 +49,9 @@ public class Vision{
blackFramerate = blackVisionTable.getDoubleTopic("blackFPS").subscribe(0.0); blackFramerate = blackVisionTable.getDoubleTopic("blackFPS").subscribe(0.0);
orangeRobotRelativeX = orangeVisionTable.getDoubleTopic("orangeRelativeX").subscribe(0.0); orangeRobotRelativeX = orangeVisionTable.getDoubleTopic("tag3tx").subscribe(0.0);
orangeRobotRelativeY = orangeVisionTable.getDoubleTopic("orangeRelativeY").subscribe(0.0); orangeRobotRelativeY = orangeVisionTable.getDoubleTopic("tag_tvec_y").subscribe(0.0);
orangeRobotRelativeZ = orangeVisionTable.getDoubleTopic("orangeRelativeZ").subscribe(0.0); orangeRobotRelativeZ = orangeVisionTable.getDoubleTopic("tag_tvec_z").subscribe(0.0);
orangeClosestTag = orangeVisionTable.getDoubleTopic("orangeClosestTag").subscribe(0.0); orangeClosestTag = orangeVisionTable.getDoubleTopic("orangeClosestTag").subscribe(0.0);
orangeTagDetected = orangeVisionTable.getBooleanTopic("orangeTagDetected").subscribe(false); orangeTagDetected = orangeVisionTable.getBooleanTopic("orangeTagDetected").subscribe(false);