Merged
Conversation
Member
|
I like 'public static Map<TargetState, Measure[]> TARGET_TO_PRESETS;' however then it is on the user to make sure the order is correct. Object idea prevents that specific issue at the cost of some increased complexity. I'm leaning toward Object as my #1 and Measure array as #2 We could also make 3 maps: 1 for angle one for left and one for right which may be the simplest implementation? |
Collaborator
Author
|
I don't like the idea of 3 separate maps just for the sake of keeping them together. |
TaylerUva
previously requested changes
Sep 18, 2024
This reverts commit 04a1239.
Collaborator
Author
|
Closes #59 |
AngelaKimmy
approved these changes
Sep 21, 2024
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.
@TaylerUva @Alenguye582
bros...
While working on this, I thought that a HashMap with the desired
TargetStatewould be the cleanest way of storing the preset values, but I wasn't sure how we'd want to store those groups of measures in it.I could think of 3 implementations I enjoyed but I'm not sure which one is the best 😀. Ultimately, it doesn't matter, as I'll just write a shooter method that accepts whatever we pick [such as
setShooterToPreset(Matrix<N3, N1>)] but I think we'll run into this issue later if we continue using MeasuresMeasure array size isn't specified
public static Map<TargetState, Measure[]> TARGET_TO_PRESETS;2 sets of pairs (tuples aren't in our IDE and I couldn't find an alternative, let me know if you do bc i would love that)
public static Map<TargetState, Pair<Measure<Angle>, Pair<Measure<Velocity<Angle>>, Measure<Velocity<Angle>>>>> TARGET_TO_PRESETS;Convert the Measures to doubles and store them in a Matrix
public static Map<TargetState, Matrix<N3, N1>> TARGET_TO_PRESETS;(I also considered making a separate object like
public ThreeSpecificMeasures(Measure<Angle>[] shooterAngle, Measure<Velocity<Angle>> leftVelocity, Measure<Velocity<Angle>> rightVelocity)and using that as the key value but I figured that would be excessive)