This commit is contained in:
Antoine PerreaultE 2023-03-07 17:56:38 -05:00
commit 8d758056c1
9 changed files with 186 additions and 7 deletions

Binary file not shown.

92
simgui-ds.json Normal file
View File

@ -0,0 +1,92 @@
{
"keyboardJoysticks": [
{
"axisConfig": [
{
"decKey": 65,
"incKey": 68
},
{
"decKey": 87,
"incKey": 83
},
{
"decKey": 69,
"decayRate": 0.0,
"incKey": 82,
"keyRate": 0.009999999776482582
}
],
"axisCount": 3,
"buttonCount": 4,
"buttonKeys": [
90,
88,
67,
86
],
"povConfig": [
{
"key0": 328,
"key135": 323,
"key180": 322,
"key225": 321,
"key270": 324,
"key315": 327,
"key45": 329,
"key90": 326
}
],
"povCount": 1
},
{
"axisConfig": [
{
"decKey": 74,
"incKey": 76
},
{
"decKey": 73,
"incKey": 75
}
],
"axisCount": 2,
"buttonCount": 4,
"buttonKeys": [
77,
44,
46,
47
],
"povCount": 0
},
{
"axisConfig": [
{
"decKey": 263,
"incKey": 262
},
{
"decKey": 265,
"incKey": 264
}
],
"axisCount": 2,
"buttonCount": 6,
"buttonKeys": [
260,
268,
266,
261,
269,
267
],
"povCount": 0
},
{
"axisCount": 0,
"buttonCount": 0,
"povCount": 0
}
]
}

17
simgui.json Normal file
View File

@ -0,0 +1,17 @@
{
"NTProvider": {
"types": {
"/FMSInfo": "FMSInfo"
}
},
"NetworkTables": {
"transitory": {
"Shuffleboard": {
".metadata": {
"open": true
},
"open": true
}
}
}
}

View File

