Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fb3b839
add vision files, not implemented
arcadeArchitect Jan 6, 2026
0543c18
add basic vision structure, still need to implement simulation and de…
arcadeArchitect Jan 8, 2026
7f90023
resolve merge conflicts
arcadeArchitect Jan 8, 2026
bb0e7be
add disconnected notifications for vision, more work on sim vision
arcadeArchitect Jan 9, 2026
b67c392
add vision util method
arcadeArchitect Jan 11, 2026
4178761
merge with main and resolve merge conflicts
arcadeArchitect Jan 14, 2026
4aab05e
pull in main and resolve merge conflicts
arcadeArchitect Jan 14, 2026
6803198
Merge branch 'vision' of https://github.com/Team5924/GoldenGateRoboti…
arcadeArchitect Jan 14, 2026
fc0d719
added some camera properties for photon vision sim, still wip
arcadeArchitect Jan 17, 2026
9f6dcce
Merge branch 'main' of https://github.com/Team5924/GoldenGateRobotics…
arcadeArchitect Jan 17, 2026
a3dd200
Merge branch 'main' of https://github.com/Team5924/GoldenGateRobotics…
arcadeArchitect Jan 17, 2026
d2c9b7a
Merge branch 'main' of https://github.com/Team5924/GoldenGateRobotics…
arcadeArchitect Feb 4, 2026
53b7297
vision rework, still constant work
arcadeArchitect Feb 6, 2026
c9c117a
vision wip
arcadeArchitect Feb 8, 2026
1c856fd
udpate camera positions, fix some constants, more vision changes
arcadeArchitect Feb 14, 2026
5bfa520
update constants, more work on vision sim (kinda works now!!)
arcadeArchitect Feb 14, 2026
9110ff0
whitespace fix
arcadeArchitect Feb 25, 2026
aa3cdf7
Merge branch 'main' of https://github.com/Team5924/GoldenGateRobotics…
arcadeArchitect Feb 25, 2026
a7d43b3
vision fixes (Jack + coderabbit)
arcadeArchitect Feb 26, 2026
9399348
change names of cameras
arcadeArchitect Mar 5, 2026
0fa852a
update camera constants and implementation
arcadeArchitect Mar 7, 2026
2eaaf65
Merge remote-tracking branch 'origin/main' into vision-rework
arcadeArchitect Mar 7, 2026
461bb9d
Merge branch 'main' of https://github.com/Team5924/GoldenGateRobotics…
arcadeArchitect Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion simgui-ds.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
],
"robotJoysticks": [
{
"guid": "030000005e040000120b000009050000"
"guid": "78696e70757401000000000000000000",
"useGamepad": true
}
]
}
27 changes: 27 additions & 0 deletions src/main/java/org/team5924/frc2026/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

package org.team5924.frc2026;

import java.util.ArrayList;
import java.util.List;

import org.photonvision.simulation.SimCameraProperties;
import org.team5924.frc2026.util.VisionUtil;

import com.ctre.phoenix6.configs.CANdiConfiguration;
import com.ctre.phoenix6.configs.ClosedLoopRampsConfigs;
import com.ctre.phoenix6.configs.CurrentLimitsConfigs;
Expand All @@ -28,6 +34,11 @@
import com.ctre.phoenix6.signals.NeutralModeValue;
import com.ctre.phoenix6.signals.S1CloseStateValue;
import com.ctre.phoenix6.signals.S2CloseStateValue;

import edu.wpi.first.apriltag.AprilTagFieldLayout;
import edu.wpi.first.apriltag.AprilTagFields;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.util.Units;
import edu.wpi.first.wpilibj.RobotBase;

/**
Expand Down Expand Up @@ -230,6 +241,22 @@ public final class Indexer { //TODO: update these later
.withInverted(InvertedValue.CounterClockwise_Positive)
.withNeutralMode(NeutralModeValue.Brake));
}

public static final class Field { // TODO: update all of these when new field released
public static final double FIELD_BORDER_MARGIN = 0.5;
public static final AprilTagFields FIELD_TYPE = AprilTagFields.k2025ReefscapeWelded; // TODO: update to new field
public static final AprilTagFieldLayout field = AprilTagFieldLayout.loadField(FIELD_TYPE);
public static final double FIELD_WIDTH = field.getFieldWidth();
public static final double FIELD_LENGTH = field.getFieldLength();

public static final double faceLength = Units.inchesToMeters(36.792600);
public static final double fieldWidth = field.getFieldWidth();
public static final Translation2d blueCenter =
new Translation2d(Units.inchesToMeters(176.745), Units.inchesToMeters(158.5));

public static final Translation2d redCenter =
new Translation2d(Units.inchesToMeters(514.13), Units.inchesToMeters(158.5));
}
}


88 changes: 66 additions & 22 deletions src/main/java/org/team5924/frc2026/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@
import org.team5924.frc2026.subsystems.drive.ModuleIO;
import org.team5924.frc2026.subsystems.drive.ModuleIOTalonFX;
import org.team5924.frc2026.subsystems.drive.ModuleIOTalonFXSim;
import org.team5924.frc2026.subsystems.vision.Vision;
import org.team5924.frc2026.subsystems.vision.VisionConstants;
import org.team5924.frc2026.subsystems.vision.VisionIO;
import org.team5924.frc2026.subsystems.vision.VisionIOPhotonVision;
import org.team5924.frc2026.subsystems.vision.VisionIOPhotonVisionSim;

public class RobotContainer {
// Subsystems
private final Drive drive;
private SwerveDriveSimulation driveSimulation = null;

private Vision vision;
// private final ExampleSystem exampleSystem;
// private final ExampleRoller exampleRoller;

Expand All @@ -66,6 +73,17 @@ public RobotContainer() {
new ModuleIOTalonFX(TunerConstants.BackLeft),
new ModuleIOTalonFX(TunerConstants.BackRight),
(pose) -> {});
vision =
new Vision(
drive::addVisionMeasurement,
// new VisionIOPhotonVision(
// VisionConstants.FRONT_LEFT_NAME, VisionConstants.FRONT_LEFT_TRANSFORM),
new VisionIOPhotonVision(
VisionConstants.FRONT_RIGHT_NAME, VisionConstants.FRONT_RIGHT_TRANSFORM),
new VisionIOPhotonVision(
VisionConstants.BACK_LEFT_NAME, VisionConstants.BACK_LEFT_TRANSFORM),
new VisionIOPhotonVision(
VisionConstants.BACK_RIGHT_NAME, VisionConstants.BACK_RIGHT_TRANSFORM));
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
// exampleSystem = new ExampleSystem(new ExampleSystemIOTalonFX());
// exampleRoller = new ExampleRoller(new ExampleRollerIOKrakenFOC());
break;
Expand All @@ -83,13 +101,29 @@ public RobotContainer() {
new ModuleIOTalonFXSim(TunerConstants.BackLeft, driveSimulation.getModules()[2]),
new ModuleIOTalonFXSim(TunerConstants.BackRight, driveSimulation.getModules()[3]),
driveSimulation::setSimulationWorldPose);
// vision = new Vision(drive,
// new VisionIOPhotonVisionSim(
// camera0Name, robotToCamera0,
// driveSimulation::getSimulatedDriveTrainPose),
// new VisionIOPhotonVisionSim(
// camera0Name, robotToCamera0,
// driveSimulation::getSimulatedDriveTrainPose);
vision =
new Vision(
drive::addVisionMeasurement,
new VisionIOPhotonVisionSim(
VisionConstants.FRONT_LEFT_NAME,
VisionConstants.FRONT_LEFT_TRANSFORM,
VisionConstants.SIM_THRIFTYCAM_PROPERTIES,
drive::getPose),
new VisionIOPhotonVisionSim(
VisionConstants.FRONT_RIGHT_NAME,
VisionConstants.FRONT_RIGHT_TRANSFORM,
VisionConstants.SIM_THRIFTYCAM_PROPERTIES,
drive::getPose),
new VisionIOPhotonVisionSim(
VisionConstants.BACK_LEFT_NAME,
VisionConstants.BACK_LEFT_TRANSFORM,
VisionConstants.SIM_THRIFTYCAM_PROPERTIES,
drive::getPose),
new VisionIOPhotonVisionSim(
VisionConstants.BACK_RIGHT_NAME,
VisionConstants.BACK_RIGHT_TRANSFORM,
VisionConstants.SIM_THRIFTYCAM_PROPERTIES,
drive::getPose));
// exampleSystem = new ExampleSystem(new ExampleSystemIOSim());
// exampleRoller = new ExampleRoller(new ExampleRollerIOSim());
break;
Expand All @@ -104,6 +138,13 @@ public RobotContainer() {
new ModuleIO() {},
new ModuleIO() {},
(pose) -> {});
vision =
new Vision(
drive::addVisionMeasurement,
new VisionIO() {},
new VisionIO() {},
new VisionIO() {},
new VisionIO() {});
Comment thread
arcadeArchitect marked this conversation as resolved.
Outdated
// exampleSystem = new ExampleSystem(new ExampleSystemIO() {});
// exampleRoller = new ExampleRoller(new ExampleRollerIO() {});
// vision = new Vision(drive, new VisionIO() {}, new VisionIO() {});
Expand Down Expand Up @@ -141,21 +182,24 @@ public RobotContainer() {
*/
private void configureButtonBindings() {
// Default command, normal field-relative drive
if (Constants.currentMode == Constants.Mode.SIM) {
drive.setDefaultCommand(
DriveCommands.joystickDrive(
drive,
() -> -driveController.getLeftY(),
() -> -driveController.getRawAxis(0),
() -> -driveController.getRawAxis(2)));
} else {
drive.setDefaultCommand(
DriveCommands.joystickDrive(
drive,
() -> -driveController.getLeftY(),
() -> -driveController.getLeftX(),
() -> -driveController.getRightX()));
}

// TODO: uncomment this out!
// if (Constants.currentMode == Constants.Mode.SIM) {
// drive.setDefaultCommand(
// DriveCommands.joystickDrive(
// drive,
// () -> -driveController.getLeftY(),
// () -> -driveController.getRawAxis(0),
// () -> -driveController.getRawAxis(2)));
// } else {
drive.setDefaultCommand(
DriveCommands.joystickDrive(
drive,
() -> -driveController.getLeftY(),
() -> -driveController.getLeftX(),
() -> -driveController.getRightX()));
// }

// [driver] SLOW MODE YIPE
driveController
.y()
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/team5924/frc2026/RobotState.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import edu.wpi.first.math.geometry.Rotation2d;
import lombok.Getter;
import lombok.Setter;
import org.littletonrobotics.junction.AutoLogOutput;
import org.team5924.frc2026.subsystems.exampleSystem.ExampleSystem.ExampleSystemState;
import org.team5924.frc2026.subsystems.rollers.exampleRoller.ExampleRoller.ExampleRollerState;
import org.team5924.frc2026.subsystems.rollers.hopperAgitator.Hopper.HopperState;
Expand All @@ -40,10 +39,8 @@ public static RobotState getInstance() {
}

// Pose Estimation Members
@AutoLogOutput(key = "RobotState/OdometryPose")
@Getter
@Setter
private Pose2d odometryPose = new Pose2d();
// @AutoLogOutput(key = "RobotState/OdometryPose")
@Getter @Setter private Pose2d odometryPose = new Pose2d();

@Getter @Setter private Rotation2d yawPosition = new Rotation2d();
@Getter @Setter private double yawVelocityRadPerSec = 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ public void periodic() {

// Update RobotState
RobotState.getInstance().setOdometryPose(getPose());
Logger.recordOutput("RobotState/OdometryPose", getPose());

// prevents error spam
if (!gyroInputs.connected && wasGyroConnected) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public class IndexerIOTalonFX extends GenericRollerSystemIOKrakenFOC<IndexerIOIn

// private final DigitalInput beamBreak = new DigitalInput(Constants.Indexer.BEAM_BREAK_ID);
private class IndexerInverseTalonFX extends GenericRollerSystemIOKrakenFOC<IndexerIOInputs> {
public IndexerInverseTalonFX () {
public IndexerInverseTalonFX() {
super(
Constants.Indexer.CAN_ID_INVERSE,
Constants.Indexer.BUS,
Constants.Indexer.CONFIG,
Constants.Indexer.REDUCTION_INVERSE);
Constants.Indexer.CAN_ID_INVERSE,
Constants.Indexer.BUS,
Constants.Indexer.CONFIG,
Constants.Indexer.REDUCTION_INVERSE);
}
}
}

// This is the other motor on indexer, the one that pushes up balls to shooter
private final IndexerInverseTalonFX indexerInverse;
Expand All @@ -54,7 +54,6 @@ public void updateInputs(IndexerIOInputs inputs) {
@Override
public void runVolts(double volts) {
super.runVolts(volts);
indexerInverse.runVolts(-1*volts);
indexerInverse.runVolts(-1 * volts);
}

}
Loading