-
Notifications
You must be signed in to change notification settings - Fork 0
made flywheel(shooter) subsystem #3
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
Conversation
|
Hey! Take a look here for some comments: #1 |
|
|
||
| public default void launchRing() {} | ||
|
|
||
| public default void setRunning(boolean runIntake) {} |
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.
The setRunning method appears to contribute no additional functionality to the IO. I would suggest removing it
| // make lower a follower of upper | ||
| leftFX.setControl(new Follower(FlywheelConfigs.rightFXID, false)); | ||
| // add motors to sim | ||
| // PhysicsSim.getInstance().addTalonFX(leftFX); |
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.
You would want the PhysicsSim lines uncommented for simulation in order to add TalonFX to it.
|
|
||
| @Override | ||
| public void setRollerDuty(double power) { | ||
| leftFX.setControl(new DutyCycleOut(power)); |
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.
It is more efficient to reuse the same instance of the control request DutyCycleOut and simply use the withOutput method to change the value of the output upon calling this method. I would also note that for flywheel control, it may be worth considering more robust control alternatives such as velocity control, but this is ok for testing for the time being.
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.
(try motion magic torque current velocity)
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.
(try motion magic torque current velocity)
See this for an example of what you could use
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.
See javadoc for import path. Otherwise if it isn't showing up, you might want to sync vendordeps
|
I will remove launchRing method next commit I think it just does the setRoller method's job |
|
|
||
| @Override | ||
| public void setRoller(double power) { | ||
| leftMotor.setControl(new MotionMagicVelocityTorqueCurrentFOC(power)); |
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.
Please see my previous comment on reusing control requests
|
|
||
| public default void setRoller(double power) {} | ||
|
|
||
| public default void launchRing() {} |
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
| public Flywheel(FlywheelIO io) { | ||
| // Recording inputs from roller | ||
| this.io = io; | ||
| // Logger.processInputs("Flywheel", inputs); error |
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.
Uncomment
samperlmutter
left a comment
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.
looking much better. mostly just cleanup now
src/main/java/frc/robot/subsystems/flywheel/FlywheelIOTalonFX.java
Outdated
Show resolved
Hide resolved
| public void setRoller(double power) { | ||
| leftMotor.setControl(motionRequest.withVelocity(power)); |
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.
power isn't quite the right name for this parameter right? what is the parameter representing 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.
I'll change it to velocity
src/main/java/frc/robot/subsystems/flywheel/FlywheelIOTalonFX.java
Outdated
Show resolved
Hide resolved
samperlmutter
left a comment
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.
looks good!
Made flywheel subsystem. Had to delete old shooter branch because of weird issues but both are identical.