Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vision sim #103

Merged
merged 78 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
32e3ea5
code is cooked
Ishan1522 Nov 4, 2024
5abf7b6
what did i do :sob:
Ishan1522 Nov 4, 2024
0e65e23
fix typo
Ishan1522 Nov 4, 2024
ceb11cf
ishan changes before I setal his computer
Ishan1522 Nov 4, 2024
2443f0f
format
Ishan1522 Nov 5, 2024
eb783a9
im actually so dumb
Ishan1522 Nov 5, 2024
b6fb3c6
and this proves it
Ishan1522 Nov 5, 2024
43a1667
push whatever this is
Ishan1522 Nov 6, 2024
82c2f25
im actually such a bad programmer
Ishan1522 Nov 6, 2024
ef0232b
huh
Ishan1522 Nov 6, 2024
be16c07
push changes
Ishan1522 Nov 7, 2024
71d4040
idk what this is
Ishan1522 Nov 8, 2024
bb46860
yall are cooked
Ishan1522 Nov 12, 2024
ffc77ad
changes
Ishan1522 Nov 13, 2024
1d5fad8
sim stuffs
Ishan1522 Nov 13, 2024
afc0139
no errors yay
Ishan1522 Nov 14, 2024
d94714e
format
Ishan1522 Nov 14, 2024
38ce706
naming is wip
Ishan1522 Nov 14, 2024
3ee584c
fix things and stuff
Ishan1522 Nov 14, 2024
e27a644
huh
Ishan1522 Nov 14, 2024
cf81365
epic
Ishan1522 Nov 14, 2024
5a19eed
add Limelight enum
Ishan1522 Nov 15, 2024
ff2f5aa
format
Ishan1522 Nov 15, 2024
c4135f0
idk i did smthn probably
Ishan1522 Nov 15, 2024
92c19f0
fix dumbass ll
Ishan1522 Nov 16, 2024
dfc9643
format
Ishan1522 Nov 16, 2024
ce8decb
idk im gonna switch branches now
Ishan1522 Nov 18, 2024
9e6415d
progresso
Ishan1522 Nov 19, 2024
6669514
more progressisssismo
Ishan1522 Nov 19, 2024
d8df64a
huh
Ishan1522 Nov 19, 2024
034d513
i am mucho sleepy
Ishan1522 Nov 20, 2024
85ee27c
enum update
Ishan1522 Nov 20, 2024
ccf3ddc
more enum stuff
Ishan1522 Nov 20, 2024
d3f0f7b
huh?
Ishan1522 Nov 20, 2024
70f27e2
constants and methods and such
Ishan1522 Nov 21, 2024
d56de83
geom util
Ishan1522 Nov 22, 2024
63f1a54
sim like moderatly works
Ishan1522 Nov 22, 2024
60acab8
mucho progresso
Ishan1522 Nov 22, 2024
04fbd0f
fix gyro
Ishan1522 Nov 23, 2024
afaa62c
i cooked
Ishan1522 Nov 24, 2024
f9d9134
format
Ishan1522 Nov 24, 2024
8733a45
i is hyped
Ishan1522 Nov 25, 2024
ee3f22e
wtf
Ishan1522 Nov 25, 2024
7a51f3f
im such a fucking dumbass
Ishan1522 Nov 25, 2024
4247cb4
fuuuuuuuuuuuuuuuuuuuuuuuuuuck
Ishan1522 Nov 25, 2024
ac7c3af
ok im not stupid thank god
Ishan1522 Nov 25, 2024
20d863a
i give uo :sob:
Ishan1522 Nov 25, 2024
8e68d1f
un poquito de progresso
Ishan1522 Nov 26, 2024
ee832b2
it works thats fucking crazy bro
Ishan1522 Nov 26, 2024
da02178
actually doesnt work prolly gotta rewrite evrything
Ishan1522 Nov 27, 2024
cd269d1
fixes frfr
Ishan1522 Nov 28, 2024
ac8226b
typo
Ishan1522 Nov 28, 2024
75cf724
format
Ishan1522 Nov 28, 2024
6751da8
push fixes
Ishan1522 Nov 29, 2024
bfb0199
fix ci
Ishan1522 Nov 29, 2024
2a4080f
update
Ishan1522 Nov 29, 2024
5d6b0c5
fixy (#82)
Ishan1522 Dec 2, 2024
4737dfb
i fixed a thing
Ishan1522 Dec 2, 2024
94d1b2f
cleanup
Ishan1522 Dec 4, 2024
bfd17cc
Merge branch 'main' of https://github.com/TitaniumTigers4829/offseaso…
Ishan1522 Dec 9, 2024
cf5ef88
thingy
Ishan1522 Dec 9, 2024
6af9077
remove buildconstants from gitignore bc it is cooking CI
Ishan1522 Dec 9, 2024
f711faf
add it back
Ishan1522 Dec 9, 2024
faf0b4c
testing code
Ishan1522 Dec 9, 2024
2285b42
what is sdis shit
Ishan1522 Dec 10, 2024
e33b2a1
redid setpoint generation
Ishan1522 Dec 13, 2024
4973c6b
update GradleRIO version to beta-3 and refactor voltage calculations …
Ishan1522 Dec 21, 2024
f90e65a
refactor gyro interface and simulation classes; move to new package s…
Ishan1522 Dec 24, 2024
e04dec9
refactor SwerveDrive and SwerveModule; adjust motor configurations an…
Ishan1522 Dec 25, 2024
94c7ff7
tuned sim pid
Ishan1522 Jan 2, 2025
3c7b3ac
idk msthn
Ishan1522 Jan 2, 2025
509eeeb
it works lmao
Ishan1522 Jan 2, 2025
ad8a3ac
update robot mode to simulation and improve thread priority handling
Ishan1522 Jan 3, 2025
79a886e
Merge branch '3rd-time-is-the-charm-for-setpoint-generation-plz' of h…
Ishan1522 Jan 3, 2025
bf661f9
wtf why does it work :sob:
Ishan1522 Jan 4, 2025
c1d909f
im gonna need to rewrite this shit - vision sim works but is high key…
Ishan1522 Jan 4, 2025
f5e4221
Merge branch 'main' of https://github.com/TitaniumTigers4829/offseaso…
Ishan1522 Jan 4, 2025
46a77b0
Formatting fixes
github-actions[bot] Jan 4, 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
158 changes: 157 additions & 1 deletion ascopeAssets/Robot_Offseason/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,159 @@
{
"name": "offseason"
"name": "butch",
"sourceUrl": "https://cad.onshape.com/documents/8f873ac3a74d8fd06cda742a/w/88e5df6f1994d26987d1f315/e/eb5a3c451ca2580d6f4169f7",
"rotations": [
{
"axis": "x",
"degrees": 90
},
{
"axis": "z",
"degrees": 0
}
],
"position": [
0,
0,
0.04
],
"cameras": [
{
"name": "FrontCam",
"position": [
0.3,
0.0,
0.2
],
"fov": 59.99999999999999,
"rotations": [
{
"axis": "y",
"degrees": -29.999999999999996
},
{
"axis": "z",
"degrees": 0.0
}
],
"resolution": [
640,
480
]
},
{
"name": "FrontLeftCam",
"position": [
0.25,
0.3,
0.2
],
"fov": 59.99999999999999,
"rotations": [
{
"axis": "y",
"degrees": -30.000000000000004
},
{
"axis": "z",
"degrees": 29.999999999999996
}
],
"resolution": [
640,
480
]
},
{
"name": "FrontRightCam",
"position": [
0.25,
-0.3,
0.2
],
"fov": 59.99999999999999,
"rotations": [
{
"axis": "y",
"degrees": -29.999999999999996
},
{
"axis": "z",
"degrees": -30.000000000000004
}
],
"resolution": [
640,
480
]
},
{
"name": "BackLeftCam",
"position": [
0.25,
0.05,
0.2
],
"fov": 59.99999999999999,
"rotations": [
{
"axis": "y",
"degrees": -35.000000000000014
},
{
"axis": "z",
"degrees": 150.0
}
],
"resolution": [
640,
480
]
},
{
"name": "BackRightCam",
"position": [
0.25,
-0.05,
0.2
],
"fov": 59.99999999999999,
"rotations": [
{
"axis": "y",
"degrees": -35.00000000000001
},
{
"axis": "z",
"degrees": -150.0
}
],
"resolution": [
640,
480
]
}
],
"components": [
{
"zeroedRotations": [
{
"axis": "x",
"degrees": 180
},
{
"axis": "y",
"degrees": 60
},
{
"axis": "z",
"degrees": 0
}
],
"zeroedPosition": [
0.25,
0,
-0.02
]
}
]
}
Binary file modified ascopeAssets/Robot_Offseason/model.glb
Binary file not shown.
17 changes: 17 additions & 0 deletions src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package frc.robot;

/** Automatically generated file containing build version information. */
public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "offseason-robot-code-2024-1";
public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 534;
public static final String GIT_SHA = "bf661f9f8d1233875f154280c54da2e4c3473fed";
public static final String GIT_DATE = "2025-01-03 21:20:40 EST";
public static final String GIT_BRANCH = "vision-sim";
public static final String BUILD_DATE = "2025-01-04 02:29:02 EST";
public static final long BUILD_UNIX_TIME = 1735975742416L;
public static final int DIRTY = 1;

private BuildConstants() {}
}
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import frc.robot.subsystems.swerve.SwerveConstants.DriveConstants;
import frc.robot.subsystems.swerve.SwerveConstants.ModuleConstants;

