Compare commits

..

82 Commits

Author SHA1 Message Date
75c59ddbe5 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-13 19:13:35 -05:00
a7a4c4ef31 2024-11-13 19:13:32 -05:00
1facdb07e5 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-13 18:56:33 -05:00
ab36e8dadf acc + update dash 2024-11-13 18:56:31 -05:00
c6017d60b4 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-13 18:51:34 -05:00
b7aec15b74 2024-11-13 18:51:31 -05:00
d3f7d01246 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-13 18:47:12 -05:00
125ad2c417 2024-11-13 18:47:11 -05:00
4ddd030426 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-11 19:27:23 -05:00
1fbc87cf67 accumulateur limitswitchs 2024-11-11 19:27:20 -05:00
035603c6eb Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-11 19:25:21 -05:00
b6b2f8f5f3 2024-11-11 19:25:20 -05:00
ab0439e309 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-11 19:12:45 -05:00
7d2ef1017c g 2024-11-11 19:12:41 -05:00
015fec18d2 antoine est un génie 2024-11-11 18:54:39 -05:00
d524a87319 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-11 18:47:21 -05:00
f06c9b0428 2024-11-11 18:47:19 -05:00
7b460fa3de Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-11 18:47:09 -05:00
908c5d0b96 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-11 18:43:24 -05:00
46a71c5fba led 2024-11-11 18:43:23 -05:00
a45f27eb7f talonFX 2024-11-11 18:30:54 -05:00
2b35ef9267 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-11 18:25:25 -05:00
b070971185 photocell2 2024-11-11 18:25:23 -05:00
2ca57f2556 mode auto 2024-11-08 08:40:19 -05:00
144c9a1d71 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-04 18:58:08 -05:00
368948b2aa touche 2024-11-04 18:58:07 -05:00
f7e38ca9bc Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-04 18:53:46 -05:00
1367087b14 commande limelight 3 forme + couleur manque pipline 2024-11-04 18:53:43 -05:00
e7be2d6428 touche 2024-11-04 18:52:16 -05:00
437bf16505 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-04 18:38:51 -05:00
c22c507da0 touche 2024-11-04 18:38:50 -05:00
a11b463cc2 pas sur de comment du pourquoi du comment orientation tourel dashboard 2024-11-04 18:33:13 -05:00
910caa963e Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-04 18:25:43 -05:00
bf63394d77 dahboard 2024-11-04 18:24:47 -05:00
954c82a7a0 j'aide oli 2024-11-04 18:23:33 -05:00
0063ce1722 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-04 18:10:59 -05:00
810ea210b1 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-11-04 17:47:30 -05:00
b8894d4efd navgrid 2024-11-04 17:47:26 -05:00
4197299808 ménage 2024-10-30 19:54:39 -04:00
bdbcf2e38f Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-30 19:41:49 -04:00
0e4efef6ee Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-30 19:41:45 -04:00
d0137d1531 C'est juste pathplanner... 2024-10-30 19:39:19 -04:00
8d93e7f24f Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-30 19:38:13 -04:00
4ece413126 DASHBOARD LANCEUR 2024-10-30 19:37:02 -04:00
f1406f0db0 limelight avec tourelle 2024-10-30 19:27:41 -04:00
9804a3cfbf apriltag mieu 2024-10-30 19:22:48 -04:00
9f51699e35 2024-10-30 19:19:59 -04:00
1c1e8fb714 lance 2024-10-30 19:16:34 -04:00
104c9195bc Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-30 19:14:18 -04:00
205da73570 lanceur 2024-10-30 19:14:16 -04:00
1989806378 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-30 19:14:08 -04:00
fd72aaf8bd Dashboard limelights et accumulateur 2024-10-30 19:14:06 -04:00
99525dc7d7 renomer 2024-10-30 19:10:31 -04:00
2533a3a462 command limelight (manque changer drive pour la tourelle) 2024-10-30 19:08:55 -04:00
ed5d3bc08b Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-30 18:57:02 -04:00
e9f55c9fd6 limelight helpers 2024-10-30 18:56:31 -04:00
bde1715f76 LIMELIGHT 3G 2024-10-30 18:46:48 -04:00
48a4f2e0f4 limelight lib 2024-10-30 18:28:42 -04:00
fc75e1f997 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-28 19:31:32 -04:00
d6508d513b 2024-10-28 19:31:31 -04:00
1a899887da Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-28 19:17:37 -04:00
7e65352246 limelight début 2024-10-28 19:17:34 -04:00
ee263139c1 vitesse 2024-10-28 19:07:29 -04:00
938198d4e2 oli me corrige 2024-10-28 19:04:46 -04:00
b460501b95 2024-10-28 18:52:56 -04:00
5e39e6fc4d Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-28 18:52:39 -04:00
6bec6011ca encodeur 2024-10-28 18:52:38 -04:00
e1111511b7 enlever la stupidité de Sam 2024-10-28 18:52:16 -04:00
c3d4b8c43c Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-28 18:50:46 -04:00
4944f4662b - encodeurs 2024-10-28 18:49:53 -04:00
4f6552202c Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-28 18:45:38 -04:00
adb6d5554f encodeur 2024-10-28 18:45:10 -04:00
eca7bb1891 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-23 19:47:53 -04:00
6687dc73ea accumulateur 2024-10-23 19:47:51 -04:00
ea96a16864 swerve 2024-10-23 19:34:20 -04:00
dfa05d79a7 YAGLS 2024-10-23 19:31:48 -04:00
650e8341ec Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-23 19:22:39 -04:00
025d9e47f0 2024-10-23 19:22:23 -04:00
f0cdb9a241 Merge branch 'main' of https://git.demerso.net/PLS5618/pratique-2025 2024-10-23 19:22:12 -04:00
ae9e9577c2 2024-10-23 19:22:09 -04:00
89d155ae5e encodeur 2024-10-23 19:17:48 -04:00
787251658c lanceur encodeur 2024-10-23 18:59:06 -04:00
26 changed files with 850 additions and 17 deletions

