Conversation
Added auto selector knob code
Auto constants added for selector switch
…706-Robot-Code into shooter-develop-2
…706-Robot-Code into shooter-develop-2
…706-Robot-Code into shooter-develop-2
…706-Robot-Code into shooter-develop-2
…r variable,s will replace wiht acutal values later
…706-Robot-Code into shooter-develop-2
…706-Robot-Code into shooter-develop-2
GabbyGenereux
left a comment
There was a problem hiding this comment.
Please remove all the files under /.gradle from this PR, as they shouldn't be committed.
| @@ -0,0 +1,6 @@ | |||
| { | |||
There was a problem hiding this comment.
this shouldn't be committed either. We need to keep the projectYear and currentLanguage set, as it is now in the codebase.
There was a problem hiding this comment.
this file should be deleted.
There was a problem hiding this comment.
Nitpick: All java classes should be "PascalCase" (aka. first letter of every word should be capitalized) and methods should be camelCase (aka. first letter of every word, except for the first one, should be capitalized)
| import java.util.concurrent.TimeUnit; | ||
|
|
||
|
|
||
| /** An example command that uses an example subsystem. */ |
There was a problem hiding this comment.
lets update the comments with something more applicable to the current command/class
| // Returns true when the command should end. | ||
| @Override | ||
| public boolean isFinished() { | ||
| return false; |
There was a problem hiding this comment.
is this should return true when the command should end, and we just return false, does that mean the command never ends?
There was a problem hiding this comment.
Same comments apply here, rename the class and redo the comments so they are more descriptive of the code in the file.
| // Returns true when the command should end. | ||
| @Override | ||
| public boolean isFinished() { | ||
| return true; |
There was a problem hiding this comment.
Opposite question than the one I posed in startShooter, if we return true when the command should end, and we just return true right away, does the command every actually run?
| @@ -0,0 +1,53 @@ | |||
| package frc.robot.subsystems; | |||
There was a problem hiding this comment.
You need to update your target branch for this PR to be develop not main. When you do that, this commit (which is not yours :) ) will go away
|
|
||
|
|
||
|
|
||
| //@SuppressWarnings("resource") |
There was a problem hiding this comment.
Why do you need an @ SuppressWarnings here?
| // Determines which way the motor spins | ||
| shooterConfig.inverted(false); | ||
| shooterMotor2.configure( | ||
| shooterConfig, |
There was a problem hiding this comment.
nitpick: we should indent these properly to help with readability.
|
|
||
|
|
||
|
|
||
| // @SuppressWarnings("resource") |
There was a problem hiding this comment.
Why is this code commented out?
| followerConfig.follow(shooterMotor1); | ||
| shooterMotor2.configure(followerConfig, SparkBase.ResetMode.kResetSafeParameters, SparkBase.PersistMode.kPersistParameters); | ||
|
|
||
|
|
There was a problem hiding this comment.
nit: Lets remove this extra whitespace as well
| } | ||
|
|
||
| public void testMotor() { // purely for testing | ||
| System.out.println(shooterMotor1); |
There was a problem hiding this comment.
Lets remove this for now. You'll have to add it back locally when you want to test, but I'd rather than than have rouge print statements hanging out in the code.
| } | ||
|
|
||
| /** | ||
|
|
There was a problem hiding this comment.
This is a good place to put a comment explaining what this method does, and what it returns.
| //indexerMotor.set(getDesiredVoltage()/2); | ||
| } | ||
|
|
||
| //@Override |
There was a problem hiding this comment.
Should this be removed?
| public Robot() { | ||
| // Instantiate our RobotContainer. This will perform all our button bindings, and put our | ||
| // autonomous chooser on the dashboard. | ||
| System.out.println("shooter system initialized"); |
There was a problem hiding this comment.
We should remove print statements, if we want to log things we should use a separate logging system.
Removed state machine to simplify code flow since theres only really two modes and two of the states can be combined into a singular method
Initialized and configured 4 motors (tested only 3 because we don't have agitator hopper motor)
Added CAN ID constants for motors
Created methods to control shooter motors based on current RPM and linked them to commands (startShooter, stopShooter)
Binded commands to the A button on the operator controller
Tested both shooter motors and feeder motor on prototype. Still need to PID tune.