-
Notifications
You must be signed in to change notification settings - Fork 18
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
Issue #86 hanging mechanism #87
Conversation
…rom 2000 to 9856 so that it goes all the way up.
2024/opmodes/TwoStickTeleop.java
Outdated
liftMotorTask = new OneWheelDriveTask(this, liftMotor, true); | ||
liftMotorTask.slowDown(false); | ||
// liftMotorTask = new OneWheelDriveTask(this, liftMotor, true); | ||
// liftMotorTask.slowDown(false); |
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.
Please don't leave commented out software in pull requests. It is fine to comment out software as you are experimenting and debugging, but software presented for merge should be free of this sort of commented out software.
2024/opmodes/TwoStickTeleop.java
Outdated
// set arm to extend to its highest capacity to lift robot | ||
hangingMotor.setTargetPosition(HANGING_FULLY_EXTENDED); | ||
// encoder allows you to know how much the motor has spun (distance) | ||
hangingMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION); |
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 fine, but RunToEncoderValueTask is designed to accomplish just this functionality while also telling you where it is and when it is finished through the event callbacks.
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.
Based on a quick read of RunToEncoderValueTask.java, it looks like each instantiation of the task goes through the STOP_AND_RESET_ENCODER
, setTargetPosition
, RUN_TO_POSITION
cycle, resetting the absolute position each time, which I think is not desirable.
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 handling of the bool currentlySlow
variable is a bit confusing since it doesn't match the name of the variable. Additionally, since the speed multiplier is greater than 1.0, I think it is making it more difficult to drive the robot because it is limiting the proportional control range for your motor speeds in "fast mode".
- If
currentlySlow
is true, the speed multiplier should be set to the smaller multiplier slowDown
should not be set to a number greater than 1.0 to avoid losing proportional control range.
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.
LGTM!
This code allows the teleop buttons to lift the hanging mechanism when "y" is pushed and to bring down the mechanism when "a" is pushed. This was tested with the robot in today's meeting.