Stage 2 CTRE Solution Code - #175
Conversation
|
🌐 Preview URL: https://pr-175.frcsoftware.pages.dev |
Daniel1464
left a comment
There was a problem hiding this comment.
I know this is still a draft, but left some preliminary comments since i have time
| "enableCppIntellisense": false, | ||
| "currentLanguage": "java", | ||
| "projectYear": "2027_alpha5", | ||
| "teamNumber": 9999 |
There was a problem hiding this comment.
Small nitpick, but you can set this to null instead.
| static final double kI = 0; | ||
| static final double kD = 7; | ||
|
|
||
| static final double POSITION_TOLERANCE = 3.0/360.0; |
There was a problem hiding this comment.
Would this be better served using the units API? Degrees.of(3) would be a lot more clear here
There was a problem hiding this comment.
Changed to use Units.degreesToRotations instead. Since we aren't using the units API anywhere else really, I don't think it'd make sense to have it for this.
| motor.getConfigurator().apply(leaderConfiguration); | ||
|
|
||
| // Set up periodic method to run every code loop | ||
| Scheduler.getDefault().addPeriodic(this::periodic); |
There was a problem hiding this comment.
In the previous exercises, mechanism.periodic() is called manually in robotPeriodic(). Personally I think it's slightly better because it gives you control as to when the periodic() method is run
|
|
||
| private final FlywheelSim sim; | ||
|
|
||
| private final double GEAR_RATIO = (18.0 / 12.0) * (54.0 / 18.0) * (22.0 / 18.0) * (22.0 / 18.0); |
There was a problem hiding this comment.
It would be better to make the gear ratio a parameter of ClawSim so that users can play around with different gear ratios
There was a problem hiding this comment.
What value does this get in terms of teaching frc programming?
Creates stage 2 CTRE Solution Code. Still very much a WIP
Todo: