Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
52db7a2
Implement basic auto shoot
codeNinja-1 Jan 28, 2026
a8f1b0b
Merge branch 'main' into autoshoot-simple
codeNinja-1 Jan 29, 2026
48469d6
Remove unnecessary release time function and fix math error
codeNinja-1 Jan 29, 2026
933a8a6
Add scaling function for displacement due to initial robot velocity
codeNinja-1 Feb 10, 2026
3e0ac1e
Move autoshoot to auto/shoot instead of controls/shoot
codeNinja-1 Feb 10, 2026
2fb93b6
Merge branch 'main' into autoshoot
codeNinja-1 Feb 17, 2026
69b9fdd
Merge branch 'main' into autoshoot
codeNinja-1 Feb 25, 2026
a47f0ba
Fix bug with moved isClearToOverride method
codeNinja-1 Feb 25, 2026
7e685d5
Stop using abstractions for subsystems
codeNinja-1 Feb 25, 2026
2e9dedb
Changed CAN network
The-REAL-Bol Feb 25, 2026
d8e455d
Commented out teleop controls that won't be used at week 0
allenx-afk Feb 25, 2026
9deb900
Commented out code for week 0
allenx-afk Feb 25, 2026
da3987c
added a class with commands to tell the robot to go to the position w…
styrofoam23 Feb 25, 2026
8bd9878
i made it so that the kicker will be loaded should the hopper isn't e…
charlizew1 Feb 25, 2026
782c790
Added a constnat for stationary shooting velocity and updated teleop …
vaderaikou Feb 25, 2026
1caa48a
Fixed some errors that were showing up
charlizew1 Feb 25, 2026
50bc1a4
changed variable name
vaderaikou Feb 25, 2026
1e4dc63
Added a method to move the robot to the nearest position on the hub r…
allenx-afk Feb 25, 2026
0afb639
Tune steer encoder offsets and MK4n steer motors
codeNinja-1 Feb 25, 2026
23c8f98
Disable fuel detection for week 0
codeNinja-1 Feb 25, 2026
30bf2c2
Tune swerve for week zero
codeNinja-1 Feb 26, 2026
0cb94c4
Fix logging bug
codeNinja-1 Feb 26, 2026
bdbd2d9
Add automatic loading of kicker
codeNinja-1 Feb 26, 2026
bb87b0d
Apply spotless
codeNinja-1 Feb 26, 2026
050bccf
Adding logging for intake fine control
Imirami314 Feb 26, 2026
7c98a04
Quick logging fix
Imirami314 Feb 26, 2026
b49e1ee
Fix a few bugs and everything in simulation
codeNinja-1 Feb 26, 2026
0c0fdf9
Merge branch 'week-zero' of https://github.com/team6962/Code-2026 int…
codeNinja-1 Feb 26, 2026
2c8074b
Improve auto align to shoot
codeNinja-1 Feb 26, 2026
1ebd934
Fix bug in AngleMath.toContinuous
codeNinja-1 Feb 26, 2026
12943db
Runs hopper load function immediately when trigger pressed
puzzleCatcher Feb 26, 2026
600da06
Merge branch 'week-zero' of https://github.com/team6962/Code-2026 int…
puzzleCatcher Feb 26, 2026
bf9c206
Removed shooter rollers from hopper
scotch-tape Feb 26, 2026
ce46a3e
Tune intake extension
codeNinja-1 Feb 26, 2026
000355e
Apply spotless
codeNinja-1 Feb 26, 2026
3cc026d
Merge branch 'week-zero' of https://github.com/team6962/Code-2026 int…
codeNinja-1 Feb 26, 2026
f7997da
Remove upper hopper sensor
codeNinja-1 Feb 27, 2026
0be03e8
Added temporary camera constants (need to be checked and tuned)
scotch-tape Feb 27, 2026
c095b46
applied spotless
scotch-tape Feb 27, 2026
44e2161
Improved camera constants
scotch-tape Feb 27, 2026
c791014
Tune feeding
codeNinja-1 Feb 27, 2026
408ba5a
Tune intake extension
codeNinja-1 Feb 27, 2026
31bc82d
Switch from load to feed for shooting
codeNinja-1 Feb 27, 2026
62a7eb1
Tune robot for week 0 and fix bugs
codeNinja-1 Feb 27, 2026
306b7cb
Various fixes before week zero
codeNinja-1 Feb 28, 2026
5076aca
Add elastic layout
RobotXTeam6962 Feb 28, 2026
17de609
Various improvements during week zero
codeNinja-1 Feb 28, 2026
b3572c1
Tuning during week zero
codeNinja-1 Mar 1, 2026
8f56a82
Merge branch 'week-zero' of https://github.com/team6962/Code-2026 int…
codeNinja-1 Mar 1, 2026
a0bfd99
Undo a lot of week zero only changes
codeNinja-1 Mar 1, 2026
29adc37
Format code
codeNinja-1 Mar 1, 2026
0a03bbe
Remove DriveFixedShooter
codeNinja-1 Mar 1, 2026
d5c0a80
Uncomment back left camera configuration
codeNinja-1 Mar 1, 2026
c0f40b0
Uncomment color camera constants
codeNinja-1 Mar 1, 2026
8ed15d0
Rename IntakeFineControl field to FineControl
codeNinja-1 Mar 1, 2026
35b53f6
Re-add auto climb retraction and remove duplicate // in comments
codeNinja-1 Mar 1, 2026
f6be069
Refactor hopper feeding code
codeNinja-1 Mar 1, 2026
8d07f73
Update Hopper#unjam Javadoc comment
codeNinja-1 Mar 1, 2026
e7cb613
Remove empty Hopper#periodic method
codeNinja-1 Mar 1, 2026
9c9b8df
Add Javadoc comment for BeltFloor#slowReverse
codeNinja-1 Mar 1, 2026
e952fb8
Add Javadoc comment for HopperSensors#isFeedingSuccessfully
codeNinja-1 Mar 1, 2026
875f6c6
Add the upper hopper CANrange back to HopperSensors
codeNinja-1 Mar 1, 2026
a2077c1
Remove unused ShooterRollers#isRunning method
codeNinja-1 Mar 1, 2026
341a340
Merge branch 'main' into autoshoot
codeNinja-1 Mar 1, 2026
31bef69
Merge branch 'post-week-zero' into autoshoot
codeNinja-1 Mar 1, 2026
75dc234
style: Apply Spotless fixes
codeNinja-1 Mar 1, 2026
bf7a260
Empty commit
codeNinja-1 Mar 1, 2026
8a9a61c
Merge branch 'post-week-zero' of https://github.com/team6962/Code-202…
codeNinja-1 Mar 1, 2026
ba7ad58
Merge branch 'post-week-zero' into autoshoot
codeNinja-1 Mar 1, 2026
cfe8247
Make auto shoot more similar to 6328's auto shoot
codeNinja-1 Mar 1, 2026
e98a3dc
Improve autoshoot and shooting simulation
codeNinja-1 Mar 3, 2026
0c6c8b6
Merge branch 'main' into autoshoot
codeNinja-1 Mar 3, 2026
d1f387d
Tune shooter for shooting into the hub
codeNinja-1 Mar 4, 2026
2feed69
Correct shooter data
codeNinja-1 Mar 5, 2026
76695f3
Merge branch 'main' into autoshoot
codeNinja-1 Mar 5, 2026
c113d32
Spotless apply
codeNinja-1 Mar 5, 2026
81fb517
Merge branch 'main' into autoshoot
codeNinja-1 Mar 5, 2026
b068818
Tune shooting, reduce latency, fix bugs
codeNinja-1 Mar 6, 2026
9a170dc
Fix shooter flywheel velocity bug
codeNinja-1 Mar 6, 2026
1211a75
style: Apply Spotless fixes
codeNinja-1 Mar 6, 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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
"edu.wpi.first.math.**.struct.*",
],
"java.dependency.enableDependencyCheckup": false,
"java.jdt.ls.vmargs": "-Xmx4G",
"java.jdt.ls.vmargs": "-Xmx8G",
"java.compile.nullAnalysis.mode": "disabled"
}
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ wpi.java.debugJni = false
// Set this to true to enable desktop support.
def includeDesktopSupport = true

