Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a063cb1
first commit of vibecoded vision revamp
73anthonyL Jul 12, 2025
ebd19e9
updated max speed
73anthonyL Jul 12, 2025
a77d2fd
restored singleton & system camera list
73anthonyL Jul 19, 2025
7a73160
With nt publish enabled (thank you setty)
73anthonyL Jul 20, 2025
7705dcc
disabeled this to get rid of an error
73anthonyL Jul 20, 2025
4afb05b
vision system singleton camera systemlist
73anthonyL Jul 20, 2025
2bf0c79
camera-specific vision logging
73anthonyL Jul 20, 2025
3cac2f1
first commit
73anthonyL Aug 2, 2025
9bbb5c8
total trigsolve use test
73anthonyL Aug 2, 2025
d1d92bb
took away trig solve
73anthonyL Aug 2, 2025
c6b1188
add back in trig
73anthonyL Aug 2, 2025
0b4e321
trigsolve
73anthonyL Aug 16, 2025
4f795ff
removed a comment
73anthonyL Aug 16, 2025
de6c4ce
removed setters that shouldn't be there
73anthonyL Aug 16, 2025
2cb1d82
corrected a comp
73anthonyL Aug 16, 2025
9e43caf
fixed skew angle
73anthonyL Aug 16, 2025
7bf33d3
normalized units & used correct distance measurement
73anthonyL Aug 16, 2025
6c2b4c6
changed parent functions
73anthonyL Aug 16, 2025
24dcd9d
fixed distance scaling
73anthonyL Aug 16, 2025
6e60a87
quadratic 0.05
73anthonyL Aug 16, 2025
7e61f55
vibe coded logging
73anthonyL Aug 16, 2025
df6e226
vision commit on monday
73anthonyL Aug 26, 2025
d4d705e
one commit BOSS
73anthonyL Aug 30, 2025
077f0bd
removed angle stuff
73anthonyL Aug 30, 2025
88875ce
removed lastknownpose
73anthonyL Aug 30, 2025
60c3363
fixed stuff
73anthonyL Aug 31, 2025
5713467
removed space
73anthonyL Aug 31, 2025
86d8aa7
visioncommit
73anthonyL Aug 31, 2025
d956d73
vision tweak during drive practice
73anthonyL Sep 20, 2025
a3de590
updated vendordeps
73anthonyL Sep 20, 2025
2f25304
spotless
73anthonyL Sep 20, 2025
d2277d8
Corrected Swerve logging
73anthonyL Sep 20, 2025
ca14d82
reworked edward logging
73anthonyL Sep 20, 2025
f4c83df
reorg robot.java logging
73anthonyL Sep 20, 2025
00b7c6b
logged harden constants
73anthonyL Sep 20, 2025
148ccd0
robot container logging fixed
73anthonyL Sep 20, 2025
4309da7
fixed logging until ZeroElevatorHardStop (non-inclusive)
73anthonyL Sep 20, 2025
2c0a3cc
logging fixes
73anthonyL Sep 20, 2025
1cf7a3a
vision code switching to arjuns laptop (contains errors)
73anthonyL Sep 20, 2025
150440f
chezy changes
73anthonyL Sep 23, 2025
9c84264
gigantic commit
73anthonyL Sep 27, 2025
1426153
end of chezy + vision cap change
73anthonyL Sep 30, 2025
1ee4b53
Merge branch 'main' of https://github.com/firebots-software/2025-reef…
73anthonyL Nov 18, 2025
b27cbe4
spotless
73anthonyL Nov 18, 2025
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
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/AutoRoutines/AutoProducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void settyCycle(

JamesHardenMovement movementCommand, maintainCommand;
if (!scorePosition.isBranch()) {
DogLog.log("JamesHardenScore/Errors", "called without real branch");
DogLog.log("Commands/JamesHardenScore/Errors", "Called without a real branch");
return;
}
movementCommand = JamesHardenMovement.toSpecificBranch(driveTrain, () -> scorePosition, false);
Expand Down
54 changes: 51 additions & 3 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
import edu.wpi.first.math.VecBuilder;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Rotation3d;
import edu.wpi.first.math.geometry.Transform3d;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.geometry.Translation3d;
import edu.wpi.first.math.numbers.N1;
import edu.wpi.first.math.numbers.N3;
import edu.wpi.first.math.util.Units;
Expand Down Expand Up @@ -43,6 +46,24 @@ public static class Kalman {
}

public static class HardenConstants {
public static final double QKP = 3.4;
public static final double QKI = 0.45;
public static final double QKD = 0.0005;
public static final double QCRUISE = 4.368;
public static final double QACCEL = 8.0;
public static final double QIZONE = 0.35;
public static final double QIRANGE_LOWER = 0.0;
public static final double QIRANGE_UPPER = 0.2;

public static final double HKP = 3.7;
public static final double HKI = 0.4;
public static final double HKD = 0.0;
public static final double HCRUISE = 9.417;
public static final double HACCEL = 10.971;
public static final double HIZONE = 0.14;
public static final double HIRANGE_LOWER = 0.0;
public static final double HIRANGE_UPPER = Math.PI / 4.0;

public static class EndWhenCloseEnough {
public static final double translationalToleranceTeleop = 0.8d; // 0.43105229381 worked before
public static final double translationalToleranceAuto = 1d;
Expand Down Expand Up @@ -90,6 +111,33 @@ public String getLoggingName() {
public static final double LEFT_CAM_TO_ROBOT_ROTATION_ROLL = 0;
public static final double LEFT_CAM_TO_ROBOT_ROTATION_PITCH = Units.degreesToRadians(-12.5);
public static final double LEFT_CAM_TO_ROBOT_ROTATION_YAW = Units.degreesToRadians(-40);

public static Transform3d getCameraTransform(Cameras cam) {
switch (cam) {
case RIGHT_CAM:
return new Transform3d(
new Translation3d(
RIGHT_CAM_TO_ROBOT_TRANSLATION_X,
RIGHT_CAM_TO_ROBOT_TRANSLATION_Y,
RIGHT_CAM_TO_ROBOT_TRANSLATION_Z),
new Rotation3d(
RIGHT_CAM_TO_ROBOT_ROTATION_ROLL,
RIGHT_CAM_TO_ROBOT_ROTATION_PITCH,
RIGHT_CAM_TO_ROBOT_ROTATION_YAW));
case LEFT_CAM:
return new Transform3d(
new Translation3d(
LEFT_CAM_TO_ROBOT_TRANSLATION_X,
LEFT_CAM_TO_ROBOT_TRANSLATION_Y,
LEFT_CAM_TO_ROBOT_TRANSLATION_Z),
new Rotation3d(
LEFT_CAM_TO_ROBOT_ROTATION_ROLL,
LEFT_CAM_TO_ROBOT_ROTATION_PITCH,
LEFT_CAM_TO_ROBOT_ROTATION_YAW));
default:
throw new IllegalArgumentException("Unknown camera: " + cam);
}
}
}

public static class AutoRoutines {
Expand Down Expand Up @@ -878,15 +926,15 @@ public static class ElevatorConstants {
public static final double STATOR_CURRENT_LIMIT = 50.0; // TODO: change for actual match
public static final double SUPPLY_CURRENT_LIMIT = 30.0; // TODO: change for actual match

public static double S0C_KP = 1.0; // 1.0 before (okay)
public static double S0C_KI = 0.0;
public static double S0C_KP = 1.04; // 1.0 before (okay)
public static double S0C_KI = 0.00;
public static double S0C_KD = 0.005;

public static double S1C_KP = 0.3501;
public static double S1C_KI = 0.0;
public static double S1C_KD = 0.0;

public static double S0C_KS = 0.0;
public static double S0C_KS = 0.00;
public static double S0C_KG = 0.29 + 0.05;
public static double S0C_KA = 0.0004657452997; // 0.04
public static double S0C_KV = 0.124; // 10.66
Expand Down
76 changes: 45 additions & 31 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import frc.robot.commands.ElevatorCommands.ZeroElevatorHardStop;
import frc.robot.subsystems.AnthonyVision;
import frc.robot.subsystems.CoralPosition;
import frc.robot.subsystems.ElevatorSubsystem;
import frc.robot.subsystems.SwerveSubsystem;
import frc.robot.subsystems.VisionSystem;
import frc.robot.util.LoggedTalonFX;

/**
Expand All @@ -34,8 +34,8 @@ public class Robot extends TimedRobot {
// private VisionSystem visionLeft = VisionSystem.getInstance(Constants.Vision.Cameras.LEFT_CAM);
private SwerveSubsystem driveTrain = SwerveSubsystem.getInstance();
private final RobotContainer m_robotContainer;
private VisionSystem visionRight;
private VisionSystem visionLeft;
private AnthonyVision visionRight;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename the class pls

private AnthonyVision visionLeft;

// standard deviation for x (meters), y (meters) and rotation (radians) camera data

Expand All @@ -50,9 +50,10 @@ public Robot() {
// autonomous chooser on the dashboard.
m_robotContainer = new RobotContainer();
visionRight =
VisionSystem.getInstance(Constants.Vision.Cameras.RIGHT_CAM, m_robotContainer.getRedSide());
AnthonyVision.getInstance(
Constants.Vision.Cameras.RIGHT_CAM, m_robotContainer.getRedSide());
visionLeft =
VisionSystem.getInstance(Constants.Vision.Cameras.LEFT_CAM, m_robotContainer.getRedSide());
AnthonyVision.getInstance(Constants.Vision.Cameras.LEFT_CAM, m_robotContainer.getRedSide());
absoluteInit();
}

Expand All @@ -65,17 +66,13 @@ public Robot() {
*/
@Override
public void robotPeriodic() {
DogLog.log("CoralPosition/isCoralInFunnel", CoralPosition.isCoralInFunnel());
DogLog.log("CoralPosition/isCoralInTootsieSlide", CoralPosition.isCoralInTootsieSlide());
LoggedTalonFX.periodic_static();
CommandScheduler.getInstance().run();
m_robotContainer.doTelemetry();

visionRight.addFilteredPose();
visionLeft.addFilteredPose();

DogLog.log("KalmanDebug/drivetrainPose", driveTrain.getPose());

DogLog.log("CoralPosition/isCoralInFunnel", CoralPosition.isCoralInFunnel());
DogLog.log("CoralPosition/isCoralInTootsieSlide", CoralPosition.isCoralInTootsieSlide());
}
Expand All @@ -89,24 +86,44 @@ public void disabledInit() {
@Override
public void robotInit() {
DogLog.setOptions(
new DogLogOptions().withNtPublish(false).withCaptureDs(true).withLogExtras(true));
DogLog.log("PIDArmKP", Constants.Arm.S0C_KP);
DogLog.log("PIDArmKI", Constants.Arm.S0C_KI);
DogLog.log("PIDArmKD", Constants.Arm.S0C_KD);
DogLog.log("PIDArmKS", Constants.Arm.S0C_KS);
DogLog.log("PIDArmKG", Constants.Arm.S0C_KG);

DogLog.log("PIDElevatorKP", Constants.ElevatorConstants.S0C_KP);
DogLog.log("PIDElevatorKI", Constants.ElevatorConstants.S0C_KI);
DogLog.log("PIDElevatorKD", Constants.ElevatorConstants.S0C_KD);
DogLog.log("PIDElevatorKS", Constants.ElevatorConstants.S0C_KS);
DogLog.log("PIDElevatorKG", Constants.ElevatorConstants.S0C_KG);

DogLog.log("PIDTootsieKP", Constants.TootsieSlide.S0C_KP);
DogLog.log("PIDTootsieKI", Constants.TootsieSlide.S0C_KI);
DogLog.log("PIDTootsieKD", Constants.TootsieSlide.S0C_KD);
DogLog.log("PIDTootsieKS", Constants.TootsieSlide.S0C_KS);
DogLog.log("PIDTootsieKG", Constants.TootsieSlide.S0C_KG);
new DogLogOptions().withNtPublish(true).withCaptureDs(true).withLogExtras(true));
DogLog.log("PIDValues/ArmKP", Constants.Arm.S0C_KP);
DogLog.log("PIDValues/ArmKI", Constants.Arm.S0C_KI);
DogLog.log("PIDValues/ArmKD", Constants.Arm.S0C_KD);
DogLog.log("PIDValues/ArmKS", Constants.Arm.S0C_KS);
DogLog.log("PIDValues/ArmKG", Constants.Arm.S0C_KG);

DogLog.log("PIDValues/ElevatorKP", Constants.ElevatorConstants.S0C_KP);
DogLog.log("PIDValues/ElevatorKI", Constants.ElevatorConstants.S0C_KI);
DogLog.log("PIDValues/ElevatorKD", Constants.ElevatorConstants.S0C_KD);
DogLog.log("PIDValues/ElevatorKS", Constants.ElevatorConstants.S0C_KS);
DogLog.log("PIDValues/ElevatorKG", Constants.ElevatorConstants.S0C_KG);

DogLog.log("PIDValues/TootsieKP", Constants.TootsieSlide.S0C_KP);
DogLog.log("PIDValues/TootsieKI", Constants.TootsieSlide.S0C_KI);
DogLog.log("PIDValues/TootsieKD", Constants.TootsieSlide.S0C_KD);
DogLog.log("PIDValues/TootsieKS", Constants.TootsieSlide.S0C_KS);
DogLog.log("PIDValues/TootsieKG", Constants.TootsieSlide.S0C_KG);

// Q set
DogLog.log("PIDValues/QKP", Constants.HardenConstants.QKP);
DogLog.log("PIDValues/QKI", Constants.HardenConstants.QKI);
DogLog.log("PIDValues/QKD", Constants.HardenConstants.QKD);
DogLog.log("PIDValues/QCRUISE", Constants.HardenConstants.QCRUISE);
DogLog.log("PIDValues/QACCEL", Constants.HardenConstants.QACCEL);
DogLog.log("PIDValues/QIZONE", Constants.HardenConstants.QIZONE);
DogLog.log("PIDValues/QIRANGE_LOWER", Constants.HardenConstants.QIRANGE_LOWER);
DogLog.log("PIDValues/QIRANGE_UPPER", Constants.HardenConstants.QIRANGE_UPPER);

// H set
DogLog.log("PIDValues/HKP", Constants.HardenConstants.HKP);
DogLog.log("PIDValues/HKI", Constants.HardenConstants.HKI);
DogLog.log("PIDValues/HKD", Constants.HardenConstants.HKD);
DogLog.log("PIDValues/HCRUISE", Constants.HardenConstants.HCRUISE);
DogLog.log("PIDValues/HACCEL", Constants.HardenConstants.HACCEL);
DogLog.log("PIDValues/HIZONE", Constants.HardenConstants.HIZONE);
DogLog.log("PIDValues/HIRANGE_LOWER", Constants.HardenConstants.HIRANGE_LOWER);
DogLog.log("PIDValues/HIRANGE_UPPER", Constants.HardenConstants.HIRANGE_UPPER);
// Commented this code that logs the electric data because it crashed the robot code
// there is an error related to the usage of this
// DogLog.setPdh(new PowerDistribution());
Expand Down Expand Up @@ -155,10 +172,7 @@ public void teleopInit() {

/** This function is called periodically during operator control. */
@Override
public void teleopPeriodic() {
// DogLog.log("PID Constant", IncreasePArm.broomIndex());
// DogLog.log("Mechanism Type", IncreasePArm.mechIndex());
}
public void teleopPeriodic() {}

@Override
public void testInit() {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public void doTelemetry() {
if (driveTrain.getCurrentCommand() != null) {
commandName = driveTrain.getCurrentCommand().getName();
}
DogLog.log("Robot/SwerveDriveCommand", commandName);
}

public RobotContainer() {
Expand Down Expand Up @@ -471,15 +470,15 @@ public static void setAlliance() {
}

public BooleanSupplier getRedSide() {
DogLog.log("get alliance", redside.getAsBoolean());
DogLog.log("Info/Alliance", redside.getAsBoolean());
return redside;
}

public Command getAutonomousCommand() {
/* Run the path selected from the auto chooser */
int autoValue = autoChooser.getSelected();
Command autoCommand;
DogLog.log("auto/selected", autoValue);
DogLog.log("Info/AutoSelected", autoValue);
switch (autoValue) {
case 1:
autoCommand =
Expand Down
29 changes: 1 addition & 28 deletions src/main/java/frc/robot/commandGroups/JamesHardenScore.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public JamesHardenScore(

JamesHardenMovement movementCommand, maintainCommand;
if (!branch.isBranch()) {
DogLog.log("JamesHardenScore/Errors", "called without real branch");
DogLog.log("Commands/JamesHardenScore/Errors", "Called without a real branch");
return;
}

Expand All @@ -85,39 +85,12 @@ public JamesHardenScore(
} else {
elevateCommand = new SetElevatorLevel(elevatorSubsystem, height, true);
}
// if (DriverStation.isTeleop()) {
DogLog.log("JamesHardenScore/Version", "teleop");

addCommands(
movementCommand.alongWith(
(new EndWhenCloseEnough(() -> movementCommand.getTargetPose2d()))
.andThen(elevateCommand)),
new ParallelDeadlineGroup(
new ShootTootsieSlide(tootsieSlideSubsystem).withTimeout(0.5), maintainCommand));
// addCommands(
// maintainCommand
// .alongWith(
// (new EndWhenCloseEnough(() -> maintainCommand.getTargetPose2d()))
// .andThen(elevateCommand))
// .alongWith(
// new EndWhenCloseEnough(() -> maintainCommand.getTargetPose2d(),
// Constants.HardenConstants.RegularCommand.xyIndividualTolerance * Math.sqrt(2),
// Constants.HardenConstants.RegularCommand.headingTolerance)
// .andThen(new ShootTootsieSlide(tootsieSlideSubsystem).withTimeout(0.5))));
// )
// new ParallelDeadlineGroup(
// new ShootTootsieSlide(tootsieSlideSubsystem).withTimeout(0.5), maintainCommand));
// } else {
// DogLog.log("JamesHardenScore/Version", "auto");
// addCommands(
// movementCommand
// .withTimeout(5.0)
// .alongWith(
// (new EndWhenCloseEnough(() -> movementCommand.getTargetPose2d()))
// .andThen(elevateCommand)),
// new ParallelDeadlineGroup(
// new ShootTootsieSlide(tootsieSlideSubsystem).withTimeout(0.5), maintainCommand));
// new EndWhenCloseEnough(() -> movementCommand.getTargetPose2d(), 2.8284271247);
// }
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// TODO: THIS COMMAND NEED TO BE UPDATED TO WORK PROPERLY
package frc.robot.commands.DaleCommands;

import dev.doglog.DogLog;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Constants.ElevatorConstants.ElevatorPositions;
import frc.robot.subsystems.ArmSubsystem;
Expand All @@ -27,7 +26,6 @@ public void initialize() {}
@Override
public void execute() {
armPlusFlywheel.spinFlywheel(); // Spin the flywheel at desired speed
DogLog.log("Running to target angle: ", angle);
armPlusFlywheel.setPosition(angle);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void initialize() {}

@Override
public void execute() {
DogLog.log("Running to target angle: ", angle);
DogLog.log("Commands/ArmToAngleCmd/TargetAngle", angle);
arm.setPosition(angle);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ public class ZeroElevatorHardStop extends Command {

public ZeroElevatorHardStop(ElevatorSubsystem subsystem) {
elevatorSubsystem = subsystem;
DogLog.log("subsystems/Elevator/ZeroElevatorHardStop/running", false);
DogLog.log("Commands/ZeroElevatorHardStop/Running", false);
addRequirements(elevatorSubsystem);
}

// Called when the command is initially scheduled.
@Override
public void initialize() {
elevatorSubsystem.reduceCurrentLimits();
DogLog.log("subsystems/Elevator/ZeroElevatorHardStop/running", true);
DogLog.log("Commands/ZeroElevatorHardStop/Running", true);
timesExceededCurrent = 0;
}

Expand All @@ -32,7 +32,7 @@ public void execute() {
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
DogLog.log("subsystems/Elevator/ZeroElevatorHardStop/running", false);
DogLog.log("Commands/ZeroElevatorHardStop/Running", false);
if (!interrupted) {
elevatorSubsystem.resetElevatorPositionToZero();
}
Expand All @@ -43,9 +43,9 @@ public void end(boolean interrupted) {
// Returns true when the command should end.
@Override
public boolean isFinished() {
DogLog.log("subsystems/Elevator/ZeroElevatorHardStop/timesExceededCount", timesExceededCurrent);
DogLog.log("Commands/ZeroElevatorHardStop/timesExceededCurrent", timesExceededCurrent);
boolean checkCurrent = elevatorSubsystem.checkCurrent();
DogLog.log("subsystems/Elevator/ZeroElevatorHardStop/checkcurrent", checkCurrent);
DogLog.log("Commands/ZeroElevatorHardStop/checkCurrent", checkCurrent);
if (checkCurrent) {
timesExceededCurrent++;
} else {
Expand Down
Loading