@ -5,17 +5,23 @@ public class Constants {
public static int avantgauche = 1; public static int avantgauche = 1;
public static int arrieredroit = 2; public static int arrieredroit = 2;
public static int arrieregauche = 3; public static int arrieregauche = 3;
<<<<<<< HEAD
public static int BrasTelescopique = 4; public static int BrasTelescopique = 4;
public static int pivot = 5; public static int pivot = 5;
//moteur //moteur
public static int leverGratte = 0; public static int leverGratte = 0;
public static int baisserGratte = 1; public static int baisserGratte = 1;
=======
public static int leverGratte = 7;
public static int baisserGratte = 6;
>>>>>>> Dash
// pneumatique // pneumatique
public static int pistonpinceouvre = 0; public static int pistonpinceouvre = 0;
public static int pistonpinceferme = 1; public static int pistonpinceferme = 1;
public static int actuateur = 2; public static int actuateur = 8;
public static int brakedroit = 3; public static int brakedroit = 3;
public static int brakegauche = 4; public static int brakegauche = 4;
public static int brakewinchf = 5; public static int brakewinchf = 5;

View File

@ -6,6 +6,7 @@ package frc.robot;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.Commands;
<<<<<<< HEAD
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
@ -63,6 +64,23 @@ PivoteBrasMilieux pivoteBrasMilieux = new PivoteBrasMilieux(brasTelescopique, pi
PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot); PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot);
Cone cone = new Cone(limelight, basePilotable, ()->-manette1.getLeftY()); Cone cone = new Cone(limelight, basePilotable, ()->-manette1.getLeftY());
public RobotContainer() { public RobotContainer() {
=======
import frc.robot.subsystems.BasePilotable;
import frc.robot.subsystems.Gratte;
import frc.robot.subsystems.Limelight;
import frc.robot.subsystems.bras.BrasTelescopique;
import frc.robot.subsystems.bras.Pince;
import frc.robot.subsystems.bras.Pivot;
public class RobotContainer {
BasePilotable basePilotable = new BasePilotable();
Gratte gratte = new Gratte();
BrasTelescopique brasTelescopique = new BrasTelescopique();
Pince pince = new Pince();
Pivot pivot = new Pivot();
Limelight limelight = new Limelight();
public RobotContainer() {
>>>>>>> Dash
configureBindings(); configureBindings();
basePilotable.setDefaultCommand(new RunCommand(() -> { basePilotable.setDefaultCommand(new RunCommand(() -> {

View File

@ -13,7 +13,9 @@ import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.drive.DifferentialDrive; import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup; import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; 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.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants; import frc.robot.Constants;
@ -32,6 +34,9 @@ public class BasePilotable extends SubsystemBase {
private DoubleSolenoid brakegauche = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakegauche, Constants.brakegauche); private DoubleSolenoid brakegauche = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakegauche, Constants.brakegauche);
//gyro //gyro
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout layout = Shuffleboard.getTab("teb")
.getLayout ("encodeurs base pilotable", BuiltInLayouts.kList)
.withSize(2, 2);
private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();} private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();}
public double getpitch() { public double getpitch() {
return gyroscope.getPitch(); return gyroscope.getPitch();
@ -70,10 +75,6 @@ public void resetGyro(){
@Override @Override
public void periodic() { public void periodic() {
teb .add("encodeuravantdroit",0.1);
teb .add("encodeurarrieregauche",0.1);
teb .add("encodeurarrieredroit",0.1);
teb .add("encodeuravantgauche",0.1);
teb .add("distance",0.1); teb .add("distance",0.1);
teb .add("brakedroit",0.1); teb .add("brakedroit",0.1);
teb .add("brakegauche", 0.1); teb .add("brakegauche", 0.1);

View File

@ -7,12 +7,25 @@ package frc.robot.subsystems;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalInput;
<<<<<<< HEAD
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
=======
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
>>>>>>> Dash
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import frc.robot.Constants; import frc.robot.Constants;
public class Gratte extends SubsystemBase { public class Gratte extends SubsystemBase {
<<<<<<< HEAD
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
=======
ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
.getLayout("limitswitchsgratte", BuiltInLayouts.kList)
.withSize(2, 2);
>>>>>>> Dash
private WPI_TalonSRX Gratted = new WPI_TalonSRX(Constants.leverGratte); private WPI_TalonSRX Gratted = new WPI_TalonSRX(Constants.leverGratte);
private WPI_TalonSRX Gratteg = new WPI_TalonSRX(Constants.baisserGratte); private WPI_TalonSRX Gratteg = new WPI_TalonSRX(Constants.baisserGratte);
private DigitalInput limithd = new DigitalInput(Constants.limithd); private DigitalInput limithd = new DigitalInput(Constants.limithd);
@ -46,9 +59,16 @@ public class Gratte extends SubsystemBase {
} }
@Override @Override
public void periodic() { public void periodic() {
<<<<<<< HEAD
teb .add("limithd", 0.1); teb .add("limithd", 0.1);
teb .add("limithg", 0.1); teb .add("limithg", 0.1);
teb .add("limitbd", 0.1); teb .add("limitbd", 0.1);
teb .add("limitbg", 0.1); teb .add("limitbg", 0.1);
=======
limitswitchgratte.add ("limitbd", 0.1);
limitswitchgratte.add ("limithg", 0.1);
limitswitchgratte.add ("limithd", 0.1);
limitswitchgratte.add ("limitbg", 0.1);
>>>>>>> Dash
} }
} }

View File

@ -8,10 +8,13 @@ package frc.robot.subsystems.bras;
import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.CANSparkMaxLowLevel.MotorType;
<<<<<<< HEAD
import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
=======
>>>>>>> Dash
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
@ -20,10 +23,18 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants; import frc.robot.Constants;
public class BrasTelescopique extends SubsystemBase { public class BrasTelescopique extends SubsystemBase {
<<<<<<< HEAD
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout layout = Shuffleboard.getTab("teb") ShuffleboardLayout layout = Shuffleboard.getTab("teb")
.getLayout("layout", BuiltInLayouts.kList) .getLayout("layout", BuiltInLayouts.kList)
.withSize(2, 2); .withSize(2, 2);
=======
ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout bras = Shuffleboard.getTab("teb")
.getLayout("bras", BuiltInLayouts.kList)
.withSize(2, 2);
>>>>>>> Dash
/** Creates a new BrasTelescopique. */ /** Creates a new BrasTelescopique. */
public BrasTelescopique() {} public BrasTelescopique() {}
final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless); final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless);
@ -49,7 +60,11 @@ public class BrasTelescopique extends SubsystemBase {
} }
@Override @Override
public void periodic() { public void periodic() {
<<<<<<< HEAD
teb .add("photocell",0.1); teb .add("photocell",0.1);
teb .add("winch",0.1); teb .add("winch",0.1);
=======
bras.add ("encodeur",0.1);
>>>>>>> Dash
} }
} }

View File

@ -14,7 +14,11 @@ import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.CANSparkMaxLowLevel.MotorType;
public class Pivot extends SubsystemBase { public class Pivot extends SubsystemBase {
<<<<<<< HEAD
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
=======
ShuffleboardTab teb = Shuffleboard.getTab("teb");
>>>>>>> Dash
// moteur // moteur
private CANSparkMax pivot = new CANSparkMax(Constants.pivot,MotorType.kBrushless); private CANSparkMax pivot = new CANSparkMax(Constants.pivot,MotorType.kBrushless);
private DigitalInput limitpivot = new DigitalInput(Constants.limitpivot); private DigitalInput limitpivot = new DigitalInput(Constants.limitpivot);
@ -23,7 +27,7 @@ public class Pivot extends SubsystemBase {
public void monteDescendre(double vitesse) { public void monteDescendre(double vitesse) {
pivot.set (vitesse); pivot.set (vitesse);
} }
// encoder // encodeur
public double distance(){ public double distance(){
return (pivot.getEncoder().getPosition()); return (pivot.getEncoder().getPosition());
} }
@ -36,6 +40,12 @@ public class Pivot extends SubsystemBase {
} }
@Override @Override
public void periodic() { public void periodic() {
<<<<<<< HEAD
teb .add("encodeur", 0.1); teb .add("encodeur", 0.1);
} }
} }
=======
teb .add ("encodeur pivot",0.1);
}
}
>>>>>>> Dash