-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge first (and second) competition code into master #26
base: master
Are you sure you want to change the base?
Conversation
Climbing plan made just need to code it
Solenoid staging, climbing states, and sensors and motor IDs added
Staging added.
Co-authored-by: theblindbandet <[email protected]>
Co-authored-by: theblindbandet <[email protected]> Co-authored-by: ultragamer1010 <[email protected]> Co-authored-by: HungryIronApple <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #26 +/- ##
===========================================
- Coverage 9.63% 8.25% -1.39%
Complexity 17 17
===========================================
Files 18 20 +2
Lines 685 800 +115
Branches 47 50 +3
===========================================
Hits 66 66
- Misses 619 734 +115
|
climberSolenoidB1.set(true); | ||
climberSolenoidB2.set(false); | ||
climberSolenoidC.set(true); | ||
// if (climbingMotor.getStatorCurrent() > NEXT_AB_STATE_CURRENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
src/main/java/frc/robot/Robot.java
Outdated
manipulation.setIntakeExtend(false); | ||
} | ||
manipulation.setIntakeSpin(operator.getYButton()); | ||
// manipulation.setIndexLoad(operator.getLeftTriggerAxis() > 0.5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
/** | ||
* Drive with arcade-style controls. | ||
* | ||
* @param turnInput The speed to turn | ||
* @param speedInput The speed to drive | ||
*/ | ||
public void arcadeDrive(double turnInput, double speedInput) { | ||
speedInput = | ||
climbMode ? speedInput * 0.3 : speedInput + (autoBalanceEnabled ? balanceScale : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract this nested ternary operation into an independent statement.
* @param indexLoadID The CAN id of the spark for the index loader | ||
* | ||
*/ | ||
Manipulation(int pneumaticsForwardChannel, int pneumaticsReverseChannel, int intakeWheelID) {//, int indexLoadID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
*/ | ||
Manipulation(int pneumaticsForwardChannel, int pneumaticsReverseChannel, int intakeWheelID) {//, int indexLoadID) { | ||
this.intakeWheel = new CANSparkMax(intakeWheelID, MotorType.kBrushless); | ||
// this.indexLoad = new CANSparkMax(indexLoadID, MotorType.kBrushless); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
import frc.robot.logging.Logger; | ||
|
||
public class Drivetrain implements Loggable { | ||
|
||
private final double SHIFT_CURRENT_HIGH = 80; // TODO Get actual values when we test drivetrain | ||
private final double SHIFT_CURRENT_LOW = 0; | ||
private final double SHIFT_VELOCITY = 0; // Wheel velocity | ||
private final double OFF_BALANCE_THRESHOLD = 10; | ||
private final double ON_BALANCE_THRESHOLD = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Member name 'ON_BALANCE_THRESHOLD' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
@@ -10,14 +10,15 @@ | |||
|
|||
public class DriveModule implements Loggable { | |||
|
|||
private final double VELOCITY_COEFFICIENT = 600 / 2048; | |||
private final double MAX_VELOCITY = 22000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abbreviation in name 'MAX_VELOCITY' must contain no more than '2' consecutive capital letters.
@@ -10,14 +10,15 @@ | |||
|
|||
public class DriveModule implements Loggable { | |||
|
|||
private final double VELOCITY_COEFFICIENT = 600 / 2048; | |||
private final double MAX_VELOCITY = 22000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Member name 'MAX_VELOCITY' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
|
||
import edu.wpi.first.wpilibj.DoubleSolenoid; | ||
import edu.wpi.first.wpilibj.PneumaticsModuleType; | ||
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong lexicographical order for 'edu.wpi.first.wpilibj.DoubleSolenoid.Value' import. Should be before 'edu.wpi.first.wpilibj.PneumaticsModuleType'.
import edu.wpi.first.wpilibj.PneumaticsModuleType; | ||
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; | ||
|
||
import com.revrobotics.CANSparkMax; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra separation in import group before 'com.revrobotics.CANSparkMax'
import edu.wpi.first.wpilibj.PneumaticsModuleType; | ||
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; | ||
|
||
import com.revrobotics.CANSparkMax; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong lexicographical order for 'com.revrobotics.CANSparkMax' import. Should be before 'edu.wpi.first.wpilibj.PneumaticsModuleType'.
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; | ||
|
||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.CANSparkMaxLowLevel.MotorType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong lexicographical order for 'com.revrobotics.CANSparkMaxLowLevel.MotorType' import. Should be before 'edu.wpi.first.wpilibj.PneumaticsModuleType'.
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.CANSparkMaxLowLevel.MotorType; | ||
|
||
import frc.robot.logging.Loggable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra separation in import group before 'frc.robot.logging.Loggable'
* @param indexLoadID The CAN id of the spark for the index loader | ||
* | ||
*/ | ||
Manipulation(int pneumaticsForwardChannel, int pneumaticsReverseChannel, int intakeWheelID) {//, int indexLoadID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 119).
Manipulation(int pneumaticsForwardChannel, int pneumaticsReverseChannel, int intakeWheelID) {//, int indexLoadID) { | ||
this.intakeWheel = new CANSparkMax(intakeWheelID, MotorType.kBrushless); | ||
// this.indexLoad = new CANSparkMax(indexLoadID, MotorType.kBrushless); | ||
this.intakePneumatics = new DoubleSolenoid(PneumaticsModuleType.REVPH, pneumaticsForwardChannel, pneumaticsReverseChannel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 131).
* @param load True if it should load; false if not | ||
* | ||
*/ | ||
public void setIndexLoad(boolean load) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'METHOD_DEF' should be separated from previous statement.
@@ -5,34 +5,20 @@ | |||
import frc.robot.logging.Logger; | |||
|
|||
public class ClimberSensors implements Loggable { | |||
DigitalInput a1, a2, b1, b2, c1, c2; | |||
DigitalInput b1, b2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each variable declaration must be in its own statement.
src/main/java/frc/robot/Robot.java
Outdated
@@ -79,56 +92,95 @@ public void robotInit() { | |||
Solenoid climberSolenoidB2 = new Solenoid(PneumaticsModuleType.REVPH, 4); | |||
Solenoid climberSolenoidC = new Solenoid(PneumaticsModuleType.REVPH, 5); | |||
|
|||
// ClimberSensors climberSensors = new ClimberSensors(0, 1, 2, 3, 4, 5); | |||
ClimberGates climberGates = new ClimberGates(6, 7, 8, 9, 10, 11, 12, 13); | |||
climberSensors = new ClimberSensors(0,0); // TODO: Add sensors and input ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
Maybe nestable loggables will be a thing someday. Doubt it though, sendables exist now
…into first-comp
|
||
private double motorSpeed; | ||
|
||
private double previousTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this unused "previousTime" private field.
System.out.println("--------HIT MAX CURRENT--------"); | ||
} | ||
// // Make sure we're not pulling too much current instantly | ||
// if (climbingMotor.getStatorCurrent() > MAX_INSTANT_CURRENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
setClimbingState(ClimbingStates.ERROR); | ||
} | ||
// // Make sure we're not pulling too much current over time | ||
// if (leftFilter.get() > MAX_AVERAGE_CURRENT || rightFilter.get() > MAX_AVERAGE_CURRENT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
// this.setSpeed(0); | ||
// } | ||
|
||
// if (touch.getB()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
climberSolenoidA.set(false); | ||
climberSolenoidB1.set(false); | ||
climberSolenoidB2.set(false); | ||
climberSolenoidC.set(true); | ||
// if (gates.getB1()) { | ||
// if (!gates.getB1()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of commented-out lines of code should be removed.
// climberSolenoidB2.set(false); | ||
// climberSolenoidC.set(true); | ||
// // this.setPower(0); | ||
// // TODO: set motor target here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
ClimberGates climberGates = new ClimberGates(6, 7, 8, 9, 10, 11, 12, 13); | ||
climber = new Climber(9, 10, climberSolenoidA, climberSolenoidB1, climberSolenoidB2, | ||
climberSolenoidC, climberGates);// ,gyro, climberSensors); | ||
// climberSensors = new ClimberSensors(0, 0); // TODO: Add sensors and input ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
Code Climate has analyzed commit ff3a96a and detected 42 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 0.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 8.2% (-1.4% change). View more on Code Climate. |
Congratulations! We've managed to stress-test the code at not only one, but two competitions! Stable code that's been tested on the robot is usually merged into the master branch, but code written mere moments before a match might not be the most stable it could be. There were also a few things we need to remove, as a few things were just thrown-together hacks that should probably get actual solutions.
Things we need to do! As far as I've been made aware...
@RAR1741/students, if you want to work on this, feel free to assign yourself and get to work!