Skip to content

Commit da72d2a

Browse files
committed
javadocs setup maybe
1 parent 4869a8a commit da72d2a

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

src/main/java/frc/robot/Constants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static final class RobotConstants {
6060
public static final double ENCODER_TO_DEGREES = 5.0;
6161
public static final double DRIVE_GEAR_RATIO = 18.0;
6262
public static final double WHEEL_DIAMETER = 7.5;
63-
public static final double WHEEL_BASE_WIDTH = 30.0;
63+
public static final double WHEEL_BASE_WIDTH = 35.0;
6464
public static final double CANNON_PITCH_ZERO = 38;
6565
}
6666
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public RobotContainer() {
5151
() -> m_driveTrain.tankDrive(
5252
-m_mainStick.getRawAxis(1),
5353
m_mainStick.getRawAxis(4),
54-
0.15),
54+
0.25),
5555
m_driveTrain)
5656
);
5757
}
@@ -99,8 +99,8 @@ private void configureButtonBindings() {
9999
// .and(new JoystickButton(m_mainStick, Constants.OIConstants.LB))
100100
// .onTrue(new InstantCommand(() -> m_cannon.shoot(1)));
101101

102-
new JoystickButton(m_mainStick, Constants.OIConstants.RB)
103-
.onTrue(new Turn(m_driveTrain, 45));
102+
// new JoystickButton(m_mainStick, Constants.OIConstants.RB)
103+
// .onTrue(new Turn(m_driveTrain, 45));
104104

105105

106106
new Trigger(() -> m_mainStick.getRawAxis(5) > 0.9)

src/main/java/frc/robot/commands/Turn.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ public void initialize() {
4040
pid = new PIDController(0.3, 0, 0);
4141
filter = new SlewRateLimiter(1);
4242
SmartDashboard.putString("Test2", "Started");
43-
target = m_drive.getMiddleEncoder() + ((m_angle / 360.0) * (RobotConstants.WHEEL_BASE_WIDTH / RobotConstants.WHEEL_DIAMETER) * RobotConstants.DRIVE_GEAR_RATIO);
43+
target = m_drive.getRightEncoder() + ((m_angle / 360.0) * (RobotConstants.WHEEL_BASE_WIDTH / RobotConstants.WHEEL_DIAMETER) * RobotConstants.DRIVE_GEAR_RATIO);
4444
pid.setSetpoint(target);
4545
}
4646

4747
// Called every time the scheduler runs while the command is scheduled.
4848
@Override
4949
public void execute() {
50-
double z = (pid.calculate(m_drive.getMiddleEncoder()));
50+
double z = (pid.calculate(m_drive.getRightEncoder()));
5151
if (Math.abs(z) > 1) z = 1 * Math.signum(z);
5252
z = filter.calculate(z);
5353
m_drive.tankDrive(0.0, z, 0);
5454
SmartDashboard.putNumber("Turn Command Setpoint", target);
55-
SmartDashboard.putNumber("Turn Command PID", pid.calculate(m_drive.getMiddleEncoder()));
55+
SmartDashboard.putNumber("Turn Command PID", pid.calculate(m_drive.getRightEncoder()));
5656
SmartDashboard.putString("Test2", "Running");
5757

5858

src/main/java/frc/robot/subsystems/Cannon.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import frc.robot.Constants.RobotConstants;
1919
import frc.robot.Constants.PortConstants;
2020

21+
/**
22+
* The Subsystem class representing the cannon.
23+
*/
2124
public class Cannon extends SubsystemBase {
2225
public CANSparkMax m_pM;
2326
public Solenoid m_v1, m_v2, m_v3; // TODO: switch to low, med, high
@@ -61,7 +64,8 @@ public void setValves(boolean v1, boolean v2, boolean v3){
6164

6265

6366

64-
} public void shoot(boolean v1, boolean v2, boolean v3){
67+
}
68+
public void shoot(boolean v1, boolean v2, boolean v3){
6569
if (v1) m_v1.startPulse();
6670
if (v2) m_v2.startPulse();
6771
if (v3) m_v3.startPulse();

src/main/java/frc/robot/subsystems/DriveTrain.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ public void tankDrive(double x, double z, double speed) {
7171

7272
}
7373

74-
public double getMiddleEncoder(){
74+
public double getRightEncoder(){
7575
return m_mR.getEncoder().getPosition();
7676
}
7777

7878
@Override
7979
public void periodic() {
80-
SmartDashboard.putNumber("RM encoder", getMiddleEncoder());
81-
SmartDashboard.putNumber("RM Conversion", m_mR.getEncoder().getPositionConversionFactor());
80+
SmartDashboard.putNumber("RM encoder", getRightEncoder());
8281
}
8382
}

0 commit comments

Comments
 (0)