File tree Expand file tree Collapse file tree
TeamCode/src/main/java/org/mrpsvt/capital_robotics Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .mrpsvt .capital_robotics .control ;
22
3+ import com .qualcomm .robotcore .hardware .Gamepad ;
4+ import com .qualcomm .robotcore .hardware .HardwareMap ;
35import com .seattlesolvers .solverslib .gamepad .GamepadEx ;
46
57public class ControlMap {
68
79 public GamepadEx driver1 ;
810 public GamepadEx driver2 ;
11+
12+ public ControlMap (Gamepad gamepad1 , Gamepad gamepad2 ) {
13+ driver1 = new GamepadEx (gamepad1 );
14+ driver2 = new GamepadEx (gamepad2 );
15+ }
916}
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ public class DriveBase {
2222 public DriveBase (HardwareMap hardwareMap ) {
2323 this .hardwareMap = hardwareMap ;
2424 this .mecanum = initDriveBase ();
25- this .imu = initIMU ();
2625 }
2726
2827 public MecanumDrive initDriveBase () {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public class DefaultOpmode extends OpMode {
2222 @ Override
2323 public void init () {
2424 DriveBase driveBase = new DriveBase (hardwareMap );
25- controls = new ControlMap ();
25+ controls = new ControlMap (gamepad1 , gamepad2 );
2626 drive = driveBase .mecanum ;
2727 imu = driveBase .imu ;
2828 driveConstants = new DriveConstants ();
@@ -32,8 +32,8 @@ public void init() {
3232 public void loop () {
3333 if (Objects .equals (driveConstants .robotDriveMode , DriveConstants .ROBOT_CENTRIC )) {
3434 drive .driveRobotCentric (
35- controls .driver1 .getLeftY () * driveConstants .forwardSpeed ,
36- controls .driver1 .getLeftX () * driveConstants .strafeSpeed ,
35+ controls .driver1 .getLeftX () * driveConstants .forwardSpeed ,
36+ controls .driver1 .getLeftY () * driveConstants .strafeSpeed ,
3737 controls .driver1 .getRightX () * driveConstants .turnSpeed
3838 );
3939 } else if (Objects .equals (driveConstants .robotDriveMode , DriveConstants .FIELD_CENTRIC )) {
You can’t perform that action at this time.
0 commit comments