Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [



{
"type": "wpilib",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@
"edu.wpi.first.math.proto.*",
"edu.wpi.first.math.**.proto.*",
"edu.wpi.first.math.**.struct.*",
]
],
"java.dependency.enableDependencyCheckup": false
}
2 changes: 1 addition & 1 deletion .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2025",
"projectYear": "2026",
"teamNumber": 1334
}
2 changes: 1 addition & 1 deletion WPILib-License.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2024 FIRST and other WPILib contributors
Copyright (c) 2009-2026 FIRST and other WPILib contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
19 changes: 15 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2025.3.2"
id "edu.wpi.first.GradleRIO" version "2026.2.1"
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

// Force UTF-8 encoding for all Java source files
compileJava {
options.encoding = 'UTF-8'
}
compileTestJava {
options.encoding = 'UTF-8'
}

def ROBOT_MAIN_CLASS = "frc.robot.Main"

// Define my targets (RoboRIO) and artifacts (deployable files)
Expand Down Expand Up @@ -43,11 +51,12 @@ deploy {

def deployArtifact = deploy.targets.roborio.artifacts.frcJava

// Set to true to use debug for JNI.
// Set to true to use debug for all targets including JNI, which will drastically impact
// performance.
wpi.java.debugJni = false

// Set this to true to enable desktop support.
def includeDesktopSupport = false
def includeDesktopSupport = true

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 5.
Expand Down Expand Up @@ -88,7 +97,9 @@ wpi.sim.addDriverstation()
// knows where to look for our Robot Class.
jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
from sourceSets.main.allSource
from('src') { into 'backup/src' }
from('vendordeps') { into 'backup/vendordeps' }
from('build.gradle') { into 'backup' }
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
String frcYear = '2025'
String frcYear = '2026'
File frcHome
if (OperatingSystem.current().isWindows()) {
String publicFolder = System.getenv('PUBLIC')
Expand Down
100 changes: 100 additions & 0 deletions simgui-ds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"keyboardJoysticks": [
{
"axisConfig": [
{
"decKey": 65,
"incKey": 68
},
{
"decKey": 87,
"incKey": 83
},
{
"decKey": 69,
"incKey": 82,
"keyRate": 0.009999999776482582
}
],
"axisCount": 3,
"buttonCount": 4,
"buttonKeys": [
90,
88,
67,
86
],
"povConfig": [
{
"key0": 328,
"key135": 323,
"key180": 322,
"key225": 321,
"key270": 324,
"key315": 327,
"key45": 329,
"key90": 326
}
],
"povCount": 1
},
{
"axisConfig": [
{
"decKey": 74,
"incKey": 76
},
{
"decKey": 73,
"incKey": 75
}
],
"axisCount": 2,
"buttonCount": 4,
"buttonKeys": [
77,
44,
46,
47
],
"povCount": 0
},
{
"axisConfig": [
{
"decKey": 263,
"incKey": 262
},
{
"decKey": 265,
"incKey": 264
}
],
"axisCount": 2,
"buttonCount": 6,
"buttonKeys": [
260,
268,
266,
261,
81,
70
],
"povCount": 0
},
{
"axisCount": 0,
"buttonCount": 0,
"povCount": 0
}
],
"robotJoysticks": [
{
"guid": "Keyboard0"
},
{},
{
"guid": "Keyboard2"
}
]
}
8 changes: 8 additions & 0 deletions src/main/deploy/SWERVE/controllerproperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"angleJoystickRadiusDeadband": 0.05,
"heading": {
"p": 0.0,
"i": 0.0,
"d": 0.0
}
}
1 change: 1 addition & 0 deletions src/main/deploy/SWERVE/modules/Backleft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"location":{"front":-11.125,"left":11.125},"absoluteEncoderOffset":0,"drive":{"type":"talonfx","id":43,"canbus":null},"angle":{"type":"talonfx","id":42,"canbus":null},"encoder":{"type":"cancoder","id":41,"canbus":null},"inverted":{"drive":false,"angle":false}}
1 change: 1 addition & 0 deletions src/main/deploy/SWERVE/modules/Backright.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"location":{"front":-11.125,"left":-11.125},"absoluteEncoderOffset":0,"drive":{"type":"talonfx","id":33,"canbus":null},"angle":{"type":"talonfx","id":32,"canbus":null},"encoder":{"type":"cancoder","id":31,"canbus":null},"inverted":{"drive":false,"angle":false}}
1 change: 1 addition & 0 deletions src/main/deploy/SWERVE/modules/Frontleft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"location":{"front":11.125,"left":11.125},"absoluteEncoderOffset":0,"drive":{"type":"talonfx","id":13,"canbus":null},"angle":{"type":"talonfx","id":12,"canbus":null},"encoder":{"type":"cancoder","id":11,"canbus":null},"inverted":{"drive":false,"angle":false}}
1 change: 1 addition & 0 deletions src/main/deploy/SWERVE/modules/Frontright.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"location":{"front":11.125,"left":-11.125},"absoluteEncoderOffset":0,"drive":{"type":"talonfx","id":23,"canbus":null},"angle":{"type":"talonfx","id":22,"canbus":null},"encoder":{"type":"cancoder","id":21,"canbus":null},"inverted":{"drive":false,"angle":false}}
24 changes: 24 additions & 0 deletions src/main/deploy/SWERVE/modules/physicalproperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"optimalVoltage": 12,
"robotMass": 110.2311,
"wheelGripCoefficientOfFriction": 1.19,
"currentLimit": {
"drive": 40,
"angle": 20
},
"conversionFactors": {
"angle": {
"gearRatio": 21.428571429,
"factor": 0
},
"drive": {
"diameter": 4,
"gearRatio": 6.75,
"factor": 0
}
},
"rampRate": {
"drive": 0.25,
"angle": 0.0
}
}
16 changes: 16 additions & 0 deletions src/main/deploy/SWERVE/modules/pidfproperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"drive": {
"p": 0.0020645,
"i": 0,
"d": 0,
"f": 0,
"iz": 0
},
"angle": {
"p": 0.080645,
"i": 0,
"d": 0.001,
"f": 0,
"iz": 0
}
}
15 changes: 15 additions & 0 deletions src/main/deploy/SWERVE/swervedrive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"imu": {
"type": "pigeon2",
"id": 50,
"canbus": null
},
"invertedIMU": false,
"modules": [
"Frontleft.json",
"Frontright.json",
"Backleft.json",
"Backright.json"
],
"note": "Check IMU inversion."
}
19 changes: 19 additions & 0 deletions src/main/deploy/pathplanner/2026-rebuilt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"game": "Rebuilt",
"field-image": "image.png",
"field-corners": {
"top-left": [
245,
118
],
"bottom-right": [
3942,
1914
]
},
"field-size": [
54.269,
26.474
],
"field-unit": "foot"
}
Binary file added src/main/deploy/pathplanner/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 75 additions & 11 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,80 @@

