Skip to content
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

Merged
merged 4 commits into from
Nov 7, 2023
Merged

Conversation

elyse5
Copy link
Contributor

@elyse5 elyse5 commented Oct 20, 2023

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.

@elyse5 elyse5 requested a review from a team as a code owner October 20, 2023 03:30
liftMotorTask = new OneWheelDriveTask(this, liftMotor, true);
liftMotorTask.slowDown(false);
// liftMotorTask = new OneWheelDriveTask(this, liftMotor, true);
// liftMotorTask.slowDown(false);
Copy link
Collaborator

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.

// 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);
Copy link
Collaborator

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.

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.

Copy link

@joeycasabar joeycasabar left a 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".

  1. If currentlySlow is true, the speed multiplier should be set to the smaller multiplier
  2. slowDown should not be set to a number greater than 1.0 to avoid losing proportional control range.

Copy link

@joeycasabar joeycasabar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@amelialmartinez amelialmartinez merged commit 01a43c1 into master Nov 7, 2023
1 check passed
@amelialmartinez amelialmartinez deleted the issue-86-hangingMechanism branch November 7, 2023 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants