-
Notifications
You must be signed in to change notification settings - Fork 0
Add Servo for Limelight/toggle button #37
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
| public void changeServoStatus(boolean status) { | ||
| isLimelightSearching = status; | ||
| if (isLimelightSearching() == false) { | ||
| limelightServo.setAngle(kLimeBottomAngle); // TODO: set correct angle | ||
| } else { | ||
| limelightServo.setAngle(kLimeTopAngle); // TODO: set correct angle | ||
| } | ||
| } |
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 will actually set the limelight to the opposite state of isLimelightSearching. If true is passed into the function (indicating that the Limelight should be searching), isLimelightSearching will become true, so isLimelightSearching == false will be false. Thus, limelightServo.setAngle(kLimeTopAngle); will be called instead of limelightServo.setAngle(kLimeBottomAngle);
| public static final int kIntakeButton = X; | ||
| public static final int kOuttakeButton = Y; | ||
| // limelight toggle | ||
| public static final int kLimelightToggleButton = 0; //TODO: set button |
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.
Work with the driver to pick an unused button. I'm concerned that 0 might interfere with an existing button or cause a runtime error.
| private static double kLimeTopAngle = 0; //TODO: set correct angle | ||
|
|
||
| private final CANSparkMax rollerMotor = MotorControllerFactory.createSparkMax(Constants.DrivePorts.kIntakeRoller); | ||
| private final Servo limelightServo = new Servo(0); //TODO: set proper channel |
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.
Move the 0 and TODO to Constants.java with other port numbers.
| public boolean isLimelightSearching() { | ||
| return isLimelightSearching; | ||
| } | ||
| public void changeServoStatus(boolean status) { |
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.
Rename to setLimelightSearching(), since it isn't clear what a "servo status" is or what true or false would mean.
| private static double kLimeBottomAngle = 0; //TODO: set correct angle | ||
| private static double kLimeTopAngle = 0; //TODO: set correct angle |
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.
Specify units in variable names (e.g. kLimeBottomAngleDegs).
…BlueRobotics/RobotCode2021 into support-turning-limelight-2
Fixed command for Limelight Servo, added button to toggle limelight