repositories {
mavenCentral()
}

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 5.
dependencies {
Expand Down
27 changes: 27 additions & 0 deletions src/main/deploy/all_shooter_hub_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
57.5,18,25
57.5,23,23
57.5,26,21
85,18,26.5
85,28,23.5
85,23,24.5
107,18,28
107,28,24.3
107,38,23.9
107,33,23.5
107,23,25.5
124,18,28
124,23,26
124,28,24
150,18,32
150,28,27
150,38,26.5
214,18,36
214,28,30
214,38,29
214,23,34
214,33,29.75
263,18,42
263,28,35
263,38,31.5
263,23,38.5
263,33,32.5
7 changes: 0 additions & 7 deletions src/main/deploy/flywheelvelocitydatahub.csv

This file was deleted.

27 changes: 0 additions & 27 deletions src/main/deploy/hoodangledatahub.csv

This file was deleted.

9 changes: 9 additions & 0 deletions src/main/deploy/shooter_hub_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
83.75,18,22,0.868
101.375,22,24,1.004
114.25,24,24.5,1.012
128.25,25,25,1.016
144.25,26,26,1.029
165.75,26.5,28,1.159
189.25,27,29,1.212
221.25,29,31.5,1.289
235.75,29.5,32,1.318
5 changes: 5 additions & 0 deletions src/main/deploy/sim_shooter_hub_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
50,18,15,0.5
100,28,20,0.75
150,38,25,1
200,43,27,1.25
250,48,30,1.5
3 changes: 0 additions & 3 deletions src/main/deploy/velocityrangehub.csv

This file was deleted.

22 changes: 22 additions & 0 deletions src/main/java/com/team6962/lib/commands/CommandUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.team6962.lib.commands;

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Subsystem;

/** Utility class for command-related helper functions. */
public class CommandUtil {
/**
* Checks if it is okay to replace the currently active command on a subsystem, and have the given
* command take control instead. A subsystem is clear to override if it has no current command,
* has only its default command running, or is already running the specified command.
*
* @param subsystem The subsystem to check
* @param command The command that wants to take control
* @return True if the subsystem's active command can be safely overridden
*/
public static boolean isClearToOverride(Subsystem subsystem, Command command) {
return subsystem.getCurrentCommand() == null
|| subsystem.getCurrentCommand() == subsystem.getDefaultCommand()
|| subsystem.getCurrentCommand() == command;
}
}
20 changes: 20 additions & 0 deletions src/main/java/com/team6962/lib/logging/LoggingUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.ctre.phoenix6.controls.ControlRequest;
import dev.doglog.DogLog;
import edu.wpi.first.wpilibj2.command.Command;
import java.io.InputStream;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -90,4 +91,23 @@ public static void logGitProperties() {
System.err.println("Failed to load git properties: " + e.getMessage());
}
}