package frc.robot;

/**
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean
* constants. This class should not be used for any other purpose. All constants should be declared
* globally (i.e. public static). Do not put anything functional in this class.
*
* <p>It is advised to statically import this class (or one of its inner classes) wherever the
* constants are needed, to reduce verbosity.
*/
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;

public final class Constants {
public static class OperatorConstants {
public static final int kDriverControllerPort = 0;
}

public int getId() { return 0; }

public static final class DriveConstants {
public static final double MAX_SPEED_MPS = 4.5;
public static final double MAX_ANGULAR_VELOCITY = Math.PI;
public static final double DEADBAND = 0.05;
public static final double ROTATION_SCALE = 0.5;
public static final double FULL_SPEED_ROTATION_SCALE = 1.0;
public static final double PRECISION_MULTIPLIER = 0.3;
public static final double PRECISION_ROTATION_SCALE = 0.3;

// Speed multiplier bounds for bumper-based speed control
public static final double MIN_SPEED_MULTIPLIER = 0.2;
public static final double MAX_SPEED_MULTIPLIER = 1.0;
public static final double SPEED_MULTIPLIER_STEP = 0.1;
public static final double DEFAULT_SPEED_MULTIPLIER = 0.7;

// Auto constants
public static final double AUTO_MAX_SPEED_MPS = 4.0;
public static final double AUTO_POSITION_TOLERANCE_M = 0.20;
public static final double AUTO_ANGLE_TOLERANCE_DEG = 15.0;
}

public static final class FieldConstants {
// Field dimensions (Rebuilt 2025) - converted from feet to meters
// 54.269 ft = 16.54 m, 26.474 ft = 8.07 m
public static final double FIELD_LENGTH = 16.54;
public static final double FIELD_WIDTH = 8.07;
// starting positions
public static final Pose2d BLUE_ALLIANCE_START = new Pose2d(1.0, 1.0, new Rotation2d(0));
public static final Pose2d RED_ALLIANCE_START = new Pose2d(15.54, 1.0, new Rotation2d(Math.PI));
public static final Pose2d CENTER_START = new Pose2d(8.27, 4.035, new Rotation2d(0)); // Updated to actual field center

// Reef structure (center of field)
public static final double REEF_CENTER_X = 8.27;
public static final double REEF_CENTER_Y = 4.035;
public static final double REEF_RADIUS = 1.5;
public static final double REEF_SAFE_DISTANCE = 2.5;

// Safe zones (away from obstacles)
public static final Pose2d BLUE_SAFE_ZONE = new Pose2d(2.0, 1.5, Rotation2d.kZero);
public static final Pose2d RED_SAFE_ZONE = new Pose2d(FIELD_LENGTH - 2.0, FIELD_WIDTH - 1.5, Rotation2d.fromDegrees(180));

// Coral stations (at field edges)
public static final Pose2d BLUE_CORAL_STATION = new Pose2d(1.2, 7.0, Rotation2d.kZero);
public static final Pose2d RED_CORAL_STATION = new Pose2d(FIELD_LENGTH - 1.2, 1.2, Rotation2d.fromDegrees(180));

// Reef branches (scoring positions) - adjusted for correct field center
public static final Pose2d REEF_FRONT = new Pose2d(8.27, 2.5, Rotation2d.fromDegrees(0));
public static final Pose2d REEF_LEFT = new Pose2d(7.2, 5.0, Rotation2d.fromDegrees(120));
public static final Pose2d REEF_RIGHT = new Pose2d(9.3, 5.0, Rotation2d.fromDegrees(60));

// Processor station
public static final Pose2d PROCESSOR = new Pose2d(13.5, 4.035, Rotation2d.fromDegrees(90));

// Convenient teleop rest position near the hub
public static final Pose2d HUB_REST_POSITION = new Pose2d(8.27, 4.5, Rotation2d.kZero);

// Field boundaries (with safety margin)
public static final double FIELD_MARGIN = 0.5; // meters from edge
public static final double MIN_X = FIELD_MARGIN;
public static final double MAX_X = FIELD_LENGTH - FIELD_MARGIN;
public static final double MIN_Y = FIELD_MARGIN;
public static final double MAX_Y = FIELD_WIDTH - FIELD_MARGIN;
}

public static final class ControllerConstants {
public static final int DRIVER_CONTROLLER_PORT = 0;
public static final int OPERATOR_CONTROLLER_PORT = 1;
public static final double TRIGGER_THRESHOLD = 0.5;
}
}
Loading
Loading