9
9
import edu .wpi .first .math .kinematics .ChassisSpeeds ;
10
10
import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
11
11
import edu .wpi .first .wpilibj2 .command .Command ;
12
+ import frc .robot .Constants ;
12
13
import frc .robot .Constants .Dimensoes ;
13
- import frc .robot .Constants .Tracao ;
14
+ import frc .robot .Constants .SwerveConfigs ;
14
15
import frc .robot .subsystems .SwerveSubsystem ;
15
16
16
17
import java .util .List ;
@@ -99,7 +100,7 @@ public void execute()
99
100
100
101
//Dont overwrite a button press
101
102
if (headingX == 0 && headingY == 0 && Math .abs (headingAdjust .getAsDouble ()) > 0 ){
102
- newHeading = Rotation2d .fromRadians (Tracao . TURN_CONSTANT * -headingAdjust .getAsDouble ())
103
+ newHeading = Rotation2d .fromRadians (Constants . Dimensoes . MAX_ANGULAR_SPEED * -headingAdjust .getAsDouble ())
103
104
.plus (swerve .getHeading ());
104
105
headingX = newHeading .getSin ();
105
106
headingY = newHeading .getCos ();
@@ -128,9 +129,9 @@ public void execute()
128
129
Translation2d translation = SwerveController .getTranslation2d (desiredSpeeds );
129
130
130
131
// Caso essa função seja verdadeira a aceleração do robô será limitada
131
- if (Tracao .accelCorrection ) {
132
+ if (SwerveConfigs .accelCorrection ) {
132
133
translation = SwerveMath .limitVelocity (translation , swerve .getFieldVelocity (), swerve .getPose (),
133
- Dimensoes .LOOP_TIME , Dimensoes .ROBOT_MASS ,
134
+ Dimensoes .LOOP_TIME , Dimensoes .ROBOT_MASS ,
134
135
List .of (Dimensoes .CHASSIS ),
135
136
swerve .getSwerveDriveConfiguration ());
136
137
@@ -141,7 +142,7 @@ public void execute()
141
142
142
143
143
144
// Make the robot move
144
- swerve .drive (translation , desiredSpeeds .omegaRadiansPerSecond , Tracao . fieldRelative );
145
+ swerve .drive (translation , desiredSpeeds .omegaRadiansPerSecond , true );
145
146
}
146
147
147
148
// Called once the command ends or is interrupted.
0 commit comments