/**
* Wraps the given command with logging that indicates when the command starts and ends. Logs are
* written under the path "Commands/{key}" with a boolean value indicating whether the command is
* currently running (true) or not (false).
*
* @param key A unique key to identify the command in the logs. This should be a descriptive name
* for the command being logged (e.g., "Shoot", "DriveToClump", etc.).
* @param command The Command to wrap with logging.
* @return A new Command that behaves the same as the input command but also logs its execution
* status under "Commands/{key}".
*/
public static Command logCommand(String key, Command command) {
DogLog.log("Commands/" + key, false);

return command
.beforeStarting(() -> DogLog.log("Commands/" + key, true))
.finallyDo(() -> DogLog.log("Commands/" + key, false));
}
}
22 changes: 22 additions & 0 deletions src/main/java/com/team6962/lib/math/ConstantFunction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.team6962.lib.math;

import org.apache.commons.math3.analysis.MultivariateFunction;
import org.apache.commons.math3.analysis.UnivariateFunction;

public class ConstantFunction implements UnivariateFunction, MultivariateFunction {
private final double value;

public ConstantFunction(double value) {
this.value = value;
}

@Override
public double value(double x) {
return value;
}

@Override
public double value(double[] point) {
return value;
}
}
13 changes: 13 additions & 0 deletions src/main/java/com/team6962/lib/math/TranslationalVelocity.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,19 @@ public TranslationalVelocity times(double scalar) {
MetersPerSecond.of(this.y.in(MetersPerSecond) * scalar));
}

/**
* Multiplies this TranslationalVelocity by a Time measure and returns the resulting
* Translation2d.
*
* @param time The Time measure to multiply by
* @return The resulting Translation2d
*/
public Translation2d times(edu.wpi.first.units.measure.Time time) {
return new Translation2d(
this.x.in(MetersPerSecond) * time.in(edu.wpi.first.units.Units.Seconds),
this.y.in(MetersPerSecond) * time.in(edu.wpi.first.units.Units.Seconds));
}

