This commit is contained in:
Samuel
2025-11-12 18:57:29 -05:00
5 changed files with 41 additions and 27 deletions

View File

@@ -151,7 +151,7 @@ public class RobotContainer {
elevateur.setDefaultCommand(new RunCommand(()->{ elevateur.setDefaultCommand(new RunCommand(()->{
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY()*manette2.getLeftY()*manette2.getLeftY(), 0.05)); elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY()*manette2.getLeftY()*manette2.getLeftY(), 0.05));
}, elevateur)); }, elevateur));
//Reset encodeur //Reset encodeur
manette2.start().whileTrue(new reset(elevateur, pince, requin)); manette2.start().whileTrue(new reset(elevateur, pince, requin));
} }

View File

@@ -63,22 +63,10 @@ public class AprilTag3 extends Command {
} }
else if(Botyaw >90 && Botyaw <=180){ else if(Botyaw >90 && Botyaw <=180){
drivetrain.setControl(drive. drivetrain.setControl(drive.
withRotationalRate(tx/20). withRotationalRate(a/20).
withVelocityX(MathUtil.clamp(-x/4, -1, 1)). withVelocityX(0).
withVelocityY(MathUtil.clamp(z/4, -1, 1))); withVelocityY( b/50));
} System.out.println(b/50);
else if(Botyaw >-90 && Botyaw <=0){
drivetrain.setControl(drive.
withRotationalRate(tx/20).
withVelocityX(MathUtil.clamp(-x/4, -1, 1)).
withVelocityY(MathUtil.clamp(-z/4, -1, 1)));
}
else if(Botyaw >-180 && Botyaw <=-90){
drivetrain.setControl(drive.
withRotationalRate(tx/20).
withVelocityX(MathUtil.clamp(x/4, -1, 1)).
withVelocityY(MathUtil.clamp(-z/4, -1, 1)));
}
} }
else{ else{
drivetrain.setControl(drive. drivetrain.setControl(drive.

View File

@@ -31,7 +31,7 @@ public class Algue_inspire extends Command {
@Override @Override
public void execute() { public void execute() {
if(pince.emperagealgue()>60){ if(pince.emperagealgue()>90){
pince.aspirealgue(0); pince.aspirealgue(0);
bougie.Bleu(); bougie.Bleu();
} }

View File

@@ -32,7 +32,7 @@ public class CoralExpire extends Command {
} }
*/ */
pince.aspirecoral(-.5); pince.aspirecoral(-.5);
bougie.Jaune(); bougie.Rouge();
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.

View File

@@ -22,20 +22,46 @@ public class Bougie extends SubsystemBase {
CANdleConfiguration config = new CANdleConfiguration(); CANdleConfiguration config = new CANdleConfiguration();
LarsonAnimation rainbowAnim = new LarsonAnimation(256,0,0,0,0.1,68,BounceMode.Front,10,8); LarsonAnimation rainbowAnim = new LarsonAnimation(256,0,0,0,0.1,68,BounceMode.Front,10,8);
//TwinkleOffAnimation rainbowAnim = new TwinkleOffAnimation(256, 0, 0,0,0.5,68,TwinkleOffPercent.Percent88,8); //TwinkleOffAnimation rainbowAnim = new TwinkleOffAnimation(256, 0, 0,0,0.5,68,TwinkleOffPercent.Percent88,8);
int led = 16;
int led2 = 8;
boolean x =true;
/** Creates a new Bougie. */ /** Creates a new Bougie. */
public Bougie() { public Bougie() {
config.brightnessScalar = 0.5; config.brightnessScalar = 0.5;
candle.configAllSettings(config); candle.configAllSettings(config);
} }
public void Rouge() { public void Rouge() {
candle.setLEDs(255, 0, 0,0,8,8); if(x){
candle.setLEDs(255, 0, 0,0,24,8); candle.setLEDs(255, 0, 0,0,led,8);
candle.setLEDs(255, 0, 0,0,40,8); led++;
candle.setLEDs(255, 0, 0,0,56,8); candle.setLEDs(0, 0, 0,0,led2,8);
candle.setLEDs(255, 0, 0,0,72,8); led2++;
candle.setLEDs(255, 0, 0,0,88,8); System.out.println("led monte");
candle.setLEDs(255, 0, 0,0,104,8); System.out.println(led);
candle.setLEDs(255, 0, 0,0,120,8); if(led>=68){
x=false;
System.out.println("true");
System.out.println(x);
}
}
if(!x){
candle.setLEDs(255, 0, 0,0,led2,8);
led2--;
candle.setLEDs(0, 0, 0,0,led,8);
led--;
System.out.println("leds descendent");
if(led==15){
x=true;
System.out.println("false");
}}
// candle.setLEDs(255, 0, 0,0,24,8);
// candle.setLEDs(255, 0, 0,0,40,8);
// candle.setLEDs(255, 0, 0,0,56,8);
// candle.setLEDs(255, 0, 0,0,72,8);
// candle.setLEDs(255, 0, 0,0,88,8);
// candle.setLEDs(255, 0, 0,0,104,8);
// candle.setLEDs(255, 0, 0,0,120,8);
} }
public void Vert() { public void Vert() {
candle.setLEDs(0, 255, 0,0,8,8); candle.setLEDs(0, 255, 0,0,8,8);