-
Notifications
You must be signed in to change notification settings - Fork 0
Limit switch climber #35
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
base: main
Are you sure you want to change the base?
Conversation
myrachauhan-ui
left a comment
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.
Great! Would prefer the climb speed to be higher
d087ca6 to
851aafd
Compare
19b93fc to
b3c59d8
Compare
b3c59d8 to
7f8b4e0
Compare
| config.limitSwitch.forwardLimitSwitchType( | ||
| LimitSwitchConfig.Type.kNormallyOpen | ||
| ).forwardLimitSwitchTriggerBehavior( | ||
| LimitSwitchConfig.Behavior.kStopMovingMotor |
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.
This is the default behaviour, right?
| LimitSwitchConfig.Behavior.kStopMovingMotor | ||
| ).reverseLimitSwitchType( | ||
| LimitSwitchConfig.Type.kNormallyOpen | ||
| ).reverseLimitSwitchTriggerBehavior(LimitSwitchConfig.Behavior.kStopMovingMotor) |
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 suspect you want the reverse limit switch to zero the position? Otherwise this would start at an arbitrary position and your forward soft limit might not do what you expect.
| MAX_FORWARD_EXTENSION, MAX_REVERSE_EXTENSION = 120, -120 | ||
|
|
||
| current_climber_speed = will_reset_to(0.0) | ||
| forward_climber_speed, reverse_climber_speed = tunable(0.8), tunable(0.8) |
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.
nit: this would probably be clearer across multiple statements instead
|
|
||
| if self.gamepad.getYButton(): | ||
| self.climber.climb() | ||
| if self.gamepad.getBButtonPressed(): |
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.
Why do we want these to only happen once on a button press?
Changed climber script to use postion control, PID still needs to be tuned.