PIDController in CmdAlign - #137
Open
mika-okamoto wants to merge 3 commits into
Open
Conversation
mika-okamoto
commented
Sep 13, 2022
| currHorizontalOffset = limelights.getShooterTX(); | ||
| prevError = goalHorizontalOffset - currHorizontalOffset; | ||
| aimState = VisionState.FEEDBACK; | ||
| controller.disableContinuousInput(); |
Author
There was a problem hiding this comment.
this should be .enable not .disable because you're switching from searching to feedback
| if(!limelights.getShooterHasValidTarget()) { | ||
| aimState = VisionState.SEARCHING; | ||
| plateauCount = 0; | ||
| controller.enableContinuousInput(-180, 180); |
| double ff = Math.signum(currError) * VISION_PID_kF; | ||
| double feedbackPower = VISION_PID_kP * currError + VISION_PID_kD * (currError - prevError) / (currTime - prevTime) + ff; | ||
|
|
||
| double feedbackPower = controller.calculate(currHorizontalOffset); |
Author
There was a problem hiding this comment.
keep the ff line in here and set feedbackPower = the code you have in here with .calculate() + ff
double ff = Math.signum(currError) * VISION_PID_kF
mika-okamoto
commented
Sep 13, 2022
|
|
||
| double feedbackPower = controller.calculate(currHorizontalOffset); | ||
| double ff = Math.signum(currError) * VISION_PID_kF; | ||
| double feedbackPower = controller.calculate(currHorizontalOffset) + ff; |
Author
There was a problem hiding this comment.
use currError instead of currHorizontalOffset
ControlsNarwhal
approved these changes
Sep 13, 2022
ControlsNarwhal
left a comment
Contributor
There was a problem hiding this comment.
looks good - mika
(this is anwika's pr, I made the pr from my account so am approving with this account)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.