Example Implementations of Controls Tutorials#8758
Example Implementations of Controls Tutorials#8758gerth2 wants to merge 15 commits intowpilibsuite:2027from
Conversation
|
This is probably better suited for the snippets directory rather then examples directory, since the intended use is for frc-docs, and you likely wouldn't have a full robot that uses both a flywheel with bang bang and another one with pidf. |
|
|
||
| // Suppression is intentional - this file shows a "simple-as-possible" implementation | ||
| // that a beginner might reference. It is not intended to show "best" coding practices. | ||
| @SuppressWarnings("all") |
There was a problem hiding this comment.
How many different things need to be suppressed? Normally we prefer individual suppressions.
There was a problem hiding this comment.
Three things right now:
- Incorrect naming patterns - I think I should probably just fix these.
- Variables that I put at class scope, but could be private (like the gains)
- Variables that could be marked as
staticandfinalbut weren't.
(2) I think is just gonna be essential for good,concise docs.
(3) was preference based on pedagogy - if a student is learning PID before they've seen static/final/public/private qualifiers, I'd prefer not to have to introduce the topic in parallel, as well as minimize the chance they get confused as to why some variables are declared like that, but others aren't.
I'm open to thoughts though - a minimal way to address (3) is to just teach it in place ("Since these values aren't designed to change at runtime, we mark them as constant using the keywords static final".... something to that nature).
There was a problem hiding this comment.
Quick update - ended up continuing to trim down the qualifiers and name prefixes on variables, got to the point where we just needed to suppress the naming pattern checks.
Again still open for feedback or thoughts. I'm starting with a minima/opinionated stance on how to express the code ideas for docs purposes but there's other ways to slice the problem too.
Attempting to get a robot
example projectcode snippet set that shows all mechanisms and control strategies shown in the controls programming tutorials