Open
Conversation
- During the 1 second catapult retraction, you would loose control over the entire rest of the robot. If the robot is driving while the retract button is pressed, that 1 second is definitely enough to have the robot end up running into something it shouldn’t. The irony is that after the 1 second wait, the motor power never got changed, so it was unnecessary as written. Changed to use a proper timer, and added a variable for hold power (this should be tested on a real robot and adjusted accordingly!) - There were a couple calls to setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE) in the loop, these do nothing as these motors are already set to BRAKE in the init section. - The runmodes of all the motors are now initialized and encoders reset, making sure nothing carries over from other OpModes.
|
@qwertychouskie you absolutely should not power the lift on all of the time. You can do a homing process to fix this. I will make a fork of this repo then send you a link so you can cherrypick my changes. |
We used 0.1 power for hold and 0.4 seconds for down time, but I put 0.15 and 0.5 here just for a bit of extra margin (different motors/batteries/etc may be slightly different).
Before this, the motor stalling issue would still exist when the catapult was in the UP state.
Author
|
20f6a4d is only a partial fix, as leaving the catapult up will still burn out the motor. The code here should fix all situations that cause motor burnout, and also makes the driver experience better (catapult auto-retracts). |
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.
Mistakes are possible, please test on a real robot :)