From 8106ad936e0146e4b7ab4be1fcdefb8d6b0f1495 Mon Sep 17 00:00:00 2001 From: Linden <50274080+liulinden@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:23:53 -0800 Subject: [PATCH] fieldrelative stuff --- src/main/java/frc/robot/commands/AutoRotateTo.java | 2 +- .../SwerveRemoteOperation/SwerveDriveXboxControl.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/commands/AutoRotateTo.java b/src/main/java/frc/robot/commands/AutoRotateTo.java index bc8f3fc..c412dcb 100644 --- a/src/main/java/frc/robot/commands/AutoRotateTo.java +++ b/src/main/java/frc/robot/commands/AutoRotateTo.java @@ -70,7 +70,7 @@ public void execute() { ChassisSpeeds speeds = subsystem.getDesiredState(); speeds.omegaRadiansPerSecond=turnspeed; - subsystem.setDesiredState(speeds); + subsystem.setDesiredState(speeds,true); } /** diff --git a/src/main/java/frc/robot/commands/SwerveRemoteOperation/SwerveDriveXboxControl.java b/src/main/java/frc/robot/commands/SwerveRemoteOperation/SwerveDriveXboxControl.java index 8f2a9ec..a53e65f 100644 --- a/src/main/java/frc/robot/commands/SwerveRemoteOperation/SwerveDriveXboxControl.java +++ b/src/main/java/frc/robot/commands/SwerveRemoteOperation/SwerveDriveXboxControl.java @@ -31,9 +31,7 @@ public class SwerveDriveXboxControl extends Command { public SwerveDriveXboxControl(SwerveDrivetrain drivetrain, CommandXboxController driverXboxController) { this.drivetrain = drivetrain; this.controller = driverXboxController; - - //not sure if this code in right place - xboxPID = new PIDController( + this.xboxPID = new PIDController( ControllerConstants.CONTROLLER_PID_P, ControllerConstants.CONTROLLER_PID_I, ControllerConstants.CONTROLLER_PID_D @@ -81,7 +79,7 @@ public void execute() { - drivetrain.setDesiredState(speeds); + drivetrain.setDesiredState(speeds, true); }