generated from Patribots4738/Swerve-Command-Based
-
-
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
setTargetVelocity to setTargetPercent #72
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b4081e9
Add set percentage method in Neo & change set Target velocity in Shoo…
derp00monsta 61c9323
change set target velocity to set target percent in Shooter.java and …
derp00monsta 39c6845
Add dcoumentation for setTargetPercent method in Neo.java
derp00monsta 7825768
Fix documentation
derp00monsta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,10 +100,16 @@ public void setTargetPosition(double position) { | |
setTargetPosition(position, 0, 0); | ||
} | ||
|
||
// Creates method to set the target percent of the volatge for the NEO. | ||
public void setTargetPercent(double percent) { | ||
setTargetPercent(percent, 0); | ||
} | ||
|
||
/** | ||
* Sets the target percent of voltage for the NEO. | ||
* @param percent Percent of battery voltage | ||
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. Rather than percent of battery voltage, this parameter represents the percent output for the motor. For example, if we give it a 100% input (1) then it will go at 100% speed. If we give it a -50% input, (-0.5) it will go at -50% speed. |
||
* @param slot The PID slot. | ||
*/ | ||
public void setTargetPercent(double percent, int slot) { | ||
percent *= reversedMultiplier; | ||
if (percent == 0) { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 would like, you can add a javadoc here that explains what the method does. If you don't know exactly how to approach it. Take a look at the SpeedAngleTriplet/ShooterCalc file for inspiration. Thankfully it doesn't do much so it doesn't have to be long and descriptive as some of the ones I linked are.
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 added some documentation simialr to the one you had for setTargetVelocity but since you had lines 103 & 104 selcted I added a doc to that too. Do you want me to change it or add more?