Skip to content

Commit ff09a22

Browse files
authored
Merge pull request #20 from IgniteRobotics/chore/drivetrain-canrange
Added canrange config to drivetrain subsystem
2 parents 02f4781 + f1f02cc commit ff09a22

File tree

15 files changed

+108
-44
lines changed

15 files changed

+108
-44
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,4 @@ compile_commands.json
186186
# Eclipse generated file for annotation processors
187187
.factorypath
188188
.java-version
189+
src/main/java/frc/robot/BuildConstants.java

src/main/deploy/pathplanner/autos/Plus Auto.auto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
]
3232
}
3333
},
34-
"resetOdom": true,
34+
"resetOdom": false,
3535
"folder": "Test Autos",
3636
"choreoAuto": false
3737
}

src/main/deploy/pathplanner/autos/Rotate and Move Auto.auto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
]
2020
}
2121
},
22-
"resetOdom": true,
22+
"resetOdom": false,
2323
"folder": "Test Autos",
2424
"choreoAuto": false
2525
}

src/main/deploy/pathplanner/autos/Square Auto.auto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
]
3232
}
3333
},
34-
"resetOdom": true,
34+
"resetOdom": false,
3535
"folder": "Test Autos",
3636
"choreoAuto": false
3737
}

src/main/deploy/pathplanner/paths/Square 1.path

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"pointTowardsZones": [],
3434
"eventMarkers": [],
3535
"globalConstraints": {
36-
"maxVelocity": 3.0,
36+
"maxVelocity": 1.0,
3737
"maxAcceleration": 3.0,
3838
"maxAngularVelocity": 540.0,
3939
"maxAngularAcceleration": 720.0,
@@ -50,5 +50,5 @@
5050
"velocity": 0,
5151
"rotation": 0.0
5252
},
53-
"useDefaultConstraints": true
53+
"useDefaultConstraints": false
5454
}

src/main/deploy/pathplanner/paths/Square 2.path

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"pointTowardsZones": [],
3434
"eventMarkers": [],
3535
"globalConstraints": {
36-
"maxVelocity": 3.0,
36+
"maxVelocity": 1.0,
3737
"maxAcceleration": 3.0,
3838
"maxAngularVelocity": 540.0,
3939
"maxAngularAcceleration": 720.0,
@@ -50,5 +50,5 @@
5050
"velocity": 0,
5151
"rotation": 0.0
5252
},
53-
"useDefaultConstraints": true
53+
"useDefaultConstraints": false
5454
}

src/main/deploy/pathplanner/paths/Square 3.path

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"pointTowardsZones": [],
3434
"eventMarkers": [],
3535
"globalConstraints": {
36-
"maxVelocity": 3.0,
36+
"maxVelocity": 1.0,
3737
"maxAcceleration": 3.0,
3838
"maxAngularVelocity": 540.0,
3939
"maxAngularAcceleration": 720.0,
@@ -50,5 +50,5 @@
5050
"velocity": 0,
5151
"rotation": 0.0
5252
},
53-
"useDefaultConstraints": true
53+
"useDefaultConstraints": false
5454
}

src/main/deploy/pathplanner/paths/Square 4.path

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"pointTowardsZones": [],
3434
"eventMarkers": [],
3535
"globalConstraints": {
36-
"maxVelocity": 3.0,
36+
"maxVelocity": 1.0,
3737
"maxAcceleration": 3.0,
3838
"maxAngularVelocity": 540.0,
3939
"maxAngularAcceleration": 720.0,
@@ -50,5 +50,5 @@
5050
"velocity": 0,
5151
"rotation": 0.0
5252
},
53-
"useDefaultConstraints": true
53+
"useDefaultConstraints": false
5454
}

src/main/java/frc/robot/BuildConstants.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/main/java/frc/robot/RobotContainer.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
import edu.wpi.first.wpilibj2.command.Command;
1414
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
1515
import edu.wpi.first.wpilibj2.command.button.RobotModeTriggers;
16+
import frc.robot.commands.DriveBySpeed;
1617
import frc.robot.commands.WheelSlipTest;
1718
import frc.robot.subsystems.climber.ClimberSubsystem;
1819
import frc.robot.subsystems.drive.DriveConstants;
20+
import frc.robot.subsystems.drive.DrivePreferences;
1921
import frc.robot.subsystems.drive.DrivetrainSubsystem;
2022
import frc.robot.subsystems.indexer.IndexerSubsystem;
2123
import frc.robot.subsystems.intake.IntakeSubsystem;
@@ -72,7 +74,8 @@ private void configureSubsystemDefaultCommands() {
7274
* Math.copySign(Math.pow(joystick.getRightX(), 2), joystick.getRightX())
7375
* DriveConstants
7476
.MAX_ANGULAR_SPEED) // Drive counterclockwise with negative X (left)
75-
));
77+
.withDeadband(DriveConstants.MAX_DRIVE_SPEED * 0.1)
78+
.withRotationalDeadband(DriveConstants.MAX_ANGULAR_SPEED * 0.1)));
7679
}
7780

7881
private void configureBindings() {
@@ -94,12 +97,15 @@ private void configureBindings() {
9497
// Run SysId routines when holding back/start and X/Y.
9598
// Note that each routine should be run exactly once in a single log.
9699

97-
joystick.x().onTrue(drivetrain.sysIdSteer());
98-
joystick.y().onTrue(drivetrain.sysIdTranslation());
99-
joystick.b().whileTrue(new WheelSlipTest(drivetrain)); // Testing only
100+
// joystick.x().onTrue(drivetrain.sysIdSteer());
101+
// joystick.y().onTrue(drivetrain.sysIdTranslation());
102+
joystick.x().onTrue(new WheelSlipTest(drivetrain));
103+
joystick
104+
.y()
105+
.whileTrue(new DriveBySpeed(drivetrain, DrivePreferences.onemeter_speed)); // Testing only
100106

101107
// Reset the field-centric heading on left bumper press.
102-
joystick.leftBumper().onTrue(drivetrain.runOnce(drivetrain::seedFieldCentric));
108+
joystick.start().onTrue(drivetrain.runOnce(drivetrain::seedFieldCentric));
103109

104110
drivetrain.registerTelemetry(logger::telemeterize);
105111
}

0 commit comments

Comments
 (0)