View File

@ -0,0 +1,12 @@
{
"robotWidth": 0.9,
"robotLength": 0.9,
"holonomicMode": true,
"pathFolders": [],
"autoFolders": [],
"defaultMaxVel": 3.0,
"defaultMaxAccel": 3.0,
"defaultMaxAngVel": 540.0,
"defaultMaxAngAccel": 720.0,
"maxModuleSpeed": 4.5
}

1
networktables.json Normal file
View File

@ -0,0 +1 @@
[]

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
}
]
}

10
simgui.json Normal file
View File

@ -0,0 +1,10 @@
{
"NTProvider": {
"types": {
"/FMSInfo": "FMSInfo"
}
},
"NetworkTables Info": {
"visible": true
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,68 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 5.764349477682812,
"y": 3.9299145299145297
},
"prevControl": null,
"nextControl": {
"x": 6.764349477682812,
"y": 3.9299145299145297
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.039563152896486,
"y": 4.872174738841406
},
"prevControl": {
"x": 7.039563152896486,
"y": 4.872174738841406
},
"nextControl": {
"x": 9.039563152896486,
"y": 4.872174738841406
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.36131054131054,
"y": 6.009781576448243
},
"prevControl": {
"x": 9.056657169990501,
"y": 6.61880341880342
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 0,
"velocity": 0
},
"useDefaultConstraints": true
}

View File

@ -0,0 +1,8 @@
{
"angleJoystickRadiusDeadband": 0.5,
"heading": {
"p": 0.4,
"i": 0,
"d": 0.01
}
}

View File

@ -0,0 +1,30 @@
{
"location": {
"front": -12.375,
"left": 12.375
},
"absoluteEncoderOffset":209.443,
"drive": {
"type": "talonFX",
"id": 8,
"canbus": null
},
"angle": {
"type": "talonFX",
"id": 9,
"canbus": null
},
"inverted": {
"angle": true,
"drive": false
},
"conversionFactor": {
"angle": 0,
"drive": 0
},
"encoder": {
"type": "cancoder",
"id": 6,
"canbus": null
}
}

View File

@ -0,0 +1,30 @@
{
"location": {
"front": -12.375,
"left": -12.375
},
"absoluteEncoderOffset": 5.537,
"drive": {
"type": "talonFX",
"id": 11,
"canbus": null
},
"angle": {
"type": "talonFX",
"id": 12,
"canbus": null
},
"inverted": {
"angle": true,
"drive": false
},
"conversionFactor": {
"angle": 0,
"drive": 0
},
"encoder": {
"type": "cancoder",
"id": 7,
"canbus": null
}
}

View File

@ -0,0 +1,30 @@
{
"location": {
"front": 12.375,
"left": 12.375
},
"absoluteEncoderOffset":258.223 ,
"drive": {
"type": "talonFX",
"id": 2,
"canbus": null
},
"angle": {
"type": "talonFX",
"id": 3,
"canbus": null
},
"inverted": {
"angle": true,
"drive": false
},
"conversionFactor": {
"angle": 0,
"drive": 0
},
"encoder": {
"type": "cancoder",
"id": 4,
"canbus": null
}
}

