-
Notifications
You must be signed in to change notification settings - Fork 0
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
Common 213 #38
base: development
Are you sure you want to change the base?
Common 213 #38
Conversation
common-wpi-util/src/main/java/com/team2073/common/mediator/Mediator.java
Outdated
Show resolved
Hide resolved
common-wpi-util/src/main/java/com/team2073/common/mediator/Mediator.java
Outdated
Show resolved
Hide resolved
common-wpi-util/src/main/java/com/team2073/common/mediator/subsys/SubsystemStateCondition.java
Show resolved
Hide resolved
common-wpi-util/src/main/java/com/team2073/common/mediator/condition/PositionBasedCondition.kt
Outdated
Show resolved
Hide resolved
common-wpi-util/src/main/java/com/team2073/common/mediator/Mediator.java
Outdated
Show resolved
Hide resolved
common-wpi-util/src/main/java/com/team2073/common/mediator/Mediator.java
Outdated
Show resolved
Hide resolved
common-wpi-util/src/main/java/com/team2073/common/mediator/Mediator.java
Outdated
Show resolved
Hide resolved
|
||
if (islowerBound == null) { | ||
if (isLowerBound == null) { | ||
println("bound not upper/lower in condition") |
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.
Shouldn't this be an exception?
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.
If you threw an exception here then maybe you could make resolutionCondition not be lateinit (or maybe just return it from inside the if statements and get rid of the var all together)
return originCondition == originConditionP && conflictingCondition == conflictingConditionP | ||
} | ||
|
||
override fun getResolution(currentCondition: Condition<Double>, subsystem: ColleagueSubsystem<Double>): Condition<Double> { |
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 should look into just using the Position
class I made. I think it does basically what you are trying to do here.
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.
The position class doesn't tell me the closest bound and doesn't pass back the closest bound though
return originCondition == originConditionPS && conflictingCondition == conflictingConditionPS | ||
} | ||
|
||
override fun getResolution(currentCondition: Condition<Double>, subsystem: ColleagueSubsystem<Double>): Condition<Double> { |
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.
Find a way to not repeat this code in the various condition classes. You are gonna make changes later and forget to update all the different areas.
af4a738
to
a80ff12
Compare
6e0daa0
to
d83e675
Compare
f2ab703
to
c93c8d0
Compare
…n creating Requests
…ct changes to accommodate two enums
No description provided.