Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0434c2c
Make feeding use SOTM
SCool62 Mar 1, 2026
cb5d0ea
reorder auto aim stuff for clarity
vivi-o Mar 2, 2026
7c2638f
make score actually use sotm?
vivi-o Mar 2, 2026
4359bf9
get sotm data based on turret pose not the entire robot
vivi-o Mar 2, 2026
de2a702
iterate sotm so its more accurate
vivi-o Mar 2, 2026
5c59a2b
use existing virtual target method
vivi-o Mar 2, 2026
a86e100
get turret pose
vivi-o Mar 2, 2026
20920c7
revert because that iteration wouldn't help
vivi-o Mar 2, 2026
691fe0e
trying newtons method
vivi-o Mar 2, 2026
995766f
nvm velocity should already be accounted for
vivi-o Mar 2, 2026
e853f27
implement newtons method with correct required velocity
vivi-o Mar 5, 2026
f772b89
update comments
vivi-o Mar 5, 2026
3d4074d
build to format
vivi-o Mar 5, 2026
b71c4f0
Merge branch 'main' into sotm-adjustment
vivi-o Mar 5, 2026
1579c0a
wtf (what the fuel)
spellingcat Mar 11, 2026
b05c5fe
Merge branch 'main' into exp/fuel-sim
spellingcat Mar 18, 2026
2439ad8
this isn't really working
spellingcat Mar 18, 2026
e246a59
i suspect there's some goofy fudge factor
spellingcat Mar 19, 2026
e47e06a
Merge branch 'main' into sotm-adjustment
spellingcat Mar 19, 2026
1ea1995
oh what the heck
spellingcat Mar 19, 2026
da1e424
Merge branch 'exp/fuel-sim' into sotm-adjustment
spellingcat Mar 19, 2026
f31db0c
Fix flowstate and remove latency
SCool62 Mar 20, 2026
89f8c51
Merge branch '3-19-sotm-testing' into sotm-adjustment
SCool62 Mar 20, 2026
d827cd9
Use newtons method where already implemented
SCool62 Mar 20, 2026
c4775ed
Moar iterations
SCool62 Mar 20, 2026
277fa5e
Remove velocity threshold condition in loop
SCool62 Mar 20, 2026
3eed5e7
hack together mech a + newton's method i dont know please dont ask me…
spellingcat Mar 20, 2026
ba7e1c8
try simming it but my sim sucks too so
spellingcat Mar 20, 2026
6f5ac07
Merge branch '3-21-shot-retuning' into yet-another-sotm-rewrite
spellingcat Mar 21, 2026
64a0b21
assorted tuning of the mecha solution but it's kind of bad
spellingcat Mar 21, 2026
596056b
stop being stupid about where the target actually is
spellingcat Mar 22, 2026
7ecb0d6
Whole rewrite lol (works in sim)
SCool62 Mar 22, 2026
fb75061
Merge branch 'yet-another-sotm-rewrite' of https://github.com/Highlan…
spellingcat Mar 22, 2026
c4ec5be
Merge branch 'main' into yet-another-sotm-rewrite
spellingcat Mar 22, 2026
12287a4
fmt
spellingcat Mar 22, 2026
266ca34
fmt
spellingcat Mar 22, 2026
22fda51
Make out of range update with new rewrite
SCool62 Mar 22, 2026
d43bff8
Add acceleration (untested)
SCool62 Mar 22, 2026
bcc58a6
Revert "Add acceleration (untested)"
SCool62 Mar 22, 2026
a2e6099
Smarter acceleration compensation
SCool62 Mar 22, 2026
82ddc76
Tuning
SCool62 Mar 22, 2026
99daa84
Comments
SCool62 Mar 22, 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
140 changes: 67 additions & 73 deletions src/main/deploy/choreo/OtoCR.traj

Large diffs are not rendered by default.

