-
Notifications
You must be signed in to change notification settings - Fork 0
Initial Ports and Controls #58
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: master
Are you sure you want to change the base?
Conversation
Make the robot drive work and code run
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.
One changes has been ordered.
src/main/java/frc/robot/Climb.java
Outdated
@@ -22,7 +22,11 @@ public Climb(SpeedController winchMotor, SpeedController armMotor, int armLockPi | |||
} | |||
|
|||
public void runWinch(double power) { | |||
winchMotor.set(power); | |||
if (!armLockPiston.get()) { |
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.
Make a method boolean getWinchLocked()
and use that here.
…ics/2020-FRC-robot into better-controls
@@ -76,7 +76,7 @@ public void update() { | |||
* @param power positive is counter clockwise | |||
*/ | |||
public void moveRotator(double power) { | |||
rotatorMotor.set(power); | |||
rotatorMotor.set(0.1 * power); |
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.
For best limiting of the power, we should put limit the input values to [-1, 1]. Otherwise, an enterprising individual could moveRotator(10);
.
src/main/java/frc/robot/Robot.java
Outdated
// ballChucker9000.moveRotator(ballChucker9000.getRotatorEncoder() >= 270 ? 0 : 0.5); | ||
ballChucker9000.moveRotator(0.5); | ||
} else if (manipulator.getButton(Button.LEFT_BUMPER)) { | ||
ballChucker9000.moveRotator(ballChucker9000.getRotatorEncoder() <= 0 ? 0 : -0.1); | ||
// ballChucker9000.moveRotator(ballChucker9000.getRotatorEncoder() <= 0 ? 0 : -0.5); | ||
ballChucker9000.moveRotator(-0.5); |
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 do not love commented code. It can stay iff there is a good reason to keep it as a comment and a comment for why we are keeping the code is added.
} else { | ||
climb.runWinch(0); | ||
climb.runWinch(-0.5 * manipulator.getAxis(Axis.LEFT_TRIGGER)); |
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 need to run the winch in reverse?
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.
In case there's not enough slack. Mostly for testing
src/main/java/frc/robot/Robot.java
Outdated
ButtonToggleRunner testWinchLockToggleRunner; | ||
|
||
@Override | ||
public void testInit() { | ||
testWinchLockToggleRunner = new ButtonToggleRunner(() -> rightJoystick.getTrigger(), climb::toggleLock); | ||
} |
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 still need this code?
Not to be merged until tested.