/** Values are statically stored here used globally throughout the code. */
public final class Constants {

public static final class LogPaths {
public static final String SYSTEM_PERFORMANCE_PATH = "SystemPerformance/";
public static final String PHYSICS_SIMULATION_PATH = "MaplePhysicsSimulation/";
public static final String APRIL_TAGS_VISION_PATH = "Vision/AprilTags/";
}

public static final Mode currentMode = Mode.SIM;
public static final Mode CURRENT_MODE = Mode.SIM;

public static enum Mode {
/** Running on a real robot. */
Expand Down Expand Up @@ -133,8 +133,8 @@ public class SimulationConstants {
public static final class FieldConstants {
// TODO: Now that I think about it, I'm pretty sure these measurements stay the same every year,
// so consider setting them in the base code
public static final double FIELD_LENGTH_METERS = Units.inchesToMeters(0 - 9);
public static final double FIELD_WIDTH_METERS = Units.inchesToMeters(0 - 9);
public static final double FIELD_LENGTH_METERS = Units.inchesToMeters(653);
public static final double FIELD_WIDTH_METERS = Units.inchesToMeters(325);
}

public static final class JoystickConstants {
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,48 @@
*/
public class Robot extends LoggedRobot {
private Command m_autonomousCommand;
private RobotContainer m_robotContainer;

Check warning on line 22 in src/main/java/frc/robot/Robot.java

View workflow job for this annotation

GitHub Actions / Lint

Field 'm_robotContainer' may be declared final

Reports non-final fields whose value never changes once object initialization ends, and hence may be marked final. Note that this rule does not enforce that the field value be deeply immutable itself. An object can still have mutable state, even if all its member fields are declared final. This is referred to as shallow immutability. For more information on mutability, see *Effective Java, 3rd Edition, Item 17: Minimize mutability*. Limitations: We can only check private fields for now. ImmutableField (Priority: 3, Ruleset: Design) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_design.html#immutablefield

Check warning on line 22 in src/main/java/frc/robot/Robot.java

View workflow job for this annotation

GitHub Actions / Lint

Field 'm_robotContainer' may be declared final

Reports non-final fields whose value never changes once object initialization ends, and hence may be marked final. Note that this rule does not enforce that the field value be deeply immutable itself. An object can still have mutable state, even if all its member fields are declared final. This is referred to as shallow immutability. For more information on mutability, see *Effective Java, 3rd Edition, Item 17: Minimize mutability*. Limitations: We can only check private fields for now. ImmutableField (Priority: 3, Ruleset: Design) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_design.html#immutablefield

public Robot() {
// Record metadata
// Logger.recordMetadata("ProjectName", BuildConstants.MAVEN_NAME);
// Logger.recordMetadata("BuildDate", BuildConstants.BUILD_DATE);
// Logger.recordMetadata("GitSHA", BuildConstants.GIT_SHA);
// Logger.recordMetadata("GitDate", BuildConstants.GIT_DATE);
// Logger.recordMetadata("GitBranch", BuildConstants.GIT_BRANCH);
// switch (BuildConstants.DIRTY) {
// case 0:
// Logger.recordMetadata("GitDirty", "All changes committed");
// break;
// case 1:
// Logger.recordMetadata("GitDirty", "Uncomitted changes");
// break;
// default:
// Logger.recordMetadata("GitDirty", "Unknown");
// break;
// }
Logger.recordMetadata("BuildDate", BuildConstants.BUILD_DATE);
Logger.recordMetadata("GitSHA", BuildConstants.GIT_SHA);
Logger.recordMetadata("GitDate", BuildConstants.GIT_DATE);
Logger.recordMetadata("GitBranch", BuildConstants.GIT_BRANCH);
switch (BuildConstants.DIRTY) {
case 0:
Logger.recordMetadata("GitDirty", "All changes committed");
break;
case 1:
Logger.recordMetadata("GitDirty", "Uncomitted changes");
break;
default:
Logger.recordMetadata("GitDirty", "Unknown");
break;
}

// Set up data receivers & replay source
switch (Constants.currentMode) {
switch (Constants.CURRENT_MODE) {
case REAL:
// Running on a real robot, log to a USB stick ("/U/logs")
Logger.addDataReceiver(new WPILOGWriter());
// Logger.addDataReceiver(new WPILOGWriter());
Logger.addDataReceiver(new NT4Publisher());
break;

case SIM:
// Running a physics simulator, log to NT
Logger.addDataReceiver(new NT4Publisher());
break;

case REPLAY:
// Replaying a log, set up replay source
setUseTiming(false); // Run as fast as possible
String logPath = LogFileUtil.findReplayLog();
Logger.setReplaySource(new WPILOGReader(logPath));
Logger.addDataReceiver(new WPILOGWriter(LogFileUtil.addPathSuffix(logPath, "_sim")));
break;
}

Check warning on line 63 in src/main/java/frc/robot/Robot.java

View workflow job for this annotation

GitHub Actions / Lint

Switch statements or expressions should be exhaustive, add a default case (or missing enum branches)

Switch statements should be exhaustive, to make their control flow easier to follow. This can be achieved by adding a `default` case, or, if the switch is on an enum type, by ensuring there is one switch branch for each enum constant. This rule doesn't consider Switch Statements, that use Pattern Matching, since for these the compiler already ensures that all cases are covered. The same is true for Switch Expressions, which are also not considered by this rule. NonExhaustiveSwitch (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#nonexhaustiveswitch

Check warning on line 63 in src/main/java/frc/robot/Robot.java

View workflow job for this annotation

GitHub Actions / Lint

Switch statements or expressions should be exhaustive, add a default case (or missing enum branches)

Switch statements should be exhaustive, to make their control flow easier to follow. This can be achieved by adding a `default` case, or, if the switch is on an enum type, by ensuring there is one switch branch for each enum constant. This rule doesn't consider Switch Statements, that use Pattern Matching, since for these the compiler already ensures that all cases are covered. The same is true for Switch Expressions, which are also not considered by this rule. NonExhaustiveSwitch (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#nonexhaustiveswitch

// Start AdvantageKit logger
Logger.start();
Expand Down
37 changes: 22 additions & 15 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import frc.robot.subsystems.swerve.module.ModuleInterface;
import frc.robot.subsystems.swerve.module.PhysicalModule;
import frc.robot.subsystems.swerve.module.SimulatedModule;
import frc.robot.subsystems.vision.PhysicalVision;
import frc.robot.subsystems.vision.SimulatedVision;
import frc.robot.subsystems.vision.Vision;
import frc.robot.subsystems.vision.VisionIO;
import frc.robot.subsystems.vision.VisionIOReal;
import frc.robot.subsystems.vision.VisionInterface;
import java.util.function.DoubleSupplier;
import org.littletonrobotics.junction.Logger;

Expand All @@ -51,7 +52,7 @@
// private final XboxController driverController = new XboxController(0);

public RobotContainer() {
switch (Constants.currentMode) {
switch (Constants.CURRENT_MODE) {
case REAL -> {
/* Real robot, instantiate hardware IO implementations */

Expand All @@ -67,7 +68,7 @@
new PhysicalModule(SwerveConstants.moduleConfigs[1]),
new PhysicalModule(SwerveConstants.moduleConfigs[2]),
new PhysicalModule(SwerveConstants.moduleConfigs[3]));
visionSubsystem = new Vision(new VisionIOReal());
visionSubsystem = new Vision(new PhysicalVision());
}

case SIM -> {
Expand All @@ -85,8 +86,8 @@
DriveConstants.TRACK_WIDTH + .2,
DriveConstants.WHEEL_BASE + .2,
SwerveModuleSimulation.getModule(
DCMotor.getFalcon500(1),
DCMotor.getFalcon500(1),
DCMotor.getKrakenX60(1).withReduction(ModuleConstants.DRIVE_GEAR_RATIO),
DCMotor.getFalcon500(1).withReduction(11),
60,
WHEEL_GRIP.TIRE_WHEEL,
ModuleConstants.DRIVE_GEAR_RATIO),
Expand All @@ -105,16 +106,17 @@
new SimulatedModule(swerveDriveSimulation.getModules()[2]),
new SimulatedModule(swerveDriveSimulation.getModules()[3]));

// TODO: add sim impl
visionSubsystem = new Vision(new VisionIO() {});
visionSubsystem =
new Vision(
new SimulatedVision(() -> swerveDriveSimulation.getSimulatedDriveTrainPose()));

SimulatedField.getInstance().resetFieldForAuto();
resetFieldAndOdometryForAuto(
new Pose2d(1.3980597257614136, 5.493067741394043, Rotation2d.fromRadians(3.1415)));
}

default -> {
visionSubsystem = new Vision(new VisionIO() {});
visionSubsystem = new Vision(new VisionInterface() {});
/* Replayed robot, disable IO implementations */

/* physics simulations are also not needed */
Expand All @@ -141,7 +143,7 @@
updateFieldSimAndDisplay();
}

swerveDrive.periodic();
// swerveDrive.periodic();
swerveDrive.setPose(startingPose);
}

Expand All @@ -164,16 +166,16 @@
DoubleSupplier driverRightStickX = driverController::getRightX;
DoubleSupplier driverLeftStick[] =
new DoubleSupplier[] {
() -> JoystickUtil.modifyAxisCubedPolar(driverLeftStickX, driverLeftStickY)[0],
() -> JoystickUtil.modifyAxisCubedPolar(driverLeftStickX, driverLeftStickY)[1]
() -> JoystickUtil.modifyAxisPolar(driverLeftStickX, driverLeftStickY, 3)[0],
() -> JoystickUtil.modifyAxisPolar(driverLeftStickX, driverLeftStickY, 3)[1]
};

DoubleSupplier operatorLeftStickX = operatorController::getLeftX;

Check warning on line 173 in src/main/java/frc/robot/RobotContainer.java

View workflow job for this annotation

GitHub Actions / Lint

Avoid unused local variables such as 'operatorLeftStickX'.

Detects when a local variable is declared and/or assigned, but not used. Variables whose name starts with `ignored` or `unused` are filtered out. UnusedLocalVariable (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#unusedlocalvariable

Check warning on line 173 in src/main/java/frc/robot/RobotContainer.java

View workflow job for this annotation

GitHub Actions / Lint

Avoid unused local variables such as 'operatorLeftStickX'.

Detects when a local variable is declared and/or assigned, but not used. Variables whose name starts with `ignored` or `unused` are filtered out. UnusedLocalVariable (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#unusedlocalvariable
DoubleSupplier operatorRightStickY = operatorController::getRightY;

Check warning on line 174 in src/main/java/frc/robot/RobotContainer.java

View workflow job for this annotation

GitHub Actions / Lint

Avoid unused local variables such as 'operatorRightStickY'.

Detects when a local variable is declared and/or assigned, but not used. Variables whose name starts with `ignored` or `unused` are filtered out. UnusedLocalVariable (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#unusedlocalvariable

Check warning on line 174 in src/main/java/frc/robot/RobotContainer.java

View workflow job for this annotation

GitHub Actions / Lint

Avoid unused local variables such as 'operatorRightStickY'.

Detects when a local variable is declared and/or assigned, but not used. Variables whose name starts with `ignored` or `unused` are filtered out. UnusedLocalVariable (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#unusedlocalvariable

Trigger driverRightBumper = new Trigger(driverController.rightBumper());
Trigger driverRightDirectionPad = new Trigger(driverController.pov(90));
Trigger driverDownDirectionPad = new Trigger(driverController.pov(180));

Check warning on line 178 in src/main/java/frc/robot/RobotContainer.java

View workflow job for this annotation

GitHub Actions / Lint

Avoid unused local variables such as 'driverDownDirectionPad'.

Detects when a local variable is declared and/or assigned, but not used. Variables whose name starts with `ignored` or `unused` are filtered out. UnusedLocalVariable (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#unusedlocalvariable

Check warning on line 178 in src/main/java/frc/robot/RobotContainer.java

View workflow job for this annotation

GitHub Actions / Lint

Avoid unused local variables such as 'driverDownDirectionPad'.

Detects when a local variable is declared and/or assigned, but not used. Variables whose name starts with `ignored` or `unused` are filtered out. UnusedLocalVariable (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.9.0/pmd_rules_java_bestpractices.html#unusedlocalvariable
Trigger driverLeftDirectionPad = new Trigger(driverController.pov(270));

// // autodrive
Expand Down Expand Up @@ -214,7 +216,7 @@
visionSubsystem,
driverLeftStick[1],
driverLeftStick[0],
() -> JoystickUtil.modifyAxisCubed(driverRightStickX),
() -> JoystickUtil.modifyAxis(driverRightStickX, 3),
() -> !driverRightBumper.getAsBoolean(),
() -> driverLeftBumper.getAsBoolean());
swerveDrive.setDefaultCommand(driveCommand);
Expand Down Expand Up @@ -248,9 +250,14 @@
swerveDrive.getPose().getX(),
swerveDrive.getPose().getY(),
Rotation2d.fromDegrees(swerveDrive.getAllianceAngleOffset())))));
driverController
.x()
.onTrue(
new InstantCommand(
() -> swerveDrive.setPose(swerveDriveSimulation.getSimulatedDriveTrainPose())));
// // // Reset robot odometry based on vision pose measurement from april tags
// driverLeftDirectionPad.onTrue(new InstantCommand(() ->
// swerveDrive.resetOdometry(visionSubsystem.getLastSeenPose())));
driverLeftDirectionPad.onTrue(
new InstantCommand(() -> swerveDrive.setPose(visionSubsystem.getLastSeenPose())));
// // driverLeftDpad.onTrue(new InstantCommand(() -> swerveDrive.resetOdometry(new
// Pose2d(15.251774787902832, 5.573054313659668, Rotation2d.fromRadians(3.14159265)))));
// // driverBButton.whileTrue(new ShootPass(swerveDrive, shooterSubsystem, pivotSubsystem,
Expand Down
Loading
Loading