/**
* Divides this TranslationalVelocity by a scalar and returns the result.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import static edu.wpi.first.units.Units.RadiansPerSecond;

import com.team6962.lib.commands.CommandUtil;
import com.team6962.lib.math.TranslationalVelocity;
import com.team6962.lib.swerve.CommandSwerveDrive;
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Subsystem;
import edu.wpi.first.wpilibj2.command.button.Trigger;

/**
Expand Down Expand Up @@ -43,12 +43,15 @@ public TeleopSwerveCommand(CommandSwerveDrive swerveDrive) {

Trigger rotationTrigger =
new Trigger(
() -> isScheduled() && isClearToOverride(swerveDrive.useRotation(), rotationCommand));
() ->
isScheduled()
&& CommandUtil.isClearToOverride(swerveDrive.useRotation(), rotationCommand));
Trigger translationTrigger =
new Trigger(
() ->
isScheduled()
&& isClearToOverride(swerveDrive.useTranslation(), translationCommand));
&& CommandUtil.isClearToOverride(
swerveDrive.useTranslation(), translationCommand));

rotationTrigger.whileTrue(rotationCommand);
translationTrigger.whileTrue(translationCommand);
Expand All @@ -70,19 +73,4 @@ protected CommandSwerveDrive getSwerveDrive() {
* @return The desired field-relative chassis speeds
*/
protected abstract ChassisSpeeds getDrivenVelocity();

/**
* Checks if it is okay to replace the currently active command on a subsystem, and have the given
* command take control instead. A subsystem is clear to override if it has no current command,
* has only its default command running, or is already running the specified command.
*
* @param subsystem The subsystem to check
* @param command The command that wants to take control
* @return True if the subsystem's active command can be safely overridden
*/
public static boolean isClearToOverride(Subsystem subsystem, Command command) {
return subsystem.getCurrentCommand() == null
|| subsystem.getCurrentCommand() == subsystem.getDefaultCommand()
|| subsystem.getCurrentCommand() == command;
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/team6962/lib/swerve/config/TimingConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class TimingConstants implements Cloneable {
*/
public boolean TimesyncControlRequests = false;

/** Whether to minimize logging to improve performance. */
public boolean MinimizeLogging = false;

/** Constructs a TimingConstants object with default values. */
public TimingConstants() {
SignalUpdateRate = Hertz.of(100);
Expand Down Expand Up @@ -83,6 +86,17 @@ public TimingConstants withTimesyncControlRequests(boolean timesyncControlReques
return this;
}

/**
* Sets whether to minimize logging, and returns this TimingConstants for chaining.
*
* @param minimizeLogging True if logging should be minimized
* @return This TimingConstants object
*/
public TimingConstants withMinimizeLogging(boolean minimizeLogging) {
MinimizeLogging = minimizeLogging;
return this;
}

@Override
public TimingConstants clone() {
try {
Expand Down
25 changes: 14 additions & 11 deletions src/main/java/com/team6962/lib/swerve/localization/Gyroscope.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,20 @@ private boolean shouldUseGyroscope() {
public void logTelemetry(String basePath) {
basePath = LoggingUtil.ensureEndsWithSlash(basePath);

DogLog.log(basePath + "IsConnected", gyro.isConnected());
DogLog.log(basePath + "UsingGyroscope", shouldUseGyroscope());

DogLog.log(basePath + "Yaw", getYaw().in(Radians), Radians);
DogLog.log(basePath + "Pitch", getPitch().in(Radians), Radians);
DogLog.log(basePath + "Roll", getRoll().in(Radians), Radians);

DogLog.log(basePath + "YawVelocity", getYawVelocity().in(RadiansPerSecond), RadiansPerSecond);
DogLog.log(
basePath + "PitchVelocity", getPitchVelocity().in(RadiansPerSecond), RadiansPerSecond);
DogLog.log(basePath + "RollVelocity", getRollVelocity().in(RadiansPerSecond), RadiansPerSecond);
if (!constants.Timing.MinimizeLogging) {
DogLog.log(basePath + "IsConnected", gyro.isConnected());
DogLog.log(basePath + "UsingGyroscope", shouldUseGyroscope());

DogLog.log(basePath + "Yaw", getYaw().in(Radians), Radians);
DogLog.log(basePath + "Pitch", getPitch().in(Radians), Radians);
DogLog.log(basePath + "Roll", getRoll().in(Radians), Radians);

DogLog.log(basePath + "YawVelocity", getYawVelocity().in(RadiansPerSecond), RadiansPerSecond);
DogLog.log(
basePath + "PitchVelocity", getPitchVelocity().in(RadiansPerSecond), RadiansPerSecond);
DogLog.log(
basePath + "RollVelocity", getRollVelocity().in(RadiansPerSecond), RadiansPerSecond);
}
}

/**
Expand Down
Loading