48 changes: 40 additions & 8 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
import frc.robot.utils.FieldUtils.ClimbTargets;
import frc.robot.utils.FieldUtils.FeedTargets;
import frc.robot.utils.FieldUtils.TrenchPoses;
import frc.robot.utils.autoaim.AutoAim;
import frc.robot.utils.FuelSim;
import frc.robot.utils.autoaim.NewAutoAim;
import java.io.File;
import java.util.Arrays;
import java.util.Optional;
Expand Down Expand Up @@ -208,6 +209,8 @@ public enum RobotEdition {
private final CANdleSubsystem candle =
new CANdleSubsystem(new CANdleIOReal(0, CANdleSubsystem.getCandleConfig(), canivore));

private FuelSim fuelSim = new FuelSim();

// climber only exists for the comp bot - this is accounted for later

private final Superstructure superstructure;
Expand Down Expand Up @@ -420,7 +423,8 @@ public Robot() {
: new CANcoderIOSim(5, TurretSubsystem.getCancoder24tConfigs(), canivore),
ROBOT_MODE == RobotMode.REAL
? new CANcoderIO(4, TurretSubsystem.getCancoder26tConfigs(), canivore)
: new CANcoderIOSim(4, TurretSubsystem.getCancoder26tConfigs(), canivore));
: new CANcoderIOSim(4, TurretSubsystem.getCancoder26tConfigs(), canivore),
fuelSim);
break;
}
climber =
Expand Down Expand Up @@ -516,7 +520,7 @@ public Robot() {
shooter.setDefaultCommand(
shooter.rest(
swerve::getPose,
swerve::getVelocityFieldRelative,
swerve::getVelocityRobotRelative,
superstructure::inScoringArea,
() -> FeedTargets.getFeedTarget(Superstructure.getFeedTarget()).getPose()));
swerve.setDefaultCommand(
Expand Down Expand Up @@ -589,6 +593,31 @@ public Robot() {
"Interrputing: "
+ (interrupting.isPresent() ? interrupting.get().getName() : "none"));
});

// fuelSim.spawnStartingFuel();

fuelSim.registerRobot(
Units.inchesToMeters(28), // from left to right in meters
Units.inchesToMeters(28), // from front to back in meters
Units.inchesToMeters(4), // from floor to top of bumpers in meters
swerve::getPose, // Supplier<Pose2d> of robot pose
swerve
::getVelocityFieldRelative); // Supplier<ChassisSpeeds> of field-centric chassis speeds

fuelSim.registerIntake(
Units.inchesToMeters(-14),
Units.inchesToMeters(14),
Units.inchesToMeters(14),
Units.inchesToMeters(20), // robot-centric coordinates for bounding box in meters
() ->
Superstructure.getState()
.isAnIntakeState() // (optional) BooleanSupplier for whether the intake should be
// active at a given moment
); // (optional) Runnable called whenever a fuel is intaked

fuelSim.setSubticks(5);

fuelSim.start();
}

/** Scales a joystick value for teleop driving */
Expand Down Expand Up @@ -651,7 +680,7 @@ private void addControllerBindings(Indexer indexer, Shooter shooter, Intake inta
Commands.parallel(
shooter.runHoodCurrentZeroing(), intake.runCurrentZeroing())));

new Trigger(() -> AutoAim.targetInTurretDeadzone())
new Trigger(() -> NewAutoAim.targetInTurretDeadzone())
.onTrue(
driver
.rumbleCmd(1, 1)
Expand Down Expand Up @@ -696,8 +725,9 @@ private void addControllerBindings(Indexer indexer, Shooter shooter, Intake inta
// driver
// .leftBumper()
// .and(
new Trigger(AutoAim::targetInTurretDeadzone)
new Trigger(NewAutoAim::targetInTurretDeadzone)
.and(() -> Superstructure.getState().isAScoreState())
.and(() -> !Superstructure.getState().isAFlowState())
.and(() -> !Superstructure.getPoseOverride())
.and(() -> superstructure.inScoringArea())
.whileTrue(
Expand All @@ -712,8 +742,9 @@ private void addControllerBindings(Indexer indexer, Shooter shooter, Intake inta
* SwerveSubsystem.SWERVE_CONSTANTS.getMaxLinearSpeed(),
shooter::getTurretPosition));

new Trigger(AutoAim::targetInTurretDeadzone)
new Trigger(NewAutoAim::targetInTurretDeadzone)
.and(() -> Superstructure.getState().isAFeedState())
.and(() -> !Superstructure.getState().isAFlowState())
.and(() -> !Superstructure.getPoseOverride())
.and(() -> !superstructure.inScoringArea())
.whileTrue(
Expand Down Expand Up @@ -850,7 +881,7 @@ public void robotPeriodic() {
"trench poses",
Arrays.stream(TrenchPoses.values()).map(target -> target.getPose()).toArray(Pose2d[]::new));

Logger.recordOutput("Turret/out of range", AutoAim.targetInTurretDeadzone());
Logger.recordOutput("Turret/out of range", NewAutoAim.targetInTurretDeadzone());

noLogStickAlert.set(!directory.exists());

Expand Down Expand Up @@ -930,6 +961,7 @@ public void simulationInit() {

@Override
public void simulationPeriodic() {
fuelSim.updateSim();
// Log zeroed poses for mechs and robot for debugging in sim
Logger.recordOutput(
"Robot/Zeroed Mechanism Poses",
Expand Down Expand Up @@ -984,7 +1016,7 @@ public void teleopPeriodic() {}
@Override
public void teleopExit() {
System.out.println("Saving BFG Log");
bfg.saveLog("");
if (bfg.isConnected()) bfg.saveLog("");
}

@Override
Expand Down
Loading
Loading