This commit is contained in:
samuel desharnais 2023-12-02 12:16:23 -05:00
commit 5f64677db7
9 changed files with 46 additions and 7 deletions

View File

@ -36,7 +36,7 @@ public class RobotContainer {
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard")
.getLayout("Dashboard", BuiltInLayouts.kList)
.getLayout("forces", BuiltInLayouts.kList)
.withSize(3, 7);
GenericEntry force1 = forces.add("Force1", 2).getEntry();
GenericEntry force2 = forces.add("Force2", 0).getEntry();
@ -76,3 +76,5 @@ public class RobotContainer {
, new Lancer(lanceur, accumulateur, force1), new Reculer(drive));
}
}
/* return new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur)
, new Force1(lanceur, accumulateur, force1), new Reculer(drive));*/

View File

@ -4,13 +4,25 @@
package frc.robot.commands;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.subsystems.Drive;
public class Avancer extends CommandBase {
private Drive drive;
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
ShuffleboardLayout avancer = Shuffleboard.getTab("Dashboard")
.getLayout("Avancer", BuiltInLayouts.kList)
.withSize(3, 3);
/** Creates a new Avancer. */
public Avancer(Drive drive) {
avancer.add("vitesse x", 1);
avancer.add("vitesse y", 2);
avancer.add("vitesse z", 3);
avancer.add("distance", 4);
this.drive = drive;
addRequirements(drive);
// Use addRequirements() here to declare subsystem dependencies.

View File

@ -43,7 +43,7 @@ public class Force4 extends CommandBase {
accumulateur.stop();
}
lanceur.lancer(force4.getDouble(0));
}
// Called once the command ends or is interrupted.

View File

@ -43,7 +43,7 @@ public class Force5 extends CommandBase {
accumulateur.stop();
}
lanceur.lancer(force5.getDouble(0));
}
// Called once the command ends or is interrupted.

View File

@ -42,7 +42,7 @@ public class Force6 extends CommandBase {
accumulateur.stop();
}
lanceur.lancer(force6.getDouble(0));
}
// Called once the command ends or is interrupted.

View File

@ -41,7 +41,6 @@ public class Force7 extends CommandBase {
accumulateur.stop();
}
lanceur.lancer(force7.getDouble(0));
}
// Called once the command ends or is interrupted.

View File

@ -29,6 +29,9 @@ public class Lancez extends CommandBase {
lanceur.lancer(0);
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {

View File

@ -4,13 +4,25 @@
package frc.robot.commands;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.subsystems.Drive;
public class Reculer extends CommandBase {
private Drive drive;
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
ShuffleboardLayout reculer = Shuffleboard.getTab("Dashboard")
.getLayout("Reculer", BuiltInLayouts.kList)
.withSize(3, 3);
/** Creates a new Reculer. */
public Reculer(Drive drive) {
reculer.add("vitesse x", 1);
reculer.add("vitesse y", 2);
reculer.add("vitesse z", 3);
reculer.add("distance", 4);
this.drive = drive;
addRequirements(drive);
// Use addRequirements() here to declare subsystem dependencies.

View File

@ -7,12 +7,23 @@ package frc.robot.subsystems;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
public class Lanceur extends SubsystemBase {
public Lanceur(){}
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
ShuffleboardLayout pid = Shuffleboard.getTab("Dashboard")
.getLayout("Pid", BuiltInLayouts.kList)
.withSize(3, 7);
public Lanceur(){
pid.add("p", 1);
pid.add("i", 2);
pid.add("d", 3);
}
final CANSparkMax lanceur = new CANSparkMax(Constants.lanceur, MotorType.kBrushless);
public void lancer(double vitesse){