Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
adjusted limelight settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Wedgehead99 authored and John Lawniczak committed Feb 1, 2020
1 parent f698796 commit b8fbbe0
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public void execute() {
// drive forward constnagt slow speed
// adjust angle robot is at as needed
double haveTarget = NetworkTableInstance.getDefault().getTable("limelight").getEntry("tv").getDouble(0);
System.out.println(haveTarget);
double angleToTarget=NetworkTableInstance.getDefault().getTable("limelight").getEntry("tx").getDouble(0);
System.out.println("tx = " + angleToTarget);
if(haveTarget == 0 && hadTarget == 0) {
//Rumble soft if NO target
Robot.robotContainer.setDriverRumble(0.7, 0);
Expand Down Expand Up @@ -88,15 +86,11 @@ public void execute() {
if (Math.abs(angleToTarget) < .5){
rotateValue = 0;
}else{
rotateValue = ((angleToTarget-1)/35)*(moveValue+.45);//*12.5/ControllerPower.getInputVoltage();
// if(Math.abs(rotateValue) < .07){
// if(rotateValue > 0){
// rotateValue = .07;
// }
// else{
// rotateValue = -.07;
// }
// }
double variable = .5;
//finds the speed we want to move in proportion to how far away we are from the target, modify the variable value to vary the
//speed and accuracy at which the limelight finds the target
rotateValue = (((angleToTarget)/35)*(moveValue+.45)) * variable;
System.out.println(rotateValue);
}

double rightSpeed = moveValue + rotateValue;
Expand Down

0 comments on commit b8fbbe0

Please sign in to comment.