-
Notifications
You must be signed in to change notification settings - Fork 2
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
Profiled PID for controlling the rotation of targeting commands #42
base: main
Are you sure you want to change the base?
Conversation
) | ||
} | ||
|
||
thetaPID.enableContinuousInput(-PI.radians, PI.radians) | ||
} | ||
|
||
override fun initialize() { | ||
thetaPID.reset() // maybe do first for x? | ||
thetaPID.reset(0.degrees) // maybe do first for x? |
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.
why 0 degrees?
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.
what would we reset it to then? the current gyro angle?
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're not resetting the angle, you're resetting the error it sees. we don't want error from the previous path to carry on, but rather recalculate in our execute function
) | ||
} | ||
|
||
thetaPID.enableContinuousInput(-PI.radians, PI.radians) | ||
} | ||
|
||
override fun initialize() { | ||
thetaPID.reset() | ||
thetaPID.reset(0.degrees) | ||
|
||
if (thetakP.hasChanged() || thetakI.hasChanged() || thetakD.hasChanged()) { |
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 add tunable numbers for steering vel max and accel max as well
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.
for the rest of the commands as well
@@ -69,7 +69,7 @@ object ControlBoard { | |||
val climbAlignLeft = Trigger { driver.dPadLeft } | |||
val climbAlignRight = Trigger { driver.dPadRight } | |||
|
|||
val targetSpeaker = Trigger { driver.xButton } // TODO: switch back to climbAlignLeft |
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.
doesn't belong in this commit
Uses the
ProfiledPIDController
for all targeting commands in regards to the rotation. Using a profiled PID controller helps us account for larger amounts of error and adjust accordingly, while adhering to our constraints. The controller was changed to a profiled PID controller for theTargetSpeakerCommand
,TargetAngleCommand
, andTargetNoteCommand
.