prepAnywhere - #71
Open
jaymendo670-png wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR appears to add a “Prep Anywhere” capability by computing robot-to-hub distance and using interpolated lookup tables to set hood angle and flywheel RPM dynamically, plus a small command helper to apply those targets.
Changes:
- Added interpolated distance→hood-angle and distance→flywheel-speed maps, with helper accessors.
- Added hub pose + robot-to-hub distance tracking to support distance-based prep/aiming.
- Introduced
SubCommands.aim(...)and updatedPrepAnywhereto use it and toggle drivetrain “manual drive” behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/frc/robot/subsystems/Rotors.java |
Adds distance→flywheel speed mapping helper. |
src/main/java/frc/robot/subsystems/RobotPoses.java |
Tracks hub pose and computes distanceToHub each periodic cycle. |
src/main/java/frc/robot/subsystems/Motion.java |
Adds distance→hood angle mapping helper. |
src/main/java/frc/robot/subsystems/Drivetrain.java |
Adds setManualDrive(...) API (currently stubbed). |
src/main/java/frc/robot/constants/ConstRotors.java |
Adds interpolating map for flywheel speed vs. distance. |
src/main/java/frc/robot/constants/ConstMotion.java |
Adds interpolating map for hood angle vs. distance. |
src/main/java/frc/robot/constants/ConstField.java |
Adds hub pose constant and alliance-aware pose set. |
src/main/java/frc/robot/commands/SubCommands.java |
Adds shared aim(...) helper that sets hood, flywheel, and drivetrain target rotation. |
src/main/java/frc/robot/commands/states/preps/PrepAnywhere.java |
Enables vision, sets PREP_ANYWHERE state, and calls SubCommands.aim(true) while active. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+240
to
+243
| public void setManualDrive(boolean b) { | ||
| // TODO Auto-generated method stub | ||
| throw new UnsupportedOperationException("Unimplemented method 'setManualDrive'"); | ||
| } |
Comment on lines
7
to
+11
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import frc.robot.RobotContainer; | ||
| import frc.robot.commands.SubCommands; | ||
| import frc.robot.constants.ConstRotors; | ||
| import frc.robot.subsystems.StateMachine.RobotState; |
Comment on lines
+13
to
16
| import edu.wpi.first.math.interpolation.InterpolatingDoubleTreeMap; | ||
| import edu.wpi.first.math.interpolation.InterpolatingTreeMap; | ||
| import edu.wpi.first.units.Units; | ||
| import edu.wpi.first.units.measure.AngularVelocity; |
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.