-
Notifications
You must be signed in to change notification settings - Fork 0
Stefan/fix disable 79 #81
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
Changes from all commits
f7777ea
6fd0fa2
4a94d3d
f3e542a
3305d27
8086ede
63e173b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,4 +29,7 @@ public interface Motor { | |
| * @return The current applied current | ||
| */ | ||
| Current getAppliedCurrent(); | ||
|
|
||
| /** Stops the motor. */ | ||
| void disable(); | ||
| } | ||
|
Contributor
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. @spderman3333 as mentioned in the other PR, Given the description of this method, could you please send a PR renaming this to
Member
Author
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. The scope of the PR does not cover refactoring, as the method is introduced as "disable()" in MotorSubsystem, i have decided to name the method accordingly.
Contributor
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. This PR was submitted. My request is to send another, renaming We could deprecate |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| import com.team2813.lib2813.control.DeviceInformation; | ||
| import com.team2813.lib2813.control.InvertType; | ||
| import com.team2813.lib2813.control.PIDMotor; | ||
| import com.team2813.lib2813.subsystems.MotorSubsystem; | ||
| import com.team2813.lib2813.util.InvalidCanIdException; | ||
| import edu.wpi.first.units.Units; | ||
| import edu.wpi.first.units.measure.Angle; | ||
|
|
@@ -162,10 +163,31 @@ public TalonFX motor() { | |
| return motor; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the behavior the motor should exhibit upon receiving a request to stop: {@link | ||
| * MotorSubsystem#disable()} | ||
| * | ||
| * <ul> | ||
| * <li>Coast: The motor stops applying an input, but continues to move with its inertia. | ||
| * <li>Brake: The motor stops applying an input, and actively opposes its inertia. | ||
| * </ul> | ||
|
Comment on lines
+170
to
+173
Collaborator
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. Same as prior PR; CTRE may add, remove, or modify the meaning of the neutral mode values, so enumerating them isn't a good idea.
Contributor
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. +1 |
||
| * | ||
| * @param mode | ||
| */ | ||
| public void setNeutralMode(NeutralModeValue mode) { | ||
| motor.setNeutralMode(mode); | ||
| } | ||
|
|
||
| /** | ||
| * Sends a disable command to the motor, placing it in its neutral value. | ||
| * | ||
| * @see TalonFXWrapper#setNeutralMode(NeutralModeValue) | ||
| */ | ||
| @Override | ||
| public void disable() { | ||
| motor.disable(); | ||
| } | ||
|
|
||
| @Override | ||
| public void configPIDF(int slot, double p, double i, double d, double f) { | ||
| SlotConfigs conf = new SlotConfigs(); | ||
|
|
||
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.
Do you know: does this only cut power off, or does it also actively apply the break to the motor?
I see that for the TalonFXWrapper you can control this, so you might have to clarify here:
Depending on the motor setting, this can cruise or break...or something along those lines.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 method depends on the individual implementation of the motor controller, it is out of our hands I believe.
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.
If you are correct that the behavior may differ by motor then let's please update the Javadoc to mention that.
CC @cuttestkittensrule in case he has knowledge about how the APIs of the motors we use might differ.