mode auto
This commit is contained in:
@@ -52,13 +52,18 @@ public class TournerVersReservoir extends Command {
|
||||
angle = 0;
|
||||
}
|
||||
}
|
||||
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() > angle && drivetrain.getPigeon2().getYaw().getValueAsDouble() < angle + 10){
|
||||
drivetrain.setControl(drive.withRotationalRate(0));
|
||||
}
|
||||
else{
|
||||
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >0 && drivetrain.getPigeon2().getYaw().getValueAsDouble() <180){
|
||||
drivetrain.setControl(drive.withRotationalRate(-force*180/Math.PI));
|
||||
drivetrain.setControl(drive.withRotationalRate(-force*2));
|
||||
}
|
||||
else if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >180){
|
||||
drivetrain.setControl(drive.withRotationalRate(force*180/Math.PI));
|
||||
drivetrain.setControl(drive.withRotationalRate(force*2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
@@ -67,6 +72,6 @@ public class TournerVersReservoir extends Command {
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return drivetrain.getPigeon2().getYaw().getValueAsDouble() > angle && drivetrain.getPigeon2().getYaw().getValueAsDouble() < angle + 10;
|
||||
return drivetrain.getPigeon2().getYaw().getValueAsDouble() > angle && drivetrain.getPigeon2().getYaw().getValueAsDouble() < angle + 10;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user