Skip to content

Conversation

@Sean-Weber
Copy link
Contributor

Fixed command for Limelight Servo, added button to toggle limelight

Comment on lines 87 to 94
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
}
}
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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) {
Copy link
Member

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.

Comment on lines 19 to 20
private static double kLimeBottomAngle = 0; //TODO: set correct angle
private static double kLimeTopAngle = 0; //TODO: set correct angle
Copy link
Member

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).

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.

6 participants