summaryrefslogtreecommitdiff
path: root/src/main/java/frc/robot/RobotContainer.java
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2024-02-11 22:48:38 +0200
committerkartofen <mladenovnasko0@gmail.com>2024-02-11 22:48:38 +0200
commit7b58370a6d4174f2e007264c58bebe7868e7fdc3 (patch)
treeb06eafa18052c9dcd8b67579755f2f55dbd216ba /src/main/java/frc/robot/RobotContainer.java
parentde82bb11825e8bc5087f10605b3fe2fd926f1909 (diff)
imu added
Diffstat (limited to 'src/main/java/frc/robot/RobotContainer.java')
-rw-r--r--src/main/java/frc/robot/RobotContainer.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java
index e08bf8d..d91ff78 100644
--- a/src/main/java/frc/robot/RobotContainer.java
+++ b/src/main/java/frc/robot/RobotContainer.java
@@ -5,9 +5,9 @@
package frc.robot;
import edu.wpi.first.math.filter.SlewRateLimiter;
+import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
-import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.subsystems.Drivetrain;
public class RobotContainer
@@ -17,8 +17,8 @@ public class RobotContainer
private final SlewRateLimiter m_speedlimiter = new SlewRateLimiter(3);
private final SlewRateLimiter m_rotlimiter = new SlewRateLimiter(3);
- private final CommandXboxController m_dcontroller =
- new CommandXboxController(Constants.PortDriverController);
+ private final GenericHID m_controller =
+ new GenericHID(Constants.PortDriverController);
public RobotContainer()
{
@@ -27,12 +27,11 @@ public class RobotContainer
private void configureBindings()
{
- // drivetrain controls
m_drive.setDefaultCommand(m_drive.run(() ->
- m_drive.drive(
- m_speedlimiter.calculate(m_dcontroller.getLeftY()) * Constants.DriveMaxSpeed,
- m_rotlimiter.calculate(m_dcontroller.getRightX()) * Constants.DriveMaxAngular
- )));
+ m_drive.drive(
+ m_speedlimiter.calculate(m_controller.getRawAxis(1)) * Constants.DriveMaxSpeed,
+ m_rotlimiter.calculate(m_controller.getRawAxis(2)) * Constants.DriveMaxAngular
+ )));
}
public Command getAutonomousCommand()