Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025
This commit is contained in:
@@ -151,7 +151,7 @@ public class RobotContainer {
|
||||
elevateur.setDefaultCommand(new RunCommand(()->{
|
||||
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY()*manette2.getLeftY()*manette2.getLeftY(), 0.05));
|
||||
}, elevateur));
|
||||
|
||||
|
||||
//Reset encodeur
|
||||
manette2.start().whileTrue(new reset(elevateur, pince, requin));
|
||||
}
|
||||
|
||||
@@ -63,22 +63,10 @@ public class AprilTag3 extends Command {
|
||||
}
|
||||
else if(Botyaw >90 && Botyaw <=180){
|
||||
drivetrain.setControl(drive.
|
||||
withRotationalRate(tx/20).
|
||||
withVelocityX(MathUtil.clamp(-x/4, -1, 1)).
|
||||
withVelocityY(MathUtil.clamp(z/4, -1, 1)));
|
||||
}
|
||||
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)));
|
||||
}
|
||||
withRotationalRate(a/20).
|
||||
withVelocityX(0).
|
||||
withVelocityY( b/50));
|
||||
System.out.println(b/50);
|
||||
}
|
||||
else{
|
||||
drivetrain.setControl(drive.
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Algue_inspire extends Command {
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
if(pince.emperagealgue()>60){
|
||||
if(pince.emperagealgue()>90){
|
||||
pince.aspirealgue(0);
|
||||
bougie.Bleu();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CoralExpire extends Command {
|
||||
}
|
||||
*/
|
||||
pince.aspirecoral(-.5);
|
||||
bougie.Jaune();
|
||||
bougie.Rouge();
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
|
||||
@@ -22,20 +22,46 @@ public class Bougie extends SubsystemBase {
|
||||
CANdleConfiguration config = new CANdleConfiguration();
|
||||
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);
|
||||
int led = 16;
|
||||
int led2 = 8;
|
||||
boolean x =true;
|
||||
/** Creates a new Bougie. */
|
||||
public Bougie() {
|
||||
config.brightnessScalar = 0.5;
|
||||
candle.configAllSettings(config);
|
||||
}
|
||||
public void Rouge() {
|
||||
candle.setLEDs(255, 0, 0,0,8,8);
|
||||
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);
|
||||
if(x){
|
||||
candle.setLEDs(255, 0, 0,0,led,8);
|
||||
led++;
|
||||
candle.setLEDs(0, 0, 0,0,led2,8);
|
||||
led2++;
|
||||
System.out.println("led monte");
|
||||
System.out.println(led);
|
||||
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() {
|
||||
candle.setLEDs(0, 255, 0,0,8,8);
|
||||
|
||||
Reference in New Issue
Block a user