-
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
Shooter #4
base: master
Are you sure you want to change the base?
Shooter #4
Changes from 21 commits
065285c
d4a02b5
3143bae
1f98067
f889ab7
7b908b0
a5e30f5
3e7f683
58c0640
0ead328
fb7984d
345f3dc
7642df2
42c25a7
d6a928b
17c55ea
10d67ce
27c7c7e
15d4349
630e8aa
8fdf05e
1a46ce6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package frc.robot; | ||
|
||
import com.ctre.phoenix.motorcontrol.ControlMode; | ||
import com.ctre.phoenix.motorcontrol.NeutralMode; | ||
import com.ctre.phoenix.motorcontrol.can.TalonFX; | ||
|
||
import frc.robot.logging.Loggable; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Import statement for 'frc.robot.logging.Loggable' is in the wrong order. Should be in the 'THIRD_PARTY_PACKAGE' group, expecting not assigned imports on this line. |
||
import frc.robot.logging.Logger; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Import statement for 'frc.robot.logging.Logger' is in the wrong order. Should be in the 'THIRD_PARTY_PACKAGE' group, expecting not assigned imports on this line. |
||
|
||
public class Shooter implements Loggable { | ||
TalonFX shooterMotor; | ||
public Shooter(int shooterID) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'CTOR_DEF' should be separated from previous statement. |
||
this.shooterMotor = new TalonFX(shooterID); | ||
|
||
this.shooterMotor.setNeutralMode(NeutralMode.Coast); | ||
} | ||
|
||
public void setSpeed(double speed) { | ||
this.shooterMotor.set(ControlMode.Velocity, speed); | ||
} | ||
|
||
public void setPower(double power) { | ||
this.shooterMotor.set(ControlMode.PercentOutput, power); | ||
} | ||
|
||
public double getSpeed() { | ||
return this.shooterMotor.getSelectedSensorVelocity(); | ||
} | ||
|
||
@Override | ||
public void setupLogging(Logger logger) { | ||
logger.addAttribute("Shooter/speed"); | ||
} | ||
|
||
@Override | ||
public void log(Logger logger) { | ||
logger.log("Shooter/speed", this.getSpeed()); | ||
} | ||
} |
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'