Skip to content

Commit ada9e7d

Browse files
Added a StayStill() autonomous program. Changed "DriveStraight" to drive only 100 inches. Tried to fix "DISTANCE_PER_PULSE" in Drive.java to match 2020 robot drivetrain.
1 parent e81a784 commit ada9e7d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/main/java/org/mayheminc/robot2020/RobotContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private void configureDefaultCommands() {
8181
private void configureAutonomousPrograms() {
8282
LinkedList<Command> autonomousPrograms = new LinkedList<Command>();
8383

84-
// autonomousPrograms.push(new StayStill());
84+
autonomousPrograms.push(new StayStill());
8585
autonomousPrograms.push(new DriveStraight());
8686
// autonomousPrograms.push(new TestTurret());
8787

src/main/java/org/mayheminc/robot2020/autonomousroutines/DriveStraight.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public class DriveStraight extends SequentialCommandGroup {
1919
public DriveStraight() {
2020

2121
addCommands(new DriveZeroGyro());
22-
addCommands(new DriveStraightOnHeading(0.2, DistanceUnits.INCHES, 100, 0));
22+
// addCommands(new DriveStraightOnHeading(0.2, DistanceUnits.INCHES, 100, 0));
2323
addCommands(new DriveStraightOnHeading(0.3, DistanceUnits.INCHES, 100, 0));
24-
addCommands(new DriveStraightOnHeading(0.4, DistanceUnits.INCHES, 100, 0));
24+
// addCommands(new DriveStraightOnHeading(0.4, DistanceUnits.INCHES, 100, 0));
2525

2626
// addCommands(new ParallelCommandGroup(new IntakeSetPosition(true), new
2727
// MagazineSetTurntable(0.0)));

src/main/java/org/mayheminc/robot2020/subsystems/Drive.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ public class Drive extends SubsystemBase {
5353
private static final double kToleranceDegreesPIDControl = 0.2;
5454

5555
// Drive parameters
56-
public static final double DISTANCE_PER_PULSE = 3.14 * 8.0 * 36 / 42 / (250 * 4); // pi * diameter * (gear ratio) /
57-
// (counts per rev)
56+
// pi * diameter * (pulley ratios) / (counts per rev * gearbox reduction)
57+
public static final double DISTANCE_PER_PULSE = 3.14 * 5.75 * 36.0 / 42.0 / (2048.0 * 7.56);
58+
5859
private boolean m_closedLoopMode = false;
5960
private double m_maxWheelSpeed = 1.0; // set to 1.0 as default for "open loop" percentVBus drive
6061
private double m_voltageRampRate = 48.0;

0 commit comments

Comments
 (0)