View File

@ -0,0 +1,30 @@
{
"location": {
"front": 12.375,
"left": -12.375
},
"absoluteEncoderOffset": 110.215,
"drive": {
"type": "talonFX",
"id": 18,
"canbus": null
},
"angle": {
"type": "talonFX",
"id": 17,
"canbus": null
},
"inverted": {
"angle": true,
"drive": false
},
"conversionFactor": {
"angle": 0,
"drive": 0
},
"encoder": {
"type": "cancoder",
"id": 5,
"canbus": null
}
}

View File

@ -0,0 +1,16 @@
{
"optimalVoltage": 12,
"wheelGripCoefficientOfFriction": 1.19,
"currentLimit": {
"drive": 40,
"angle": 20
},
"conversionFactor": {
"angle": 16.8,
"drive": 0.04
},
"rampRate": {
"drive": 0.25,
"angle": 0.25
}
}

View File

@ -0,0 +1,16 @@
{
"drive": {
"p": 0.0020645,
"i": 0,
"d": 0,
"f": 0,
"iz": 0
},
"angle": {
"p": 0.01,
"i": 0,
"d": 0,
"f": 0,
"iz": 0
}
}

View File

@ -0,0 +1,14 @@
{
"imu": {
"type": "pigeon",
"id": 0,
"canbus": null
},
"invertedIMU": false,
"modules": [
"frontleft.json",
"frontright.json",
"backleft.json",
"backright.json"
]
}

View File

