This commit is contained in:
		| @@ -24,15 +24,16 @@ public class GrimpeurDroit extends Command { | ||||
|   @Override | ||||
|   public void initialize() { | ||||
|     grimpeur.resetencodeurd(); | ||||
|     grimpeur.resetencodeurg(); | ||||
|     grimpeur.pistonferme(); | ||||
|   } | ||||
|  | ||||
|   // Called every time the scheduler runs while the command is scheduled. | ||||
|   @Override | ||||
|   public void execute() { | ||||
|      | ||||
|   if(grimpeur.encoderd()>261 ){ | ||||
|     grimpeur.droit(doubleSupplier.getAsDouble()); | ||||
|   if(grimpeur.encoderd()>261){ | ||||
|     grimpeur.droit(0); | ||||
|      | ||||
|   } | ||||
|   else if(grimpeur.getpitch()<-15){ | ||||
|     grimpeur.droit(-doubleSupplier.getAsDouble()); | ||||
| @@ -44,6 +45,11 @@ public class GrimpeurDroit extends Command { | ||||
|   else{ | ||||
|     grimpeur.droit(0); | ||||
|   } | ||||
|   if(grimpeur.encoderd()>0){ | ||||
|     grimpeur.resetencodeurd(); | ||||
|     grimpeur.droit(0); | ||||
|      | ||||
|   } | ||||
|   } | ||||
|  | ||||
|   // Called once the command ends or is interrupted. | ||||
|   | ||||
| @@ -30,7 +30,8 @@ public class GrimpeurGauche extends Command { | ||||
|   // Called every time the scheduler runs while the command is scheduled. | ||||
|   @Override | ||||
|   public void execute() { | ||||
|     if(grimpeur.encoderg()>261 ){ | ||||
|     grimpeur.gauche(doubleSupplier.getAsDouble()); | ||||
|     if(grimpeur.encoderg()>261){ | ||||
|       grimpeur.gauche(0); | ||||
|     } | ||||
|     else if(grimpeur.getpitch()<-15){ | ||||
| @@ -43,6 +44,11 @@ public class GrimpeurGauche extends Command { | ||||
|     else{ | ||||
|       grimpeur.gauche(0); | ||||
|     } | ||||
|     if(grimpeur.encoderd()>0){ | ||||
|       grimpeur.resetencodeurg(); | ||||
|       grimpeur.gauche(0); | ||||
|        | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   // Called once the command ends or is interrupted. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user