Compare commits

...

10 Commits

Author SHA1 Message Date
EdwardFaucher
630cdc0069 mv jvn 2022-12-10 14:54:00 -05:00
EdwardFaucher
92d35d19f8 hncfcb 2022-12-10 14:53:29 -05:00
EdwardFaucher
14db0f41fb k 2022-12-06 19:47:33 -05:00
EdwardFaucher
4cc79c8a1f j 2022-12-06 19:46:32 -05:00
EdwardFaucher
3017c7cbdc j 2022-12-06 19:45:40 -05:00
EdwardFaucher
1a9f2a8fd2 valeur mode auto 2022-12-06 18:37:17 -05:00
EdwardFaucher
e4d29bfc50 gh 2022-12-06 18:25:06 -05:00
EdwardFaucher
bddfad72d6 se 2022-12-06 18:11:39 -05:00
EdwardFaucher
4c0062c9d6 h 2022-12-06 18:09:59 -05:00
EdwardFaucher
1fa39c16e6 g 2022-12-06 18:04:35 -05:00
5 changed files with 11 additions and 10 deletions

View File

@ -17,8 +17,8 @@ package frc.robot;
public final class Constants { public final class Constants {
public static final int MoteurAvantGauche = (3); public static final int MoteurAvantGauche = (3);
public static final int MoteurAvantDroit = (4); public static final int MoteurAvantDroit = (4);
public static final int MoteurArriereGauche = (1); public static final int MoteurArriereGauche = (2);
public static final int MoteurArriereDroit = (2); public static final int MoteurArriereDroit = (1);
public static final int PistonPousserR = 0; public static final int PistonPousserR = 0;
public static final int PistonPousserF = 1; public static final int PistonPousserF = 1;

View File

@ -3,6 +3,7 @@
// the WPILib BSD license file in the root directory of this project. // the WPILib BSD license file in the root directory of this project.
package frc.robot; package frc.robot;
import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.wpilibj.GenericHID; import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
@ -10,7 +11,6 @@ import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand; import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import edu.wpi.first.wpilibj2.command.button.JoystickButton; import edu.wpi.first.wpilibj2.command.button.JoystickButton;
// subsystems // subsystems
import frc.robot.subsystems.BasePilotable; import frc.robot.subsystems.BasePilotable;
@ -20,9 +20,6 @@ import frc.robot.subsystems.Pistonshaker;
import frc.robot.commands.Activer_poussoir; import frc.robot.commands.Activer_poussoir;
import frc.robot.commands.ActiverBlockeur; import frc.robot.commands.ActiverBlockeur;
import frc.robot.commands.DesactiverBlockeur; import frc.robot.commands.DesactiverBlockeur;
import frc.robot.commands.Reculer;
import frc.robot.commands.TournerDroite;
import frc.robot.commands.TournerGauche;
import frc.robot.commands.Activershaker; import frc.robot.commands.Activershaker;
import frc.robot.commands.Avancer; import frc.robot.commands.Avancer;
import frc.robot.commands.BoutonA; import frc.robot.commands.BoutonA;
@ -49,12 +46,16 @@ public class RobotContainer {
/** The container for the robot. Contains subsystems, OI devices, and commands. */ /** The container for the robot. Contains subsystems, OI devices, and commands. */
public RobotContainer() { public RobotContainer() {
CameraServer.startAutomaticCapture();
SmartDashboard.putNumber("AvancerVit", -0.3);
SmartDashboard.putNumber("avancer", 2.71);
// Configure the button bindings // Configure the button bindings
configureButtonBindings(); configureButtonBindings();
basePilotable.setDefaultCommand( basePilotable.setDefaultCommand(
new RunCommand( new RunCommand(
()-> basePilotable.drive(manette.getLeftY(), manette.getLeftX(), manette.getLeftTriggerAxis()-manette.getRightTriggerAxis()), basePilotable) ()-> basePilotable.drive(-manette.getLeftY(), manette.getLeftX(), -manette.getLeftTriggerAxis()+manette.getRightTriggerAxis()), basePilotable)
); );
} }

View File

@ -21,7 +21,7 @@ public class ActiverBlockeur extends CommandBase {
@Override @Override
public void initialize() { public void initialize() {
poussoir.debloque(); poussoir.bloquer();
} }
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.

View File

@ -31,7 +31,7 @@ public double getangle() {
return gyroscope.getAngle(); return gyroscope.getAngle();
} }
public void drive(double y, double x, double rot){ public void drive(double y, double x, double rot){
mecanum.driveCartesian(y, rot, -x, 0); mecanum.driveCartesian(y, x, rot, getangle());
} }
public void resetgyro(){ public void resetgyro(){
try { gyroscope.reset(); } catch( Exception e) {DriverStation.reportError("bye bye", true); } try { gyroscope.reset(); } catch( Exception e) {DriverStation.reportError("bye bye", true); }

View File

@ -15,7 +15,7 @@ public class Poussoir extends SubsystemBase {
private DoubleSolenoid bloqueur = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonBloqueurR,Constants.pistonBloqueurF); private DoubleSolenoid bloqueur = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonBloqueurR,Constants.pistonBloqueurF);
/** Creates a new Poussoir. */ /** Creates a new Poussoir. */
public Poussoir() { public Poussoir() { bloquer();
} }