@ -0,0 +1,38 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Commands;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Subsystems.Accumulateur;
public class Desaccumuler extends Command {
private Accumulateur accumulateur;
/** Creates a new Desaccumuler. */
public Desaccumuler(Accumulateur accumulateur){
this.accumulateur = accumulateur;
addRequirements(accumulateur);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@Override
public void initialize() {
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(accumulateur.photocell() || accumulateur.photocell2()){accumulateur.desaccumule(0.1);}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
accumulateur.desaccumule(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,51 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Commands;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Subsystems.Lanceur;
import frc.robot.Subsystems.Limelight3G;
public class FollowAprilTag extends Command {
private Limelight3G enlignement;
private Lanceur lanceur;
/** Creates a new Limelight3g. */
public FollowAprilTag(Limelight3G enlignement, Lanceur lanceur) {
// Use addRequirements() here to declare subsystem dependencies.
this.lanceur = lanceur;
this.enlignement = enlignement;
addRequirements(lanceur, enlignement);
}
// Called when the command is initially scheduled.
@Override
public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if (enlignement.getv()==1)
{
lanceur.tourelRotation(0,0, enlignement.getx()/30);
}
else
{
lanceur.tourelRotation(0, 0, 0);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
lanceur.tourelRotation(0, 0, 0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,48 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Commands;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Subsystems.Accumulateur;
import frc.robot.Subsystems.LED;
public class LEDactive extends Command {
private Accumulateur accumulateur;
private LED led;
/** Creates a new LEDactive. */
public LEDactive(Accumulateur accumulateur, LED led) {
this.accumulateur = accumulateur;
this.led = led;
addRequirements(accumulateur,led);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@Override
public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(accumulateur.photocell())
led.led(0, 255, 0);
else{
led.led(25, 25, 100);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
led.led(25, 25, 100);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -3,37 +3,39 @@
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Commands;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import frc.robot.Subsystems.Accumulateur;
import frc.robot.Subsystems.Lanceur;
public class Lancer extends Command {
private Lanceur lanceur;
private Accumulateur accumulateur;
/** Creates a new Lancer. */
public Lancer(Lanceur lanceur) {
public Lancer(Lanceur lanceur,Accumulateur accumulateur) {
this.lanceur = lanceur;
addRequirements(lanceur);
this.accumulateur = accumulateur;
addRequirements(lanceur, accumulateur);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@Override
public void initialize() {
lanceur.setPID(0, 0, 0);
lanceur.PIDlanceur(0, 0, 0);
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
lanceur.lance(0.5);
}
lanceur.lance();
accumulateur.desaccumule(0.2);
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
lanceur.lance(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {

View File

@ -0,0 +1,47 @@
// // Copyright (c) FIRST and other WPILib contributors.
// // Open Source Software; you can modify and/or share it under the terms of
// // the WPILib BSD license file in the root directory of this project.
// package frc.robot.Commands;
// import edu.wpi.first.wpilibj2.command.Command;
// import frc.robot.Subsystems.Limelight3G;
// public class Tracker_Couleur_Forme extends Command {
// /** Creates a new Tracker_Couleur_Forme. */
// private Limelight3G pipeline;
// public Tracker_Couleur_Forme(Limelight3G tracker_couleur, Limelight3G tracker_forme) {
// // Use addRequirements() here to declare subsystem dependencies.
// this.pipeline = pipeline;
// this.tracker_couleur = tracker_couleur;
// this.tracker_forme = tracker_forme;
// }
// // Called when the command is initially scheduled.
// @Override
// public void initialize() {}
// // Called every time the scheduler runs while the command is scheduled.
// @Override
// public void execute() {
// if (pipeline == 1) {
// Limelight3G.tracker_couleur;
// }
// else if (pipeline == 2){
// Limelight3G.tracker_forme;
// }
// }
// // Called once the command ends or is interrupted.
// @Override
// public void end(boolean interrupted) {}
// // Returns true when the command should end.
// @Override
// public boolean isFinished() {
// return false;
// }
// }

View File

@ -4,15 +4,47 @@
package frc.robot;
import edu.wpi.first.math.MathUtil;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.Commands.Desaccumuler;
import frc.robot.Commands.FollowAprilTag;
import frc.robot.Commands.Lancer;
import frc.robot.Subsystems.Accumulateur;
import frc.robot.Subsystems.Drive;
import frc.robot.Subsystems.Lanceur;
import frc.robot.Subsystems.Limelight3G;
public class RobotContainer {
Lanceur lanceur= new Lanceur();
Accumulateur accumulateur = new Accumulateur();
Limelight3G limelight3G = new Limelight3G();
Drive drive = new Drive();
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
CommandXboxController manette = new CommandXboxController(0);
public RobotContainer() {
dashboard.addCamera("limelight3G", "limelight3G","limelight.local:5800")
.withSize(4,3)
.withPosition(0,0);
dashboard.addCamera("limelight3", "limelight3","limelight.local:5800")
.withSize(4,3)
.withPosition(4,0);
configureBindings();
drive.setDefaultCommand(new RunCommand(()->{
drive.drive(-MathUtil.applyDeadband(manette.getRightX(),0.2), MathUtil.applyDeadband(-manette.getRightY(),0.2), MathUtil.applyDeadband(-manette.getRightX(), 0.2));
},drive));
}
private void configureBindings() {}
private void configureBindings() {
manette.x().whileTrue(new Lancer(lanceur));
manette.leftBumper().toggleOnTrue(new FollowAprilTag(limelight3G, lanceur));
manette.a().whileTrue(new Desaccumuler(accumulateur));
}
public Command getAutonomousCommand() {
return Commands.print("No autonomous command configured");

View File

@ -0,0 +1,53 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Subsystems;
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
public class Accumulateur extends SubsystemBase {
/** Creates a new Accumulateur. */
public Accumulateur() {dashboard.addBoolean("photocell", this::photocell).withSize(1, 1).withPosition(0, 1);
dashboard.addBoolean("photocell2", this::photocell).withSize(1, 1).withPosition(0, 1);
}
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
private GenericEntry vitesse =
dashboard.add("vitesseacc", 0.1)
.withSize(1, 1)
.withPosition(0, 4)
.getEntry();
final WPI_TalonSRX strap = new WPI_TalonSRX(0);
final WPI_TalonSRX roueRouge = new WPI_TalonSRX(10);
final DigitalInput photocell = new DigitalInput(20);
final DigitalInput photocell2 = new DigitalInput(21);
public void encodeur(){
}
public boolean photocell(){
return photocell.get();
}
public boolean photocell2(){
return photocell2.get();
}
public void desaccumule(double vitesse){
strap.set(vitesse);
}
public void Petitlanceur(double vitesse){
roueRouge.set(vitesse);
}
public void desaccumule(){
desaccumule(vitesse.getDouble(0.9));
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -0,0 +1,48 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Subsystems;
import java.io.File;
import java.io.IOException;
import com.ctre.phoenix6.hardware.Pigeon2;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.kinematics.SwerveModulePosition;
import edu.wpi.first.wpilibj.Filesystem;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import swervelib.SwerveDrive;
import swervelib.parser.SwerveParser;
public class Drive extends SubsystemBase {
SwerveDrive swerveDrive;
File swerveJsonDirectory = new File(Filesystem.getDeployDirectory(),"swerve");
Pigeon2 Gyro = new Pigeon2(0);
public void drive(double x, double y, double zRotation){
swerveDrive.drive(new Translation2d(x*5, y*5), zRotation*4, true, false);
}
public Drive() {
try {
this.swerveDrive = new SwerveParser(swerveJsonDirectory).createSwerveDrive(5);
swerveDrive.setHeadingCorrection(true);
} catch (IOException e) {
e.printStackTrace();
}
}
public void restgyroscope(){
Gyro.reset();
}
public SwerveModulePosition[] distance(){
return swerveDrive.getModulePositions();
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -0,0 +1,22 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Subsystems;
import com.ctre.phoenix.led.CANdle;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class LED extends SubsystemBase {
/** Creates a new LED. */
public LED() {}
CANdle led = new CANdle(0);
public void led(int R, int G, int B){
led.setLEDs(R, G, B);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -6,28 +6,73 @@ package frc.robot.Subsystems;
import com.ctre.phoenix.motorcontrol.FeedbackDevice;
import com.ctre.phoenix.motorcontrol.StatusFrameEnhanced;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkLowLevel.MotorType;
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Lanceur extends SubsystemBase {
/** Creates a new Lanceur. */
public Lanceur() {}
public Lanceur() {dashboard.add("rottourel", 0.2)
.withSize(0,0)
.withPosition(1, 3);}
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0);
final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(1);
final CANSparkMax tourel = new CANSparkMax(2, MotorType.kBrushed);
final CANSparkMax tourelle = new CANSparkMax(2, MotorType.kBrushed);
final DigitalInput limitswitch1 = new DigitalInput(0);
final DigitalInput limitswitch2 = new DigitalInput(1);
private GenericEntry vitesse =
dashboard.add("vitesselanceur", 0.2)
.withSize(0,0)
.withPosition(0, 3)
.getEntry();
public void encodeur(double distance){
lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
lanceur1.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, 1);
}
public void masterslave(){
lanceur2.follow(lanceur1);
lanceur2.setInverted(true);
}
public void lance(double vitesse){
lanceur1.set(vitesse);
lanceur2.set(-vitesse);
}
public void tourelRotation(double vitesse){
tourel.set(vitesse);
public void lance(){
lance(vitesse.getDouble(0.2));
}
public void setPID(double p, double i, int d) {
public void tourelRotation(double x, double y, double rotation){
tourelle.set(rotation);
}
public double vitessetourel(){
return(tourelle.getEncoder().getVelocity());
}
public double distancetourel(){
return(tourelle.getEncoder().getPosition());
}
public void PIDlanceur(double p, double i, double d) {
lanceur1.config_kP(0, p);
lanceur1.config_kI(0, i);
lanceur1.config_kD(0, d);
}
public boolean limitswitch1(){
return limitswitch1.get();
}
public boolean limitswitch2(){
return limitswitch2.get();
}
@Override
public void periodic() {

View File

@ -0,0 +1,51 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.Subsystems;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.net.PortForwarder;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
public class Limelight3G extends SubsystemBase {
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight");
NetworkTableEntry tx = table.getEntry("tx");
NetworkTableEntry ty = table.getEntry("ty");
NetworkTableEntry pipeline = table.getEntry("pipeline");
NetworkTableEntry tv = table.getEntry("tv");
NetworkTableEntry camMode = table.getEntry("camMode");
NetworkTableEntry tid = table.getEntry("tid");
/** Creates a new Limelight. */
public Limelight3G() {
for (int port = 5800; port <= 5807; port++) {
PortForwarder.add(port, "limelight.local", port);
}}
public double getx(){
return tx.getDouble(0);
}
public double gety(){
return ty.getDouble(0);
}
public double getv(){
return tv.getDouble(0);
}
public void setpipeline(){
pipeline.setNumber(0);
}
public void setcamMode(){
camMode.setNumber(0);
}
public double getTid(){
return tid.getDouble(0);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -0,0 +1,38 @@
{
"fileName": "PathplannerLib.json",
"name": "PathplannerLib",
"version": "2024.2.8",
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
"frcYear": "2024",
"mavenUrls": [
"https://3015rangerrobotics.github.io/pathplannerlib/repo"
],
"jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json",
"javaDependencies": [
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-java",
"version": "2024.2.8"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-cpp",
"version": "2024.2.8",
"libName": "PathplannerLib",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxx86-64",
"osxuniversal",
"linuxathena",
"linuxarm32",
"linuxarm64"
]
}
]
}