-
Notifications
You must be signed in to change notification settings - Fork 8
Added components for ExpansionHubServo and ExpansionHubMotor. #188
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
Added components for ExpansionHubServo and ExpansionHubMotor. #188
Conversation
Added start and update methods to components. Added code to run_opmode to print stacktrace if an error occurs.
def isHubConnected(self) -> bool: | ||
return self.expansion_hub_motor.isHubConnected() | ||
|
||
def getEncoder(self) -> float: |
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.
I thought encoder ticks were int instead of float
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.
It's float in the class from Thad. See
def getEncoder(self) -> float: |
def getEncoderVelocity(self) -> float: | ||
return self.expansion_hub_motor.getEncoderVelocity() | ||
|
||
def setReversed(self, reversed: bool): |
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.
Do we need a getReversed as well?
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.
Probably, but it will need to be added here
def resetEncoder(self): | ||
self.expansion_hub_motor.resetEncoder() | ||
|
||
def getVelocityPidConstants(self) -> expansion_hub.ExpansionHubPidConstants: |
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.
Do we need a set as well?
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.
Maybe. It will need to be added here as well. We should talk to Thad.
def getVelocityPidConstants(self) -> expansion_hub.ExpansionHubPidConstants: | ||
return self.expansion_hub_motor.getVelocityPidConstants() | ||
|
||
def getPositionPidConstants(self) -> expansion_hub.ExpansionHubPidConstants: |
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.
Do we need a set as well?
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.
Maybe. It will need to be added here as well. We should talk to Thad.
def set(self, value: float): | ||
self.expansion_hub_servo.set(value) | ||
|
||
def setAngle(self, degrees: float): |
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 this takes degrees, should it be setAngleDegrees?
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.
It's just setAngle here. We can talk about changing it with Thad and others.
…face into pr_expansion_hub_components
Removed empty start, update, and stop methods from component subclasses.
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.
I put a question out to thad on slack. We can fix those items in a later PR after he responds.
Added components for ExpansionHubServo and ExpansionHubMotor.
Added start and update methods to components.
Added code to run_opmode to print stacktrace if an error occurs.