Merge branch 'main' of https://git.demerso.net/sdesharnais/Rebuilt-2026
This commit is contained in:
@@ -64,7 +64,7 @@ public class Lancer extends Command {
|
|||||||
lanceur.Lancer(output);
|
lanceur.Lancer(output);
|
||||||
if(lanceur.Vitesse() >= vitesse-800){
|
if(lanceur.Vitesse() >= vitesse-800){
|
||||||
timer.start();
|
timer.start();
|
||||||
if(timer.get() >0.5){
|
if(timer.get() >1){
|
||||||
lanceur.Demeler(1);
|
lanceur.Demeler(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,14 @@ public class LancerAuto extends Command {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
double[] BotPose = new double[6];
|
double[] BotPose = new double[6];
|
||||||
if(limelight3g.getV()){
|
if(limelight3g.getV()){
|
||||||
|
if(alliance.isPresent()){
|
||||||
if(alliance.get() == Alliance.Blue){
|
if(alliance.get() == Alliance.Blue){
|
||||||
BotPose = limelight3g.getBotPoseBlue();
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
BotPose = limelight3g.getBotPoseRed();
|
BotPose = limelight3g.getBotPoseRed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
botx = BotPose[0];
|
botx = BotPose[0];
|
||||||
boty = BotPose[1];
|
boty = BotPose[1];
|
||||||
}
|
}
|
||||||
@@ -62,7 +63,7 @@ public class LancerAuto extends Command {
|
|||||||
lanceur.Lancer(output);
|
lanceur.Lancer(output);
|
||||||
if(lanceur.Vitesse() >= vitesse-800){
|
if(lanceur.Vitesse() >= vitesse-800){
|
||||||
timer.start();
|
timer.start();
|
||||||
if(timer.get() >0.5){
|
if(timer.get() >1){
|
||||||
lanceur.Demeler(1);
|
lanceur.Demeler(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class LimelighterAuto extends Command {
|
|||||||
double boty;
|
double boty;
|
||||||
double angle;
|
double angle;
|
||||||
double calcul;
|
double calcul;
|
||||||
Optional<Alliance> alliance = DriverStation.getAlliance();
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
@@ -45,21 +45,24 @@ public class LimelighterAuto extends Command {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
double[] BotPose = new double[6];
|
double[] BotPose = new double[6];
|
||||||
System.out.println("e");
|
System.out.println("a");
|
||||||
if (limelight3g.getV()) {
|
if (limelight3g.getV()) {
|
||||||
if(alliance.get() == Alliance.Blue){
|
if(alliance.isPresent()){
|
||||||
|
if(alliance.get() == Alliance.Blue){
|
||||||
BotPose = limelight3g.getBotPoseBlue();
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
BotPose = limelight3g.getBotPoseRed();
|
BotPose = limelight3g.getBotPoseRed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
botx = BotPose[1];
|
botx = BotPose[1];
|
||||||
boty = BotPose[0];
|
boty = BotPose[0];
|
||||||
angle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
|
angle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
|
||||||
|
|||||||
Reference in New Issue
Block a user