swerve qui fonctionne
This commit is contained in:
@@ -14,6 +14,7 @@ import com.pathplanner.lib.auto.AutoBuilder;
|
||||
import com.pathplanner.lib.auto.NamedCommands;
|
||||
|
||||
import edu.wpi.first.cameraserver.CameraServer;
|
||||
import edu.wpi.first.math.MathUtil;
|
||||
import edu.wpi.first.math.geometry.Rotation2d;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
@@ -59,9 +60,9 @@ public class RobotContainer {
|
||||
drivetrain.setDefaultCommand(
|
||||
// Drivetrain will execute this command periodically
|
||||
drivetrain.applyRequest(() ->
|
||||
drive.withVelocityX(-manette1.getLeftY() * MaxSpeed) // Drive forward with negative Y (forward)
|
||||
.withVelocityY(-manette1.getLeftX() * MaxSpeed) // Drive left with negative X (left)
|
||||
.withRotationalRate(-manette1.getRightX() * MaxAngularRate) // Drive counterclockwise with negative X (left)
|
||||
drive.withVelocityX(MathUtil.applyDeadband(-manette1.getLeftY(), 0.5)) // Drive forward with negative Y (forward)
|
||||
.withVelocityY(MathUtil.applyDeadband(-manette1.getLeftX(), 0.5)) // Drive left with negative X (left)
|
||||
.withRotationalRate(MathUtil.applyDeadband(-manette1.getRightX()*MaxAngularRate, 0.5)) // Drive counterclockwise with negative X (left)
|
||||
)
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user