Compare commits
10 Commits
999eaae0a0
...
630cdc0069
Author | SHA1 | Date | |
---|---|---|---|
|
630cdc0069 | ||
|
92d35d19f8 | ||
|
14db0f41fb | ||
|
4cc79c8a1f | ||
|
3017c7cbdc | ||
|
1a9f2a8fd2 | ||
|
e4d29bfc50 | ||
|
bddfad72d6 | ||
|
4c0062c9d6 | ||
|
1fa39c16e6 |
@ -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;
|
||||||
|
@ -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)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
@ -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); }
|
||||||
|
@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user