Compare commits

...

225 Commits
Led ... main

Author SHA1 Message Date
EdwardFaucher
172d3c92ab led 2025-04-07 12:06:05 -04:00
EdwardFaucher
80e1f22ea3 plus structurer 2025-03-19 12:08:35 -04:00
EdwardFaucher
792d780d89 mode auto unutile 2025-03-19 12:03:48 -04:00
EdwardFaucher
398ea4ac82 elevateur va mieux 2025-03-12 17:23:59 -04:00
EdwardFaucher
59a44ada9a mode auto L4 2025-03-07 10:04:39 -05:00
EdwardFaucher
0878a276dd mode auto L4 2025-03-07 10:00:15 -05:00
Antoine PerreaultE
bb9870732c Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-07 09:06:40 -05:00
Antoine PerreaultE
c4704210b9 derniere modif de compe 2025-03-07 09:06:10 -05:00
EdwardFaucher
63313b3b7a Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-06 15:47:09 -05:00
EdwardFaucher
7de77db146 mode auto 2025-03-06 15:47:04 -05:00
Antoine PerreaultE
c0e7985ab7 mode auto 2025-03-04 17:37:15 -05:00
Antoine PerreaultE
004890fd7b mode auto 2025-03-04 17:37:01 -05:00
Antoine PerreaultE
0d63654df8 mode auto 2025-03-04 13:07:57 -05:00
Antoine PerreaultE
28d5118c1f mode auto 2025-03-04 12:52:13 -05:00
Antoine PerreaultE
5009a1c928 enlever truc inutil + toggle pour auto 2025-03-04 12:23:57 -05:00
Antoine PerreaultE
41e7d89919 mode auto fonctionnel 2025-03-04 11:59:17 -05:00
Antoine PerreaultE
b3c699ccf9 mode auto 2025-03-04 11:44:01 -05:00
Antoine PerreaultE
8852d0a1b6 mode auto 2025-03-04 11:41:46 -05:00
Antoine PerreaultE
9ce0d79903 mode auto 2025-03-04 10:23:54 -05:00
Antoine PerreaultE
a420d3ff2f mode auto 2025-03-04 10:06:12 -05:00
Antoine PerreaultE
b1124bd3f0 mode auto manuel 2025-03-04 09:34:50 -05:00
Antoine PerreaultE
9f4142d7aa valeurs encodeurs, sequance, touche, quelque test amperage 2025-03-03 20:32:11 -05:00
Antoine PerreaultE
263caa4d85 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-03 09:43:25 -05:00
Antoine PerreaultE
e462e83f0e amperage 2025-03-03 09:43:24 -05:00
samuel desharnais
710e216b91 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-03 09:42:24 -05:00
samuel desharnais
3eb5b75b23 mode automne 2025-03-03 09:42:00 -05:00
Antoine PerreaultE
264bbd003f touche, amperage, distance 2025-03-03 09:22:48 -05:00
Antoine PerreaultE
37452f0b05 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-01 15:28:12 -05:00
Antoine PerreaultE
0c701558ec encodeur 2025-03-01 15:27:32 -05:00
samuel desharnais
b6bd4d9319 bougie dans station pince 2025-03-01 15:10:43 -05:00
samuel desharnais
94af67a895 jeu L4 2025-03-01 15:05:05 -05:00
Antoine PerreaultE
8afd6a74a5 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-01 15:00:14 -05:00
Antoine PerreaultE
300c177ae0 touche 2025-03-01 14:53:24 -05:00
samuel desharnais
0c36717d13 touche 2025-03-01 14:52:56 -05:00
Antoine PerreaultE
d1f9d55c3a debug 2025-03-01 13:53:13 -05:00
samuel desharnais
30b0ad39f0 necodeur est mal ecrit 2025-03-01 09:47:30 -05:00
Antoine PerreaultE
54df3fbd8d Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-01 09:42:32 -05:00
Antoine PerreaultE
3999137e3f on utilile pasd ca 2025-03-01 09:42:30 -05:00
samuel desharnais
5d14c08269 grimpeur manuel 2025-03-01 09:41:31 -05:00
Antoine PerreaultE
5f8c222351 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-01 09:39:04 -05:00
Antoine PerreaultE
0e349c53bb bougie rainbw 2025-03-01 09:36:50 -05:00
samuel desharnais
1e5b837267 grimpeur manuel 2025-03-01 09:36:40 -05:00
samuel desharnais
17875a3d15 encodeur grimpeur 2025-03-01 09:25:02 -05:00
samuel desharnais
f8fb960de8 dashbaord bien 2025-03-01 09:22:38 -05:00
samuel desharnais
0ecca5a29d dashboard bien 2025-03-01 09:18:38 -05:00
samuel desharnais
deb31dfad1 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-03-01 09:17:19 -05:00
samuel desharnais
8f9519e5bb dashboard bien 2025-03-01 09:17:17 -05:00
Antoine PerreaultE
004b3085b6 led plus 2025-03-01 09:16:12 -05:00
Antoine PerreaultE
4c4dcf4d41 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 20:23:28 -05:00
Antoine PerreaultE
18222d9f55 bougie fini(J'espere) 2025-02-27 20:23:26 -05:00
samuel desharnais
7e142a9425 je aide antoine 2025-02-27 19:33:57 -05:00
samuel desharnais
2ddfc1f268 je aide antoine 2025-02-27 19:33:37 -05:00
Antoine PerreaultE
58025b4bbd Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 19:31:55 -05:00
Antoine PerreaultE
9902be925c Dossier limelight 2025-02-27 19:31:53 -05:00
samuel desharnais
c589604b95 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 19:31:02 -05:00
samuel desharnais
5a3f683c43 dashboard pas 2025-02-27 19:30:59 -05:00
Antoine PerreaultE
85fa0e0c62 erreur de sam 2025-02-27 19:26:33 -05:00
Antoine PerreaultE
19bbde5cf6 Si besoin de Sysid. Code retirer lors de ce commit 2025-02-27 19:24:31 -05:00
Antoine PerreaultE
280270245e Limit swich elevateur + limit switch pince (testé en simulation-Fonctionne) 2025-02-27 19:22:36 -05:00
Antoine PerreaultE
d7a887571a Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 19:05:01 -05:00
EdwardFaucher
b312854f0b Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 19:04:22 -05:00
Antoine PerreaultE
9cb0940f09 touche 2025-02-27 19:03:36 -05:00
EdwardFaucher
4bba37215f joysticks mieux^3 2025-02-27 19:03:26 -05:00
Antoine PerreaultE
b0e09988a3 modification elevateur manuel pour limit switch 2025-02-27 18:47:46 -05:00
Antoine PerreaultE
95f4f74a47 modification depart 2025-02-27 18:42:03 -05:00
Antoine PerreaultE
82970eb6bd dossier requin 2025-02-27 18:39:15 -05:00
Antoine PerreaultE
105447c4ad Merge branch 'requin' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 18:37:29 -05:00
Antoine PerreaultE
b676cf353f Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 18:33:58 -05:00
Antoine PerreaultE
b7eecbaea9 Menage pour mieu se trouver 2025-02-27 18:33:08 -05:00
samuel desharnais
c8e94563ad dashboard pas 2025-02-27 18:26:10 -05:00
samuel desharnais
04ba179373 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 18:06:32 -05:00
samuel desharnais
7c101a6eed dashboard 2025-02-27 18:06:28 -05:00
Antoine PerreaultE
de25aa5730 dossier Classement 2025-02-27 18:02:26 -05:00
Antoine PerreaultE
b50c5be7de Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-27 17:53:16 -05:00
Antoine PerreaultE
b31ac996ea modif 2025-02-27 17:53:14 -05:00
samuel desharnais
30cc85d34e Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-26 20:13:16 -05:00
samuel desharnais
9248eed724 dashboard 2025-02-26 20:12:22 -05:00
Antoine PerreaultE
6535047346 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-26 19:49:10 -05:00
Antoine PerreaultE
a5f9a28c6f touche reset 2025-02-26 19:48:48 -05:00
samuel desharnais
6c389731f4 dashboard mieux 2025-02-26 19:47:32 -05:00
samuel desharnais
079fa4e0a7 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-26 19:42:30 -05:00
samuel desharnais
ff6d88d9df dashboard mieux 2025-02-26 19:42:28 -05:00
Antoine PerreaultE
b947c93ab7 Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-26 19:23:34 -05:00
Antoine PerreaultE
16edaa6bcc Merge branch 'grimpe' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-26 19:23:32 -05:00
Antoine PerreaultE
63e476c64e Grimpeur, Fonctionne 2025-02-26 19:09:33 -05:00
EdwardFaucher
42fb45d2de deadbamnde joysticks 2025-02-26 18:49:17 -05:00
Antoine PerreaultE
abb6d113d0 ajout exspire 2025-02-26 18:39:59 -05:00
Antoine PerreaultE
37ea658138 touche 2025-02-26 18:11:11 -05:00
Antoine PerreaultE
0adbe7b4e2 pince 2025-02-26 18:04:04 -05:00
Antoine PerreaultE
5700ea70d9 Merge branch 'pince' 2025-02-26 18:02:25 -05:00
Antoine PerreaultE
e58cdf0b5b limit avec pince manuel 2025-02-26 17:26:31 -05:00
Antoine PerreaultE
9b86a0b975 limit avec grimpeur manuel 2025-02-26 17:23:27 -05:00
Antoine PerreaultE
df31291697 limit avec requin manuel 2025-02-26 17:05:46 -05:00
Antoine PerreaultE
77240d255e grimpeur manuel 2025-02-26 16:58:50 -05:00
Antoine PerreaultE
7ffeb78c35 grimpeur manuel 2025-02-26 16:57:51 -05:00
Antoine PerreaultE
5b80c53963 grimpeur manuel 2025-02-26 16:56:38 -05:00
Antoine PerreaultE
476df088ea grimpeur manuel 2025-02-26 16:54:56 -05:00
Antoine PerreaultE
cfc6ba9479 grimpeur manuel 2025-02-26 16:53:12 -05:00
Antoine PerreaultE
3b372104e4 requin manuel + aspire 2025-02-25 20:26:23 -05:00
Antoine PerreaultE
36c9f0048b manuel 2025-02-25 20:13:26 -05:00
Antoine PerreaultE
6c6abb58e1 ajuster distances 2025-02-25 20:08:57 -05:00
Antoine PerreaultE
5b754ff824 changement encodeur l3, pince algue 2025-02-25 19:38:53 -05:00
Antoine PerreaultE
606c4e98f3 nettoyage 2025-02-25 18:15:52 -05:00
Antoine PerreaultE
b6d9ccddb8 nettoyage 2025-02-25 18:12:27 -05:00
Antoine PerreaultE
cdd304f9e9 dashboard requin + nettoyage code 2025-02-25 18:08:14 -05:00
Antoine PerreaultE
1157bdf76a limit requin 2025-02-25 18:05:00 -05:00
Antoine PerreaultE
17f3f697b9 dashboard requin 2025-02-25 18:03:04 -05:00
Antoine PerreaultE
88aa6db075 limit id 2025-02-25 17:57:57 -05:00
Antoine PerreaultE
3660bb9c4a dashboard + limit id 2025-02-25 17:56:24 -05:00
Antoine PerreaultE
f60f129410 pince + main 2025-02-25 16:38:35 -05:00
Antoine PerreaultE
a11f31a2a8 Merge branch 'pince' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-24 19:57:40 -05:00
Antoine PerreaultE
94aae66eed Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-02-24 19:54:52 -05:00
Antoine PerreaultE
9f83b61c46 manuel 2025-02-24 19:52:02 -05:00
Antoine PerreaultE
5d84d83f7d k 2025-02-24 19:13:12 -05:00
Antoine PerreaultE
d538b368a7 encodeur baleeuse 2025-02-24 18:19:06 -05:00
Antoine PerreaultE
87c3abcb65 encodeurs 2025-02-24 18:18:14 -05:00
Antoine PerreaultE
93e5bb0b46 pince mieux 2025-02-24 18:15:32 -05:00
Antoine PerreaultE
b6d2ffd931 bas 2025-02-22 15:28:59 -05:00
Antoine PerreaultE
f9d09106a4 dashboard 2025-02-22 15:21:04 -05:00
Antoine PerreaultE
7be5f8c2fc pince 2025-02-22 14:46:41 -05:00
Antoine PerreaultE
26d32e3707 amperage 2025-02-22 12:48:56 -05:00
Antoine PerreaultE
583413ec5f id 2025-02-22 11:44:53 -05:00
Antoine PerreaultE
1f4111ef6d id 2025-02-22 11:41:37 -05:00
Antoine PerreaultE
9ff363dc24 pid 2025-02-22 11:24:07 -05:00
Antoine PerreaultE
bb9d5a5550 touche 2025-02-22 10:30:20 -05:00
Antoine PerreaultE
0524ec6355 oli code mal 2025-02-22 10:22:13 -05:00
Antoine PerreaultE
69ef6b6982 pince mieux 2025-02-22 09:55:55 -05:00
Antoine PerreaultE
0be9356fa9 code mieux 2025-02-20 20:25:59 -05:00
Antoine PerreaultE
a09fbcefce code mieux 2025-02-20 20:17:56 -05:00
Antoine PerreaultE
7fd7c666f1 code mieux 2025-02-20 20:17:45 -05:00
Antoine PerreaultE
1627770572 code mieux 2025-02-20 20:17:00 -05:00
Antoine PerreaultE
29227dd2f6 code mieux 2025-02-20 20:10:58 -05:00
Antoine PerreaultE
f10dc1165d sisid manque drive 2025-02-20 19:20:23 -05:00
Antoine PerreaultE
dc36eea320 requin 2025-02-19 17:21:37 -05:00
Antoine PerreaultE
6ccef6bad9 changement limelight 2025-02-18 18:47:13 -05:00
Antoine PerreaultE
7cf7483498 limelight 2025-02-17 20:08:21 -05:00
Antoine PerreaultE
20e54ae142 i 2025-02-17 19:58:42 -05:00
Antoine PerreaultE
7492e21135 limelight mode auto 2025-02-17 19:27:02 -05:00
Antoine PerreaultE
71a90cd543 w 2025-02-17 19:18:21 -05:00
Antoine PerreaultE
32989c510a mode auto reset pose 2025-02-17 19:15:53 -05:00
Antoine PerreaultE
33badb2f77 update pathplanner et pheonix 2025-02-17 18:49:20 -05:00
Antoine PerreaultE
eb141ac2ba leds 2025-02-17 18:45:04 -05:00
Antoine PerreaultE
d692bab745 limelight 2025-02-17 18:33:49 -05:00
Antoine PerreaultE
be9f3856f7 limelight marche pas 2025-02-15 12:38:56 -05:00
Antoine PerreaultE
b1e32bd6df limelight+swerve=marche 2025-02-12 18:40:27 -05:00
Antoine PerreaultE
590f9556c2 Merge branch 'main' into Limelight 2025-02-12 18:10:37 -05:00
Antoine PerreaultE
c1bdf0aab7 modif 2025-02-12 16:54:47 -05:00
Antoine PerreaultE
eaa14fb1b1 mieu ecrit 2025-02-12 16:52:10 -05:00
samuel desharnais
8bc8f0390f mode auto leds mieux 2025-02-11 19:57:16 -05:00
Antoine PerreaultE
3458203225 leds baleeuse et saaaaaaaaaaam 2025-02-11 19:51:37 -05:00
Antoine PerreaultE
0e04704942 leds pince 2025-02-11 19:22:25 -05:00
samuel desharnais
c0c48a3f24 message 2025-02-10 20:00:26 -05:00
samuel desharnais
cbeb99c1a5 Merge branch 'Swerve' 2025-02-10 20:00:11 -05:00
Antoine PerreaultE
53adcf5701 Bougie finie 2025-02-10 19:53:34 -05:00
Antoine PerreaultE
319c370c6e Bougie(pas fini) 2025-02-10 19:49:13 -05:00
samuel desharnais
8bd9ce36a2 hehe 2025-02-10 19:12:40 -05:00
samuel desharnais
ab241f2f65 so;hwistesZ 2025-02-10 19:11:48 -05:00
samuel desharnais
9f017968e1 swerve qui fonctionne 2025-02-10 18:33:37 -05:00
Antoine PerreaultE
2b94ebcc95 Limelight 2025-02-06 19:08:24 -05:00
Antoine PerreaultE
9796800b4e limelight 2025-02-06 19:02:23 -05:00
Antoine PerreaultE
cf97a05e6f limelight 2025-02-06 18:56:22 -05:00
samuel desharnais
029bba7bb6 huh? 2025-02-06 18:43:16 -05:00
samuel desharnais
6fb4e0c1ac w 2025-02-06 18:04:02 -05:00
samuel desharnais
9af46de189 oups 2025-02-06 18:03:36 -05:00
samuel desharnais
de156e3789 joystick -> manettes 2025-02-06 17:59:57 -05:00
Antoine PerreaultE
451d3c6e20 command -> commands 2025-02-06 17:50:24 -05:00
Antoine PerreaultE
3669e079bd command -> commands 2025-02-06 17:49:41 -05:00
Antoine PerreaultE
6683613c7f command -> commands 2025-02-06 17:48:27 -05:00
Antoine PerreaultE
688315bcd0 Saaaaaaaaaam 2025-02-06 17:46:04 -05:00
samuel desharnais
cf29380c64 simulation 2025-02-06 17:43:16 -05:00
Antoine PerreaultE
2ac9cfe8ff simulation 2025-02-03 18:59:31 -05:00
Antoine PerreaultE
56704c3e68 id 2025-02-03 18:53:33 -05:00
Antoine PerreaultE
0f81dd39e9 ils ont amener le deux par quatre 2025-02-03 18:52:32 -05:00
Antoine PerreaultE
a984625e17 marche 2025-02-03 18:48:23 -05:00
Antoine PerreaultE
a54ebb16e9 id 2025-02-03 18:39:16 -05:00
Antoine PerreaultE
2260580c81 marche mieux 2025-02-03 18:37:36 -05:00
Antoine PerreaultE
6437b9f152 id 2025-02-03 18:35:44 -05:00
Antoine PerreaultE
9cd08cf07c 2025-02-03 18:32:34 -05:00
Antoine PerreaultE
7be1b69ece id 2025-02-03 18:31:31 -05:00
Antoine PerreaultE
d44aea512d id 2025-02-03 18:27:30 -05:00
Antoine PerreaultE
8aca411a23 id 2025-02-03 18:26:54 -05:00
Antoine PerreaultE
8a7f10ec64 id 2025-02-03 18:24:08 -05:00
Antoine PerreaultE
345eb83d39 id 2025-02-03 18:23:17 -05:00
Antoine PerreaultE
f01f327c81 id 2025-02-03 18:22:01 -05:00
Antoine PerreaultE
0c7cfc9d4c id 2025-02-03 18:20:20 -05:00
Antoine PerreaultE
44f6030e99 simulation fait 2025-02-03 18:19:29 -05:00
Antoine PerreaultE
6f75b9cc42 id 2025-02-03 17:51:57 -05:00
Antoine PerreaultE
210d219793 simulation 2025-02-03 17:49:34 -05:00
Antoine PerreaultE
06abfa4dbb Named Commands 2025-01-30 20:18:15 -05:00
Antoine PerreaultE
26a4b9f9a3 touche 2025-01-29 20:15:07 -05:00
Antoine PerreaultE
b384585224 pince mieux 2025-01-29 20:13:38 -05:00
Antoine PerreaultE
831b9fec75 Touche grinpeur 2025-01-29 19:51:59 -05:00
Antoine PerreaultE
4c49ad4e51 touche requin 2025-01-29 19:45:46 -05:00
Antoine PerreaultE
afe25cf046 pu L1 2025-01-29 19:41:28 -05:00
Antoine PerreaultE
ee2c9ff4b2 manette 2025-01-29 19:37:35 -05:00
Antoine PerreaultE
bd180e9153 2025-01-29 19:35:45 -05:00
Antoine PerreaultE
20c95efe93 2025-01-29 19:35:13 -05:00
Antoine PerreaultE
4869632d6d manette pince elevateur 2025-01-29 19:29:01 -05:00
Antoine PerreaultE
afaec61f6d touche pince+elevateur 2025-01-29 19:19:14 -05:00
Antoine PerreaultE
126058e9d4 touche 2025-01-29 19:01:51 -05:00
Antoine PerreaultE
1f17aaf4de pince+elevateur 2025-01-29 18:55:06 -05:00
Antoine PerreaultE
eece0f47fa pince et elevateur 2025-01-29 18:43:31 -05:00
Antoine PerreaultE
c81f118058 Merge branch 'elevateur' into pince 2025-01-29 18:42:45 -05:00
Antoine PerreaultE
7848c4aaf2 debug 2025-01-29 18:12:14 -05:00
Antoine PerreaultE
eec4eee2ff baleeuse 2025-01-28 19:34:18 -05:00
Antoine PerreaultE
982db16833 grimpeMieux 2025-01-28 19:22:43 -05:00
Antoine PerreaultE
1d1d6e962d pince 2025-01-28 19:19:34 -05:00
Antoine PerreaultE
d6420659e9 2025-01-28 19:10:42 -05:00
Antoine PerreaultE
aafb2a62b5 Algue 2025-01-28 19:09:16 -05:00
Antoine PerreaultE
0fdfa4269d elevateurise mieux 2025-01-28 18:54:42 -05:00
Antoine PerreaultE
017f168b3c Pince 2025-01-28 18:46:42 -05:00
Antoine PerreaultE
12b5e6954e 2025-01-28 18:31:02 -05:00
Antoine PerreaultE
bff426ef0f v 2025-01-28 18:29:17 -05:00
Antoine PerreaultE
5ffa28596c aspire 2025-01-28 18:24:21 -05:00
Antoine PerreaultE
15be1d67ea L1 2025-01-28 18:05:47 -05:00
Antoine PerreaultE
e4c7a12606 balaye 2025-01-28 18:02:53 -05:00
Antoine PerreaultE
72da7b7d74 requin rotatione 2025-01-28 17:56:40 -05:00
Antoine PerreaultE
7e40328af4 il grimpe mieux 2025-01-28 17:51:17 -05:00
Antoine PerreaultE
fd8ab8663b baleeuse 2025-01-27 20:14:20 -05:00
Antoine PerreaultE
e7b4b47928 elevateur 2025-01-27 19:51:46 -05:00
Antoine PerreaultE
0577ce368a positon 2025-01-27 19:26:11 -05:00
Antoine PerreaultE
7521c0d94e elevateur 2025-01-27 19:15:16 -05:00
Antoine PerreaultE
9653ca7205 grimpe 2025-01-27 19:12:49 -05:00
Antoine PerreaultE
b16d11b70a elevateur 2025-01-27 19:11:22 -05:00
Antoine PerreaultE
1583a95f52 il grimpe 2025-01-27 18:40:58 -05:00
57 changed files with 4310 additions and 293 deletions

View File

@ -0,0 +1,5 @@
{
"Transitory Values": {
"open": false
}
}

1
.SysId/sysid.json Normal file
View File

@ -0,0 +1 @@
{}

File diff suppressed because one or more lines are too long

97
simgui-ds.json Normal file
View File

@ -0,0 +1,97 @@
{
"System Joysticks": {
"window": {
"enabled": false
}
},
"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
}
]
}

View File

@ -0,0 +1,126 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "BlueBasStart"
}
},
{
"type": "named",
"data": {
"name": "AprilTag"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 1.0
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "BlueBasChercher"
}
},
{
"type": "named",
"data": {
"name": "AprilTag"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "AprilTag"
}
},
{
"type": "path",
"data": {
"pathName": "BlueBasPorter"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 1.0
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "BlueBasChercher2"
}
},
{
"type": "sequential",
"data": {
"commands": []
}
},
{
"type": "named",
"data": {
"name": "AprilTag"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "BlueBasPorter2"
}
},
{
"type": "named",
"data": {
"name": "AprilTag"
}
}
]
}
}
]
}
},
"resetOdom": true,
"folder": null,
"choreoAuto": false
}

View File

@ -0,0 +1,19 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "New Path"
}
}
]
}
},
"resetOdom": true,
"folder": null,
"choreoAuto": false
}

View File

@ -4,6 +4,12 @@
"type": "sequential", "type": "sequential",
"data": { "data": {
"commands": [ "commands": [
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{ {
"type": "path", "type": "path",
"data": { "data": {

View File

@ -0,0 +1,63 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "New Path"
}
},
{
"type": "wait",
"data": {
"waitTime": 2.0
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "wait",
"data": {
"waitTime": 2.0
}
},
{
"type": "named",
"data": {
"name": "baleeuse"
}
}
]
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "wait",
"data": {
"waitTime": 2.0
}
},
{
"type": "named",
"data": {
"name": "baleeuse sort"
}
}
]
}
}
]
}
},
"resetOdom": true,
"folder": null,
"choreoAuto": false
}

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 3.392520491803279, "x": 3.392520491803279,
"y": 1.7293545081967203 "y": 1.7293545081967205
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null

View File

@ -8,8 +8,8 @@
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 6.400623816881145, "x": 6.40062663880838,
"y": 1.8077934662846444 "y": 1.8077964923366423
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 3.0, "maxVelocity": 1.0,
"maxAcceleration": 3.0, "maxAcceleration": 1.0,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
@ -50,5 +50,5 @@
"velocity": 0, "velocity": 0,
"rotation": 119.99999999999999 "rotation": 119.99999999999999
}, },
"useDefaultConstraints": true "useDefaultConstraints": false
} }

View File

@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 7.564241803278687,
"y": 3.899129098360655
},
"prevControl": null,
"nextControl": {
"x": 6.506996649367605,
"y": 3.898163120386143
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.269569672131147,
"y": 3.899129098360655
},
"prevControl": {
"x": 7.259410179761819,
"y": 3.9002985318003183
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 0.1,
"maxAngularAcceleration": 0.1,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0.0,
"rotation": 0.0
},
"reversed": false,
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": false
}

View File

@ -8,20 +8,20 @@
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 7.084733606557376, "x": 7.119564732833961,
"y": 6.488473360655737 "y": 6.478684258786044
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 5.849999999999999, "x": 5.815652951699465,
"y": 6.464497950819672 "y": 6.464497950819672
}, },
"prevControl": { "prevControl": {
"x": 6.32950819672131, "x": 6.633711863494241,
"y": 6.464497950819672 "y": 6.455611583097
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@ -33,10 +33,10 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 3.0, "maxVelocity": 1.0,
"maxAcceleration": 3.0, "maxAcceleration": 1.0,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 50.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 100.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
"unlimited": false "unlimited": false
}, },
@ -50,5 +50,5 @@
"velocity": 0, "velocity": 0,
"rotation": 180.0 "rotation": 180.0
}, },
"useDefaultConstraints": true "useDefaultConstraints": false
} }

View File

@ -9,12 +9,12 @@
"defaultMaxAngVel": 540.0, "defaultMaxAngVel": 540.0,
"defaultMaxAngAccel": 720.0, "defaultMaxAngAccel": 720.0,
"defaultNominalVoltage": 12.0, "defaultNominalVoltage": 12.0,
"robotMass": 74.088, "robotMass": 45.3592,
"robotMOI": 6.883, "robotMOI": 6.883,
"robotTrackwidth": 0.546, "robotTrackwidth": 0.546,
"driveWheelRadius": 0.048, "driveWheelRadius": 0.048,
"driveGearing": 5.143, "driveGearing": 5.143,
"maxDriveSpeed": 5.45, "maxDriveSpeed": 5.261,
"driveMotorType": "krakenX60", "driveMotorType": "krakenX60",
"driveCurrentLimit": 60.0, "driveCurrentLimit": 60.0,
"wheelCOF": 1.2, "wheelCOF": 1.2,

File diff suppressed because it is too large Load Diff

View File

@ -6,78 +6,185 @@ package frc.robot;
import static edu.wpi.first.units.Units.*; import static edu.wpi.first.units.Units.*;
import java.util.Map;
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType; import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
import com.ctre.phoenix6.mechanisms.swerve.LegacySwerveRequest.PointWheelsAt; import com.ctre.phoenix6.hardware.Pigeon2;
import com.ctre.phoenix6.swerve.SwerveRequest; import com.ctre.phoenix6.swerve.SwerveRequest;
import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.auto.NamedCommands;
import edu.wpi.first.cameraserver.CameraServer; import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.math.MathUtil;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
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.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction;
import frc.robot.TunerConstants.TunerConstants; import frc.robot.TunerConstants.TunerConstants;
import frc.robot.commands.RainBow;
import frc.robot.commands.reset;
import frc.robot.commands.Elevateur.Depart;
import frc.robot.commands.Elevateur.ElevateurManuel;
import frc.robot.commands.Elevateur.L2;
import frc.robot.commands.Elevateur.L3;
import frc.robot.commands.Elevateur.L4;
import frc.robot.commands.Elevateur.StationPince;
import frc.robot.commands.Limelight.AprilTag3;
import frc.robot.commands.Limelight.AprilTag3G;
import frc.robot.commands.Limelight.Forme3;
import frc.robot.commands.Pince.AlgueExpire;
import frc.robot.commands.Pince.Algue_inspire;
import frc.robot.commands.Pince.CorailAspir;
import frc.robot.commands.Pince.CoralAlgueInspire;
import frc.robot.commands.Pince.CoralExpire;
import frc.robot.commands.Pince.PinceManuel;
import frc.robot.commands.requin.BalayeuseAlgue;
import frc.robot.commands.requin.BalayeuseCoral;
import frc.robot.commands.requin.BalayeuseHaut;
import frc.robot.commands.requin.ExpireCorail;
import frc.robot.commands.requin.L1Requin;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.CommandSwerveDrivetrain; import frc.robot.subsystems.CommandSwerveDrivetrain;
import frc.robot.subsystems.Grimpeur; import frc.robot.subsystems.Elevateur;
import frc.robot.subsystems.Limelight3;
import frc.robot.subsystems.Limelight3G;
import frc.robot.subsystems.Pince;
import frc.robot.subsystems.Requin;
import frc.robot.commands.requin.exspire;
import frc.robot.commands.Pince.DepartPince;
import frc.robot.commands.Elevateur.balonL2;
import frc.robot.commands.Elevateur.balonL3;
public class RobotContainer { public class RobotContainer {
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond); // kSpeedAt12Volts desired top speed ShuffleboardLayout layoutauto = Shuffleboard.getTab("teb").getLayout("auto", BuiltInLayouts.kList)
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond); // 3/4 of a rotation per second max angular velocity .withSize(2, 2).withProperties(Map.of("Label position", "LEFT"));
GenericEntry L1 = layoutauto.add("choix L1",false).withWidget(BuiltInWidgets.kToggleSwitch).getEntry();
GenericEntry sortirAngle = layoutauto.add("Cote?",false).withWidget(BuiltInWidgets.kToggleSwitch).getEntry();
GenericEntry ReculerB = layoutauto.add("ReculerB",false).withWidget(BuiltInWidgets.kToggleSwitch).getEntry();
GenericEntry ReculerR = layoutauto.add("ReculerR",false).withWidget(BuiltInWidgets.kToggleSwitch).getEntry();
GenericEntry L4 = layoutauto.add("L4",false).withWidget(BuiltInWidgets.kToggleSwitch).getEntry();
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond); // kSpeedAt12Volts desired top speed
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond); // 3/4 of a rotation per second max angular velocity
/* Setting up bindings for necessary control of the swerve drive platform */ /* Setting up bindings for necessary control of the swerve drive platform */
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric() private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband .withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // Use open-loop control for drive motors .withDriveRequestType(DriveRequestType.OpenLoopVoltage
); // Use open-loop control for drive motors
private final Telemetry logger = new Telemetry(MaxSpeed); private final Telemetry logger = new Telemetry(MaxSpeed);
private final CommandXboxController manette1 = new CommandXboxController(0);
private final CommandXboxController manette2 = new CommandXboxController(1);
private final Pigeon2 gyro = new Pigeon2(13); // ID du Pigeon 2
public final CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
public double getAngle() {
return gyro.getYaw().getValueAsDouble(); // Retourne l'angle actuel du robot
}
private final CommandXboxController joystick = new CommandXboxController(0); Elevateur elevateur = new Elevateur();
Pince pince = new Pince();
ElevateurManuel elevateurManuel = new ElevateurManuel(elevateur, manette2::getLeftY);
PinceManuel pinceManuel = new PinceManuel(pince,manette2::getRightY);
Bougie bougie = new Bougie();
Limelight3G limelight3g = new Limelight3G();
Limelight3 limelight3 = new Limelight3();
Pose2d pose = new Pose2d();
Requin requin = new Requin();
CorailAspir corailAspir = new CorailAspir(pince, bougie);
public RobotContainer() {
CameraServer.startAutomaticCapture();
configureBindings();
}
public final CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain(); private void configureBindings() {
drivetrain.registerTelemetry(logger::telemeterize);
drivetrain.setDefaultCommand(
// Drivetrain will execute this command periodically
drivetrain.applyRequest(() ->
drive.withVelocityY(MathUtil.applyDeadband(-manette1.getLeftX()*-manette1.getLeftX()*-manette1.getLeftX()*MaxSpeed, 0.05)) // Drive forward with negative Y (forward)
.withVelocityX(MathUtil.applyDeadband(-manette1.getLeftY()*-manette1.getLeftY()*-manette1.getLeftY()*MaxSpeed, 0.05)) // Drive left with negative X (left)
.withRotationalRate(MathUtil.applyDeadband(-manette1.getRightX()*-manette1.getRightX()*-manette1.getRightX()*MaxAngularRate, 0.05)) // Drive counterclockwise with negative X (left)
)
);
private final SendableChooser<Command> autoChooser; /* Manette 1 */
//pince
manette1.rightTrigger().whileTrue(new CoralAlgueInspire(pince, bougie));
manette1.rightBumper().toggleOnTrue(new StationPince(pince, elevateur,bougie));
manette1.povLeft().whileTrue(new AlgueExpire(pince, bougie));
manette1.leftBumper().whileTrue(new AprilTag3G(limelight3g,drivetrain,manette1::getLeftX,manette1::getLeftY));
manette1.povRight().whileTrue(new CoralExpire(pince, bougie));
manette1.leftTrigger().whileTrue(new DepartPince(pince));
manette1.povDown().whileTrue(new Algue_inspire(pince,bougie));
manette1.leftStick().whileTrue(new CorailAspir(pince, bougie));
//elevateur
manette1.a().toggleOnTrue(new Depart(elevateur, pince));
manette1.b().toggleOnTrue(new L2(elevateur,pince));
manette1.x().toggleOnTrue(new L3(elevateur, pince));
manette1.y().toggleOnTrue(new L4(elevateur, pince));
manette1.povUp().toggleOnTrue(new balonL2(elevateur));
manette1.start().toggleOnTrue(new balonL3(elevateur));
/* Manette 2 */
//requin
manette2.rightBumper().whileTrue(new BalayeuseAlgue(requin,bougie));
manette2.leftBumper().whileTrue(new L1Requin(requin, bougie));
manette2.rightTrigger().whileTrue(new BalayeuseHaut(requin));
manette2.leftTrigger().whileTrue(new BalayeuseCoral(requin, bougie));
manette2.y().whileTrue(new exspire(requin, bougie));
manette2.x().whileTrue(new ExpireCorail(requin, bougie));
public RobotContainer() { //limelight
autoChooser = AutoBuilder.buildAutoChooser("New Auto"); manette2.a().whileTrue(new Forme3(limelight3,drivetrain,manette1::getLeftX,manette1::getLeftY));
SmartDashboard.putData("Auto Mode", autoChooser); manette2.b().whileTrue(new AprilTag3(limelight3, drivetrain, manette1::getLeftX, manette1::getLeftY));
configureBindings();
}
private void configureBindings() { //Pince manuel
// Note that X is defined as forward according to WPILib convention, pince.setDefaultCommand(new RunCommand(()->{
// and Y is defined as to the left according to WPILib convention. pince.pivote(MathUtil.applyDeadband((manette2.getRightY()*manette2.getRightY()*manette2.getRightY())/3, 0.05));
drivetrain.setDefaultCommand( }, pince));
// Drivetrain will execute this command periodically
drivetrain.applyRequest(() ->
drive.withVelocityX(-joystick.getLeftY() * MaxSpeed) // Drive forward with negative Y (forward)
.withVelocityY(-joystick.getLeftX() * MaxSpeed) // Drive left with negative X (left)
.withRotationalRate(-joystick.getRightX() * MaxAngularRate) // Drive counterclockwise with negative X (left)
)
);
// Run SysId routines when holding back/start and X/Y. //Elevateur manuel
// Note that each routine should be run exactly once in a single log. elevateur.setDefaultCommand(new RunCommand(()->{
joystick.back().and(joystick.y()).whileTrue(drivetrain.sysIdDynamic(Direction.kForward)); elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY()*manette2.getLeftY()*manette2.getLeftY(), 0.05));
joystick.back().and(joystick.x()).whileTrue(drivetrain.sysIdDynamic(Direction.kReverse)); }, elevateur));
joystick.start().and(joystick.y()).whileTrue(drivetrain.sysIdQuasistatic(Direction.kForward));
joystick.start().and(joystick.x()).whileTrue(drivetrain.sysIdQuasistatic(Direction.kReverse));
// reset the field-centric heading on left bumper press //Reset encodeur
joystick.leftBumper().onTrue(drivetrain.runOnce(() -> drivetrain.seedFieldCentric())); manette2.start().whileTrue(new reset(elevateur, pince, requin));
}
drivetrain.registerTelemetry(logger::telemeterize);
}
public Command getAutonomousCommand() { public Command getAutonomousCommand() {
return autoChooser.getSelected(); return new SequentialCommandGroup(
drivetrain.applyRequest(()->
drive.withVelocityX(0.1*MaxSpeed)
.withVelocityY(0)
.withRotationalRate(0)).unless(()->!ReculerR.getBoolean(true)).withTimeout(3.5),
drivetrain.applyRequest(()->
drive.withVelocityX(-0.1*MaxSpeed)
.withVelocityY(0)
.withRotationalRate(0)).unless(()->!ReculerB.getBoolean(true)).withTimeout(3.5),
drivetrain.applyRequest(()->
drive.withVelocityX(-0.1*MaxSpeed)
.withVelocityY(0)
.withRotationalRate(0)).unless(()->!L4.getBoolean(true)).withTimeout(2.35),
drivetrain.applyRequest(()->
drive.withVelocityX(0.1*MaxSpeed)
.withVelocityY(0)
.withRotationalRate(0)).unless(()->!sortirAngle.getBoolean(true)|| !ReculerR.getBoolean(true)).withTimeout(3),
drivetrain.applyRequest(()->
drive.withVelocityX(-0.1*MaxSpeed)
.withVelocityY(0)
.withRotationalRate(0)).unless(()->!sortirAngle.getBoolean(true)|| !ReculerB.getBoolean(true)).withTimeout(3),
drivetrain.applyRequest(()->
drive.withVelocityX(0)
.withVelocityY(0)
.withRotationalRate(0)).withTimeout(0.1),
new L4(elevateur, pince).unless(()->!L4.getBoolean(true)).withTimeout(4),
new L1Requin(requin, bougie).unless(()-> !L1.getBoolean(true)).withTimeout(2),
new ExpireCorail(requin, bougie).unless(()->!L1.getBoolean(true)).withTimeout(2),
new RainBow(bougie));
} }
} }

View File

@ -23,15 +23,19 @@ public class TunerConstants {
// The steer motor uses any SwerveModule.SteerRequestType control request with the // The steer motor uses any SwerveModule.SteerRequestType control request with the
// output type specified by SwerveModuleConstants.SteerMotorClosedLoopOutput // output type specified by SwerveModuleConstants.SteerMotorClosedLoopOutput
private static final Slot0Configs steerGains = new Slot0Configs() //private static final Slot0Configs steerGains = new Slot0Configs()
.withKP(100).withKI(0).withKD(0.5) // .withKP(68.294).withKI(0).withKD(4.7806)
.withKS(0.1).withKV(1.91).withKA(0) // .withKS(0.20754).withKV(2.4832).withKA(0.099824)
// .withStaticFeedforwardSign(StaticFeedforwardSignValue.UseClosedLoopSign);
private static final Slot0Configs steerGains = new Slot0Configs()
.withKP(43.502).withKI(0).withKD(2.7353)
.withKS(0.027275).withKV(2.5818).withKA(0.1055)
.withStaticFeedforwardSign(StaticFeedforwardSignValue.UseClosedLoopSign); .withStaticFeedforwardSign(StaticFeedforwardSignValue.UseClosedLoopSign);
// When using closed-loop control, the drive motor uses the control // When using closed-loop control, the drive motor uses the control
// output type specified by SwerveModuleConstants.DriveMotorClosedLoopOutput // output type specified by SwerveModuleConstants.DriveMotorClosedLoopOutput
private static final Slot0Configs driveGains = new Slot0Configs() private static final Slot0Configs driveGains = new Slot0Configs()
.withKP(0.1).withKI(0).withKD(0) .withKP(63.167).withKI(0).withKD(0.54521)
.withKS(0).withKV(0.124); .withKS(0.18227).withKV(0.12483);
// The closed-loop output type to use for the steer motors; // The closed-loop output type to use for the steer motors;
// This affects the PID/FF gains for the steer motors // This affects the PID/FF gains for the steer motors
@ -74,14 +78,14 @@ public class TunerConstants {
// Theoretical free speed (m/s) at 12 V applied output; // Theoretical free speed (m/s) at 12 V applied output;
// This needs to be tuned to your individual robot // This needs to be tuned to your individual robot
public static final LinearVelocity kSpeedAt12Volts = MetersPerSecond.of(5.21); public static final LinearVelocity kSpeedAt12Volts = MetersPerSecond.of(6);
// Every 1 rotation of the azimuth results in kCoupleRatio drive motor turns; // Every 1 rotation of the azimuth results in kCoupleRatio drive motor turns;
// This may need to be tuned to your individual robot // This may need to be tuned to your individual robot
private static final double kCoupleRatio = 0; private static final double kCoupleRatio = 3.5714285714285716;
private static final double kDriveGearRatio = 6.122448979591837; private static final double kDriveGearRatio = 6.122448979591837;
private static final double kSteerGearRatio = 15.42857142857143; private static final double kSteerGearRatio = 21.428571428571427;
private static final Distance kWheelRadius = Inches.of(2); private static final Distance kWheelRadius = Inches.of(2);
private static final boolean kInvertLeftSide = false; private static final boolean kInvertLeftSide = false;
@ -126,48 +130,48 @@ public class TunerConstants {
// Front Left // Front Left
private static final int kFrontLeftDriveMotorId = 2; private static final int kFrontLeftDriveMotorId = 4;
private static final int kFrontLeftSteerMotorId = 6; private static final int kFrontLeftSteerMotorId = 5;
private static final int kFrontLeftEncoderId = 9; private static final int kFrontLeftEncoderId = 12;
private static final Angle kFrontLeftEncoderOffset = Rotations.of(-0.046142578125); private static final Angle kFrontLeftEncoderOffset = Rotations.of(-0.353271484375);
private static final boolean kFrontLeftSteerMotorInverted = true; private static final boolean kFrontLeftSteerMotorInverted = true;
private static final boolean kFrontLeftEncoderInverted = false; private static final boolean kFrontLeftEncoderInverted = false;
private static final Distance kFrontLeftXPos = Inches.of(13.75); private static final Distance kFrontLeftXPos = Inches.of(13.5);
private static final Distance kFrontLeftYPos = Inches.of(13.75); private static final Distance kFrontLeftYPos = Inches.of(10.5);
// Front Right // Front Right
private static final int kFrontRightDriveMotorId = 4; private static final int kFrontRightDriveMotorId = 2;
private static final int kFrontRightSteerMotorId = 5; private static final int kFrontRightSteerMotorId = 6;
private static final int kFrontRightEncoderId = 12; private static final int kFrontRightEncoderId = 9;
private static final Angle kFrontRightEncoderOffset = Rotations.of(-0.116455078125); private static final Angle kFrontRightEncoderOffset = Rotations.of(0.2119140625);
private static final boolean kFrontRightSteerMotorInverted = true; private static final boolean kFrontRightSteerMotorInverted = true;
private static final boolean kFrontRightEncoderInverted = false; private static final boolean kFrontRightEncoderInverted = false;
private static final Distance kFrontRightXPos = Inches.of(13.75); private static final Distance kFrontRightXPos = Inches.of(13.5);
private static final Distance kFrontRightYPos = Inches.of(-13.75); private static final Distance kFrontRightYPos = Inches.of(-10.5);
// Back Left // Back Left
private static final int kBackLeftDriveMotorId = 3; private static final int kBackLeftDriveMotorId = 18;
private static final int kBackLeftSteerMotorId = 7; private static final int kBackLeftSteerMotorId = 8;
private static final int kBackLeftEncoderId = 10; private static final int kBackLeftEncoderId = 11;
private static final Angle kBackLeftEncoderOffset = Rotations.of(-0.046630859375); private static final Angle kBackLeftEncoderOffset = Rotations.of(0.236572265625);
private static final boolean kBackLeftSteerMotorInverted = true; private static final boolean kBackLeftSteerMotorInverted = true;
private static final boolean kBackLeftEncoderInverted = false; private static final boolean kBackLeftEncoderInverted = false;
private static final Distance kBackLeftXPos = Inches.of(-13.75); private static final Distance kBackLeftXPos = Inches.of(-13.5);
private static final Distance kBackLeftYPos = Inches.of(13.75); private static final Distance kBackLeftYPos = Inches.of(10.5);
// Back Right // Back Right
private static final int kBackRightDriveMotorId = 18; private static final int kBackRightDriveMotorId = 3;
private static final int kBackRightSteerMotorId = 8; private static final int kBackRightSteerMotorId = 7;
private static final int kBackRightEncoderId = 11; private static final int kBackRightEncoderId = 10;
private static final Angle kBackRightEncoderOffset = Rotations.of(-0.016357421875); private static final Angle kBackRightEncoderOffset = Rotations.of(-0.330078125);
private static final boolean kBackRightSteerMotorInverted = true; private static final boolean kBackRightSteerMotorInverted = true;
private static final boolean kBackRightEncoderInverted = false; private static final boolean kBackRightEncoderInverted = false;
private static final Distance kBackRightXPos = Inches.of(-13.75); private static final Distance kBackRightXPos = Inches.of(-13.5);
private static final Distance kBackRightYPos = Inches.of(-13.75); private static final Distance kBackRightYPos = Inches.of(-10.5);
public static final SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> FrontLeft = public static final SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> FrontLeft =

View File

@ -0,0 +1,54 @@
// 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 static edu.wpi.first.units.Units.*;
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
import com.ctre.phoenix6.swerve.SwerveRequest;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.TunerConstants.TunerConstants;
import frc.robot.subsystems.CommandSwerveDrivetrain;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class AvancerAuto extends Command {
private CommandSwerveDrivetrain commandSwerveDrivetrain = TunerConstants.createDrivetrain();
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond); // kSpeedAt12Volts desired top speed
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond); // 3/4 of
private final SwerveRequest.RobotCentric drive = new SwerveRequest.RobotCentric()
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
/** Creates a new AvancerAuto. */
public AvancerAuto(SwerveRequest.RobotCentric drive, CommandSwerveDrivetrain commandSwerveDrivetrain) {
// 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() {
commandSwerveDrivetrain.applyRequest(()->
drive.withVelocityY(0.5*MaxSpeed)
.withVelocityX(0)
.withRotationalRate(0));
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
drive.withVelocityY(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,58 @@
// 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.Elevateur;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Elevateur;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class Depart extends Command {
private Elevateur elevateur;
private Pince pince;
/** Creates a new L2. */
public Depart(Elevateur elevateur, Pince pince) {
this.elevateur = elevateur;
this.pince = pince;
addRequirements(elevateur, pince);
// 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(pince.position()){
pince.pivote(0);
pince.reset();
}
else{
pince.pivote(-0.2);
}
if(elevateur.limit2()==true){
elevateur.vitesse(0);
elevateur.reset();
}
else{
elevateur.vitesse(.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return elevateur.limit2() == true;
}
}

View File

@ -0,0 +1,49 @@
// 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.Elevateur;
import java.util.function.DoubleSupplier;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Elevateur;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class ElevateurManuel extends Command {
private DoubleSupplier doubleSupplier;
private Elevateur elevateur;
/** Creates a new ElevateurManuel. */
public ElevateurManuel(Elevateur elevateur,DoubleSupplier doubleSupplier) {
this.doubleSupplier = doubleSupplier;
this.elevateur = elevateur;
addRequirements(elevateur);
// 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 (elevateur.limit2()){
}
elevateur.vitesse(doubleSupplier.getAsDouble()/3.5);
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

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.commands.Elevateur;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Elevateur;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class L2 extends Command {
private Elevateur elevateur;
private Pince pince;
/** Creates a new L2. */
public L2(Elevateur elevateur,Pince pince) {
this.elevateur = elevateur;
this.pince = pince;
addRequirements(elevateur,pince);
// 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(pince.encodeurpivot()>=15 && pince.encodeurpivot()<=16.5){
pince.pivote(0);
}
else if(pince.encodeurpivot()>=15){
pince.pivote(-0.2);
}
else{
pince.pivote(0.1);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,64 @@
// 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.Elevateur;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Elevateur;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class L3 extends Command {
private Elevateur elevateur;
private Pince pince;
/** Creates a new L2. */
public L3(Elevateur elevateur,Pince pince) {
this.elevateur = elevateur;
this.pince = pince;
addRequirements(elevateur,pince);
// 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(elevateur.position()<=elevateur.encodeurelevateurL3bas() && elevateur.position()>=elevateur.encodeurelevateurL3haut()){
elevateur.vitesse(0);
pince.pivote(-0.15);
if(pince.encodeurpivot()>=20 && pince.encodeurpivot()<=21){
pince.pivote(0);
}
else if(pince.encodeurpivot()>=20){
pince.pivote(-0.15);
}
else{
pince.pivote(0.15);
}
}
else if(elevateur.position()>=elevateur.encodeurelevateurL3bas()){
elevateur.vitesse(-0.7);
}
else{
elevateur.vitesse(0.25);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,63 @@
// 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.Elevateur;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Elevateur;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class L4 extends Command {
private Elevateur elevateur;
private Pince pince;
/** Creates a new L2. */
public L4(Elevateur elevateur,Pince pince) {
this.elevateur = elevateur;
this.pince = pince;
addRequirements(elevateur,pince);
// 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(elevateur.position()<=elevateur.encodeurelevateurL4bas() && elevateur.position()>=elevateur.encodeurelevateurL4haut()){
elevateur.vitesse(0);
pince.pivote(-0.15);
if(pince.encodeurpivot()>=20 && pince.encodeurpivot()<=21){
pince.pivote(0);
}
else if(pince.encodeurpivot()>=20){
pince.pivote(-0.15);
}
else{
pince.pivote(0.15);
}
}
else if(elevateur.position()>=elevateur.encodeurelevateurL4bas()){
elevateur.vitesse(-0.7);
}
else{
elevateur.vitesse(.25);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,90 @@
// 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.Elevateur;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Elevateur;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class StationPince extends Command {
ShuffleboardTab teb = Shuffleboard.getTab("teb");
private Pince pince;
private Elevateur elevateur;
private Bougie bougie;
/** Creates a new L2Pince. */
public StationPince(Pince pince,Elevateur elevateur, Bougie bougie) {
this.elevateur = elevateur;
this.pince = pince;
this.bougie = bougie;
addRequirements(pince, elevateur, bougie);
// 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(pince.emperagecoral() >= 18){
pince.x = true;
}
if(elevateur.position()<=-0.4 && elevateur.position()>= -0.5){
elevateur.vitesse(0);
}
else if(elevateur.position()>=-0.4){
elevateur.vitesse(-0.7);
}
else{
elevateur.vitesse(0.25);
}
if(pince.x){
pince.aspirecoral(0);
bougie.Bleu();
pince.pivote(-0.2);
if(pince.position()){
pince.pivote(0);
}
}
else{
pince.aspirecoral(0.25);
}
if (!pince.x){
pince.pivote(-0.15);
if(pince.encodeurpivot()>=10 && pince.encodeurpivot()<=11){
pince.pivote(0);
}
else if(pince.encodeurpivot()>=10.5){
pince.pivote(-0.15);
}
else{
pince.pivote(0.15);
}
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.pivote(0);
pince.aspirecoral(0);
elevateur.vitesse(0);
pince.x =false;
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,49 @@
// 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.Elevateur;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Elevateur;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class balonL2 extends Command {
private Elevateur elevateur;
/** Creates a new L2. */
public balonL2(Elevateur elevateur) {
this.elevateur = elevateur;
addRequirements(elevateur);
// 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(elevateur.position()<=-2 && elevateur.position()>=-2.2){
elevateur.vitesse(0);
}
else if(elevateur.position()>= -1.95){
elevateur.vitesse(-0.7);
}
else{
elevateur.vitesse(0.25);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,49 @@
// 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.Elevateur;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Elevateur;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class balonL3 extends Command {
private Elevateur elevateur;
/** Creates a new L2. */
public balonL3(Elevateur elevateur) {
this.elevateur = elevateur;
addRequirements(elevateur);
// 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(elevateur.position()<=-4 && elevateur.position()>=-4.1){
elevateur.vitesse(0);
}
else if(elevateur.position()>= -4){
elevateur.vitesse(-0.7);
}
else{
elevateur.vitesse(0.25);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,81 @@
// 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.Limelight;
import static edu.wpi.first.units.Units.*;
import java.util.function.DoubleSupplier;
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
import com.ctre.phoenix6.swerve.SwerveRequest;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.TunerConstants.TunerConstants;
import frc.robot.subsystems.CommandSwerveDrivetrain;
import frc.robot.subsystems.Limelight3;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class AprilTag3 extends Command {
private Limelight3 limelight3;
private CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond); // 3/4 of a rotation per second max angular velocity
private DoubleSupplier x;
private DoubleSupplier y;
/* Setting up bindings for necessary control of the swerve drive platform */
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // Use open-loop control for drive motors
/** Creates a new AprilTag3G. */
public AprilTag3(Limelight3 limelight3,CommandSwerveDrivetrain drivetrain, DoubleSupplier x, DoubleSupplier y) {
this.limelight3 = limelight3;
this.drivetrain = drivetrain;
this.x = x;
this.y = y;
addRequirements(limelight3,drivetrain);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@Override
public void initialize() {
limelight3.Apriltag();
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
double a = limelight3.getX();
if(limelight3.getV() == true){
drivetrain.setControl(drive.
withRotationalRate(a/10).
withVelocityX(x.getAsDouble()).
withVelocityY(y.getAsDouble()));
System.out.println(a/10);
}
else{
drivetrain.setControl(drive.
withRotationalRate(0).
withVelocityX(0).
withVelocityY(0));
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
drivetrain.setControl(drive.
withRotationalRate(0)
.withVelocityX(0)
.withVelocityY(0));
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,78 @@
// 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.Limelight;
import static edu.wpi.first.units.Units.*;
import java.util.function.DoubleSupplier;
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
import com.ctre.phoenix6.swerve.SwerveRequest;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.TunerConstants.TunerConstants;
import frc.robot.subsystems.CommandSwerveDrivetrain;
import frc.robot.subsystems.Limelight3G;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class AprilTag3G extends Command {
private Limelight3G limelight3g;
private CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond); // 3/4 of a rotation per second max angular velocity
private DoubleSupplier x;
private DoubleSupplier y;
/* Setting up bindings for necessary control of the swerve drive platform */
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // Use open-loop control for drive motors
/** Creates a new AprilTag3G. */
/** Creates a new AprilTag3G. */
public AprilTag3G(Limelight3G limelight3g,CommandSwerveDrivetrain drivetrain, DoubleSupplier x, DoubleSupplier y) {
this.limelight3g = limelight3g;
this.drivetrain = drivetrain;
this.x = x;
this.y = y;
addRequirements(limelight3g,drivetrain);
// 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() {
double a = limelight3g.getX();
if(limelight3g.getV() == true){
drivetrain.setControl(drive.
withRotationalRate(-a/7).
withVelocityY(x.getAsDouble()).
withVelocityX(-y.getAsDouble()));
System.out.println(a/7);
}
else{
drivetrain.setControl(drive.
withRotationalRate(0).
withVelocityX(0).
withVelocityY(0));
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
drivetrain.setControl(drive.
withRotationalRate(0).
withVelocityX(0).
withVelocityY(0));
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,79 @@
// 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.Limelight;
import static edu.wpi.first.units.Units.*;
import java.util.function.DoubleSupplier;
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
import com.ctre.phoenix6.swerve.SwerveRequest;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.TunerConstants.TunerConstants;
import frc.robot.subsystems.CommandSwerveDrivetrain;
import frc.robot.subsystems.Limelight3;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class Forme3 extends Command {
private Limelight3 limelight3;
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond); // 3/4 of a rotation per second max angular velocity
private CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
private DoubleSupplier x;
private DoubleSupplier y;
/* Setting up bindings for necessary control of the swerve drive platform */
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // Use open-loop control for drive motors
/** Creates a new Forme3. */
public Forme3(Limelight3 limelight3,CommandSwerveDrivetrain drivetrain, DoubleSupplier x, DoubleSupplier y) {
this.limelight3 = limelight3;
this.drivetrain = drivetrain;
this.x = x;
this.y = y;
addRequirements(limelight3,drivetrain);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@Override
public void initialize() {
limelight3.Forme();
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
double a = limelight3.getX();
if(limelight3.getV() == true){
drivetrain.setControl(drive.
withRotationalRate(a/10).
withVelocityX(x.getAsDouble()).
withVelocityY(y.getAsDouble()));
System.out.println(a/10);
}
else{
drivetrain.setControl(drive.
withRotationalRate(0).
withVelocityX(0).
withVelocityY(0));
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
drivetrain.setControl(drive.
withRotationalRate(0).
withVelocityX(0).
withVelocityY(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.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class AlgueExpire extends Command {
private Pince pince;
private Bougie bougie;
/** Creates a new CoralAlgue. */
public AlgueExpire(Pince pince,Bougie bougie) {
this.pince = pince;
this.bougie = bougie;
addRequirements(pince,bougie);
// 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(pince.emperagealgue()>60){
pince.aspirealgue(-0.5);
}
else{
pince.aspirealgue(-0.5);
bougie.Jaune();
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.aspirealgue(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,54 @@
// 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.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class Algue_inspire extends Command {
/** Creates a new Algue_inspire. */
private Pince pince;
private Bougie bougie;
public Algue_inspire(Pince pince, Bougie bougie) {
this.pince = pince;
this.bougie = bougie;
addRequirements(pince, bougie);
// 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.
//ajouter l'amperage pour arreter les moteurs
@Override
public void execute() {
if(pince.emperagealgue()>60){
pince.aspirealgue(0);
bougie.Bleu();
}
else{
pince.aspirealgue(0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.aspirealgue(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.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class CorailAspir extends Command {
/** Creates a new CorailAspir. */
private Pince pince;
Bougie bougie;
public CorailAspir(Pince pince, Bougie bougie) {
// Use addRequirements() here to declare subsystem dependencies.
this.pince = pince;
this.bougie = bougie;
addRequirements(pince,bougie);
}
// 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(pince.emperagecoral() > 15){
pince.aspirecoral(0);
bougie.Bleu();
}
else{
pince.aspirecoral(0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.aspirecoral(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return pince.emperagecoral()>13;
}
}

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.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class CoralAlgueInspire extends Command {
private Pince pince;
private Bougie bougie;
/** Creates a new CoralAlgue. */
public CoralAlgueInspire(Pince pince, Bougie bougie) {
this.pince = pince;
this.bougie = bougie;
addRequirements(pince,bougie);
// 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() {
pince.aspirecoral(-.5);
if(pince.emperagealgue()>60){
pince.aspirealgue(0);
bougie.Bleu();
}
else{
pince.aspirealgue(0.5);
bougie.Jaune();
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.aspirecoral(0);
pince.aspirealgue(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,49 @@
// 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.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;
import frc.robot.subsystems.Bougie;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class CoralExpire extends Command {
private Pince pince;
Bougie bougie;
/** Creates a new CoralAlgue. */
public CoralExpire(Pince pince, Bougie bougie) {
this.pince = pince;
this.bougie = bougie;
addRequirements(pince,bougie);
// 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() {
/* je crois que ce nest pas necessaire
if(pince.emperagecoral() > 60){
pince.aspirecoral(0);
}
*/
pince.aspirecoral(-.5);
bougie.Jaune();
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.aspirecoral(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

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.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class DepartPince extends Command {
private Pince pince;
/** Creates a new DepartPince. */
public DepartPince(Pince pince) {
this.pince = pince;
addRequirements(pince);
// 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(pince.position()==true){
pince.pivote(0);
pince.reset();
}
else{
pince.pivote(-0.2);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,50 @@
// 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.Pince;
import java.util.function.DoubleSupplier;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class PinceManuel extends Command {
private Pince pince;
private DoubleSupplier x;
/** Creates a new PinceManuel. */
public PinceManuel(Pince pince, DoubleSupplier x) {
this.pince = pince;
this.x = x;
//this.doubleSupplier = doubleSupplier;
addRequirements(pince);
// 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(pince.position()){
pince.pivote(0);
}
else{
pince.pivote(x.getAsDouble()/3.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,37 @@
// 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.Bougie;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class RainBow extends Command {
/** Creates a new RainBow. */
private Bougie bougie;
public RainBow(Bougie bougie) {
this.bougie = bougie;
addRequirements(bougie);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@Override
public void initialize() {bougie.RainBow();}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {bougie.RainBowStop();}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,67 @@
// 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.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class BalayeuseAlgue extends Command {
private Requin requin;
private Bougie bougie;
/** Creates a new Balayeuse. */
public BalayeuseAlgue(Requin requin, Bougie bougie) {
this.requin = requin;
this.bougie =bougie;
addRequirements(requin,bougie);
// 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() {
double cibleMin = 550;
double cibleMax = 650;
if(requin.amp()>=78.2){
requin.xRequin = true;
}
if(requin.xRequin){
bougie.Vert();
requin.balaye(0);
}
if(!requin.xRequin){
if(requin.encodeur()<=cibleMax && requin.encodeur()>=cibleMin){
requin.rotationer(0);
requin.balaye(-0.4);
}
else if(requin.encodeur()>=cibleMax){
requin.rotationer(-0.1);
}
else{
requin.rotationer(0.3);
}
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.rotationer(0);
requin.balaye(0);
requin.xRequin = false;
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,40 @@
// 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.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class BalayeuseBas extends Command {
private Requin requin;
/** Creates a new Balayeuse. */
public BalayeuseBas(Requin requin) {
this.requin = requin;
addRequirements(requin);
// 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() {
requin.rotationer(0.2);
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.rotationer(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,66 @@
// 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.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class BalayeuseCoral extends Command {
private Requin requin;
private Bougie bougie;
/** Creates a new Balayeuse. */
public BalayeuseCoral(Requin requin, Bougie bougie) {
this.requin = requin;
this.bougie = bougie;
addRequirements(requin,bougie);
// 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() {
double cibleMax = 1100;
double cibleMin = 900;
if(requin.amp()>=78.2){
requin.xRequin = true;
}
if(requin.xRequin){
requin.balaye(0);
bougie.Vert();
}
if (!requin.xRequin) {
if(requin.encodeur()<=cibleMax && requin.encodeur()>=cibleMin){
requin.rotationer(0);
requin.balaye(0.7);
}
else if(requin.encodeur()>=cibleMax){
requin.rotationer(-0.5);
}
else{
requin.rotationer(0.5);
}
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.rotationer(0);
requin.balaye(0);
requin.xRequin = false;
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

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.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class BalayeuseHaut extends Command {
private Requin requin;
/** Creates a new Balayeuse. */
public BalayeuseHaut(Requin requin) {
this.requin = requin;
addRequirements(requin);
// 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(requin.enHaut()==true){
requin.rotationer(0);
requin.reset();
}
else{
requin.rotationer(-0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.rotationer(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.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class ExpireCorail extends Command {
private Requin requin;
private Bougie bougie;
/** Creates a new ExpireAlgue. */
public ExpireCorail(Requin requin, Bougie bougie) {
this.requin = requin;
this.bougie = bougie;
addRequirements(requin,bougie);
// 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(requin.amp()> 60){
requin.balaye(-0.1);
}
else
{
bougie.Rouge();
requin.balaye(-0.1);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.balaye(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

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.commands.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class L1Requin extends Command {
private Requin requin;
private Bougie bougie;
/** Creates a new Balayeuse. */
public L1Requin(Requin requin,Bougie bougie) {
this.requin = requin;
this.bougie = bougie;
addRequirements(requin,bougie);
// 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(requin.encodeur()<=485 && requin.encodeur()>=385){
requin.rotationer(0);
}
else if(requin.encodeur()>=485){
requin.rotationer(-0.5);
}
else{
requin.rotationer(0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.rotationer(0);
requin.balaye(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

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.commands.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class exspire extends Command {
/** Creates a new aspire. */
private Requin requin;
private Bougie bougie
;
public exspire(Requin requin,Bougie bougie) {
// Use addRequirements() here to declare subsystem dependencies.
this.requin = requin;
this.bougie
=bougie;
addRequirements(requin,bougie);
}
// 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(requin.amp()> 15)
{
requin.balaye(0.2);
}
else{
bougie.Rouge();
requin.balaye(0.2);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.balaye(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -0,0 +1,49 @@
// 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.requin;
import java.util.function.DoubleSupplier;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class requin_manuel extends Command {
/** Creates a new requin_manuel. */
private Requin requin;
private DoubleSupplier x;
public requin_manuel(Requin requin) {
// Use addRequirements() here to declare subsystem dependencies.
this.requin = requin;
addRequirements(requin);
}
// 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(requin.enHaut()){
requin.rotationer(0);
}
else{
requin.rotationer(x.getAsDouble());
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
requin.rotationer(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

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.Elevateur;
import frc.robot.subsystems.Pince;
import frc.robot.subsystems.Requin;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class reset extends Command {
/** Creates a new reset. */
private Elevateur elevateur;
private Pince pince;
private Requin requin;
public reset(Elevateur elevateur, Pince pince, Requin requin) {
// Use addRequirements() here to declare subsystem dependencies.
this.elevateur = elevateur;
this.pince = pince;
this.requin = requin;
addRequirements(elevateur,pince, requin);
}
// 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() {
elevateur.reset();
pince.reset();
requin.reset();
}
// 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

@ -0,0 +1,78 @@
// 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 com.ctre.phoenix.led.CANdleConfiguration;
import com.ctre.phoenix.led.FireAnimation;
import com.ctre.phoenix.led.LarsonAnimation;
import com.ctre.phoenix.led.RainbowAnimation;
import com.ctre.phoenix.led.TwinkleAnimation;
import com.ctre.phoenix.led.TwinkleOffAnimation;
import com.ctre.phoenix.led.TwinkleOffAnimation.TwinkleOffPercent;
import com.ctre.phoenix.led.LarsonAnimation.BounceMode;
import com.ctre.phoenix.led.TwinkleAnimation.TwinklePercent;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Bougie extends SubsystemBase {
CANdle candle = new CANdle(23);
CANdleConfiguration config = new CANdleConfiguration();
LarsonAnimation rainbowAnim = new LarsonAnimation(256,0,0,0,0.1,68,BounceMode.Front,10,8);
//TwinkleOffAnimation rainbowAnim = new TwinkleOffAnimation(256, 0, 0,0,0.5,68,TwinkleOffPercent.Percent88,8);
/** Creates a new Bougie. */
public Bougie() {
config.brightnessScalar = 0.5;
candle.configAllSettings(config);
}
public void Rouge() {
candle.setLEDs(255, 0, 0,0,8,8);
candle.setLEDs(255, 0, 0,0,24,8);
candle.setLEDs(255, 0, 0,0,40,8);
candle.setLEDs(255, 0, 0,0,56,8);
candle.setLEDs(255, 0, 0,0,72,8);
candle.setLEDs(255, 0, 0,0,88,8);
candle.setLEDs(255, 0, 0,0,104,8);
candle.setLEDs(255, 0, 0,0,120,8);
}
public void Vert() {
candle.setLEDs(0, 255, 0,0,8,8);
candle.setLEDs(0, 255, 0,0,24,8);
candle.setLEDs(0, 255, 0,0,40,8);
candle.setLEDs(0, 255, 0,0,56,8);
candle.setLEDs(0, 255, 0,0,72,8);
candle.setLEDs(0, 255, 0,0,88,8);
candle.setLEDs(0, 255, 0,0,104,8);
candle.setLEDs(0, 255, 0,0,120,8);
}
public void Bleu() {
candle.setLEDs(0, 0, 255,0,16,8);
candle.setLEDs(0, 0, 255,0,32,8);
candle.setLEDs(0, 0, 255,0,48,8);
candle.setLEDs(0, 0, 255,0,64,8);
candle.setLEDs(0, 0, 255,0,80,8);
candle.setLEDs(0, 0, 255,0,96,8);
candle.setLEDs(0, 0, 255,0,112,8);
}
public void Jaune() {
candle.setLEDs(255, 215, 0,0,16,8);
candle.setLEDs(255, 215, 0,0,32,8);
candle.setLEDs(255, 215, 0,0,48,8);
candle.setLEDs(255, 215, 0,0,64,8);
candle.setLEDs(255, 215, 0,0,80,8);
candle.setLEDs(255, 215, 0,0,96,8);
candle.setLEDs(255, 215, 0,0,112,8);
}
public void RainBow(){
candle.animate(rainbowAnim);
}
public void RainBowStop(){
candle.animate(null);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -1,20 +1,14 @@
package frc.robot.subsystems; package frc.robot.subsystems;
import static edu.wpi.first.units.Units.*;
import java.util.function.Supplier; import java.util.function.Supplier;
import com.ctre.phoenix6.SignalLogger;
import com.ctre.phoenix6.Utils; import com.ctre.phoenix6.Utils;
import com.ctre.phoenix6.swerve.SwerveDrivetrainConstants; import com.ctre.phoenix6.swerve.SwerveDrivetrainConstants;
import com.ctre.phoenix6.swerve.SwerveModuleConstants; import com.ctre.phoenix6.swerve.SwerveModuleConstants;
import com.ctre.phoenix6.swerve.SwerveRequest; import com.ctre.phoenix6.swerve.SwerveRequest;
import com.pathplanner.lib.auto.AutoBuilder; import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.config.PIDConstants; import com.pathplanner.lib.config.PIDConstants;
import com.pathplanner.lib.config.RobotConfig; import com.pathplanner.lib.config.RobotConfig;
import com.pathplanner.lib.controllers.PPHolonomicDriveController; import com.pathplanner.lib.controllers.PPHolonomicDriveController;
import edu.wpi.first.math.Matrix; import edu.wpi.first.math.Matrix;
import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.numbers.N1; import edu.wpi.first.math.numbers.N1;
@ -25,12 +19,11 @@ import edu.wpi.first.wpilibj.Notifier;
import edu.wpi.first.wpilibj.RobotController; import edu.wpi.first.wpilibj.RobotController;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Subsystem; import edu.wpi.first.wpilibj2.command.Subsystem;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
import frc.robot.TunerConstants.TunerConstants.TunerSwerveDrivetrain; import frc.robot.TunerConstants.TunerConstants.TunerSwerveDrivetrain;
/** /**
* Class that extends the Phoenix 6 SwerveDrivetrain class and implements * Class that extends the Phoenix 6 SwerveDrivetrain class and implements
* Subsystem so it can easily be used in command-based projects. * Subsystem so it can easily be used in command-based projeScts.
*/ */
public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Subsystem { public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Subsystem {
@ -47,101 +40,47 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
private final SwerveRequest.ApplyRobotSpeeds m_pathApplyRobotSpeeds = new SwerveRequest.ApplyRobotSpeeds(); private final SwerveRequest.ApplyRobotSpeeds m_pathApplyRobotSpeeds = new SwerveRequest.ApplyRobotSpeeds();
/* Swerve requests to apply during SysId characterization */ /* SysId routine for characterizing translation. This is used to find PID gains for the drive motors. */
private final SwerveRequest.SysIdSwerveTranslation m_translationCharacterization = new SwerveRequest.SysIdSwerveTranslation(); private final SwerveRequest.SysIdSwerveTranslation m_translationCharacterization = new SwerveRequest.SysIdSwerveTranslation();
private final SwerveRequest.SysIdSwerveSteerGains m_steerCharacterization = new SwerveRequest.SysIdSwerveSteerGains(); private final SwerveRequest.SysIdSwerveSteerGains m_steerCharacterization = new SwerveRequest.SysIdSwerveSteerGains();
private final SwerveRequest.SysIdSwerveRotation m_rotationCharacterization = new SwerveRequest.SysIdSwerveRotation(); private final SwerveRequest.SysIdSwerveRotation m_rotationCharacterization = new SwerveRequest.SysIdSwerveRotation();
/* SysId routine for characterizing translation. This is used to find PID gains for the drive motors. */ // private void configureAutoBuilder() {
private final SysIdRoutine m_sysIdRoutineTranslation = new SysIdRoutine( // try {
new SysIdRoutine.Config( // var config = RobotConfig.fromGUISettings();
null, // Use default ramp rate (1 V/s) // AutoBuilder.configure(
Volts.of(4), // Reduce dynamic step voltage to 4 V to prevent brownout
null, // Use default timeout (10 s)
// Log state with SignalLogger class
state -> SignalLogger.writeString("SysIdTranslation_State", state.toString())
),
new SysIdRoutine.Mechanism(
output -> setControl(m_translationCharacterization.withVolts(output)),
null,
this
)
);
/* SysId routine for characterizing steer. This is used to find PID gains for the steer motors. */ // () -> getState().Pose, // Supplier of current robot pose
private final SysIdRoutine m_sysIdRoutineSteer = new SysIdRoutine( // this::resetPose, // Consumer for seeding pose against auto
new SysIdRoutine.Config( // () -> getState().Speeds, // Supplier of current robot speeds
null, // Use default ramp rate (1 V/s)
Volts.of(7), // Use dynamic voltage of 7 V
null, // Use default timeout (10 s)
// Log state with SignalLogger class
state -> SignalLogger.writeString("SysIdSteer_State", state.toString())
),
new SysIdRoutine.Mechanism(
volts -> setControl(m_steerCharacterization.withVolts(volts)),
null,
this
)
);
/* // // Consumer of ChassisSpeeds and feedforwards to drive the robot
* SysId routine for characterizing rotation. // (speeds, feedforwards) -> setControl(
* This is used to find PID gains for the FieldCentricFacingAngle HeadingController. // m_pathApplyRobotSpeeds.withSpeeds(speeds)
* See the documentation of SwerveRequest.SysIdSwerveRotation for info on importing the log to SysId. // .withWheelForceFeedforwardsY(feedforwards.robotRelativeForcesXNewtons())
*/ // .withWheelForceFeedforwardsX(feedforwards.robotRelativeForcesYNewtons())
private final SysIdRoutine m_sysIdRoutineRotation = new SysIdRoutine( // ),
new SysIdRoutine.Config( // new PPHolonomicDriveController(
/* This is in radians per second², but SysId only supports "volts per second" */ // // PID constants for translation
Volts.of(Math.PI / 6).per(Second), // new PIDConstants(63.167, 0, 0.54521),
/* This is in radians per second, but SysId only supports "volts" */ // // // PID constants for rotation
Volts.of(Math.PI), // // new PIDConstants(7.9735, 0, 0.038499)
null, // Use default timeout (10 s) // // PID constants for rotation
// Log state with SignalLogger class // new PIDConstants(43.502,0,2.7353)
state -> SignalLogger.writeString("SysIdRotation_State", state.toString()) // ),
), // config,
new SysIdRoutine.Mechanism( // // Assume the path needs to be flipped for Red vs Blue, this is normally the case
output -> { // () -> DriverStation.getAlliance().orElse(Alliance.Blue) == Alliance.Red,
/* output is actually radians per second, but SysId only supports "volts" */ // this // Subsystem for requirements
setControl(m_rotationCharacterization.withRotationalRate(output.in(Volts)));
/* also log the requested output for SysId */
SignalLogger.writeDouble("Rotational_Rate", output.in(Volts));
},
null,
this
)
);
private void configureAutoBuilder() { // );
try { // } catch (Exception ex) {
var config = RobotConfig.fromGUISettings(); // DriverStation.reportError("Failed to load PathPlanner config and configure AutoBuilder", ex.getStackTrace());
AutoBuilder.configure( // }
() -> getState().Pose, // Supplier of current robot pose // PPHolonomicDriveController.overrideRotationFeedback(()->{
this::resetPose, // Consumer for seeding pose against auto // return 0;
() -> getState().Speeds, // Supplier of current robot speeds // });
// Consumer of ChassisSpeeds and feedforwards to drive the robot // }
(speeds, feedforwards) -> setControl(
m_pathApplyRobotSpeeds.withSpeeds(speeds)
.withWheelForceFeedforwardsX(feedforwards.robotRelativeForcesXNewtons())
.withWheelForceFeedforwardsY(feedforwards.robotRelativeForcesYNewtons())
),
new PPHolonomicDriveController(
// PID constants for translation
new PIDConstants(10, 0, 0),
// PID constants for rotation
new PIDConstants(7, 0, 0)
),
config,
// Assume the path needs to be flipped for Red vs Blue, this is normally the case
() -> DriverStation.getAlliance().orElse(Alliance.Blue) == Alliance.Red,
this // Subsystem for requirements
);
} catch (Exception ex) {
DriverStation.reportError("Failed to load PathPlanner config and configure AutoBuilder", ex.getStackTrace());
}
}
/* The SysId routine to test */
private SysIdRoutine m_sysIdRoutineToApply = m_sysIdRoutineTranslation;
/** /**
* Constructs a CTRE SwerveDrivetrain using the specified constants. * Constructs a CTRE SwerveDrivetrain using the specified constants.
@ -161,7 +100,7 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
if (Utils.isSimulation()) { if (Utils.isSimulation()) {
startSimThread(); startSimThread();
} }
configureAutoBuilder(); //configureAutoBuilder();
} }
/** /**
@ -186,7 +125,7 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
if (Utils.isSimulation()) { if (Utils.isSimulation()) {
startSimThread(); startSimThread();
} }
configureAutoBuilder(); // configureAutoBuilder();
} }
/** /**
@ -219,7 +158,7 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
if (Utils.isSimulation()) { if (Utils.isSimulation()) {
startSimThread(); startSimThread();
} }
configureAutoBuilder(); //configureAutoBuilder();
} }
@ -234,28 +173,6 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
return run(() -> this.setControl(requestSupplier.get())); return run(() -> this.setControl(requestSupplier.get()));
} }
/**
* Runs the SysId Quasistatic test in the given direction for the routine
* specified by {@link #m_sysIdRoutineToApply}.
*
* @param direction Direction of the SysId Quasistatic test
* @return Command to run
*/
public Command sysIdQuasistatic(SysIdRoutine.Direction direction) {
return m_sysIdRoutineToApply.quasistatic(direction);
}
/**
* Runs the SysId Dynamic test in the given direction for the routine
* specified by {@link #m_sysIdRoutineToApply}.
*
* @param direction Direction of the SysId Dynamic test
* @return Command to run
*/
public Command sysIdDynamic(SysIdRoutine.Direction direction) {
return m_sysIdRoutineToApply.dynamic(direction);
}
@Override @Override
public void periodic() { public void periodic() {
/* /*

View File

@ -0,0 +1,98 @@
// 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.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType;
public class Elevateur extends SubsystemBase {
ShuffleboardTab teb = Shuffleboard.getTab("teb");
/** Creates a new Elevateur. */
private GenericEntry encodeurelevateurL2bas =
teb.add("encodeurelevateurL2bas", -1).getEntry();
private GenericEntry encodeurelevateurL2haut =
teb.add("encodeurelevateurL2haut", -0.9).getEntry();
private GenericEntry encodeurelevateurL3bas =
teb.add("encodeurelevateurL3bas", -3).getEntry();
private GenericEntry encodeurelevateurL3haut =
teb.add("encodeurelevateurL3haut", -3.1).getEntry();
private GenericEntry encodeurelevateurL4bas =
teb.add("encodeurelevateurL4bas", -6.3).getEntry();
private GenericEntry encodeurelevateurL4haut =
teb.add("encodeurelevateurL4haut", -6.5).getEntry();
private GenericEntry encodeurelevateurstationbas =
teb.add("encodeurelevateursationbas", -0.5).getEntry();
private GenericEntry encodeurelevateurstationhaut =
teb.add("encodeurelevateursationhaut", -0.4).getEntry();
private GenericEntry distanceDeploiePince =
teb.add("encodeurDeploiePince", 0.2).getEntry();
public Elevateur() {
teb.addDouble("encodeur elevateur",this::position);
teb.addBoolean("limit elevateur", this::limit2);
}
final SparkMax monte = new SparkMax(22, MotorType.kBrushless);
final DigitalInput limit2 = new DigitalInput(0);
public double position(){
return monte.getEncoder().getPosition();
}
public void vitesse(double vitesse){
if (limit2()) {
if (vitesse > 0) {
monte.set(0);
}
else{
monte.set(vitesse);
}
}
else{
monte.set(vitesse);
}
}
public boolean limit2(){
return limit2.get();
}
public void reset(){
monte.getEncoder().setPosition(0);
}
public double encodeurelevateurL2bas(){
return encodeurelevateurL2bas.getDouble(-1);
}
public double encodeurelevateurL2haut(){
return encodeurelevateurL2haut.getDouble(-0.9);
}
public double encodeurelevateurL3bas(){
return encodeurelevateurL3bas.getDouble(-2.8);
}
public double encodeurelevateurL3haut(){
return encodeurelevateurL3haut.getDouble(-3);
}
public double encodeurelevateurL4bas(){
return encodeurelevateurL4bas.getDouble(-6.3);
}
public double encodeurelevateurL4haut(){
return encodeurelevateurL4haut.getDouble(-6.5);
}
public double encodeurelevateurstationbas(){
return encodeurelevateurstationbas.getDouble(-0.5);
}
public double encodeurelevateurstationhaut(){
return encodeurelevateurstationhaut.getDouble(-0.4);
}
public double distanceDeploiePince(){
return distanceDeploiePince.getDouble(0.2);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -1,26 +0,0 @@
// 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.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.motorcontrol.Spark;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Grimpeur extends SubsystemBase {
/** Creates a new Grimpeur. */
public Grimpeur() {}
final Spark grimpeur = new Spark(0);
final DigitalInput limit1 = new DigitalInput(0);
public void grimpe(double vitesse){
grimpeur.set(vitesse);
}
final void stop(){
limit1.get();
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -0,0 +1,39 @@
// 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.net.PortForwarder;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.LimelightHelpers;
public class Limelight3 extends SubsystemBase {
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
NetworkTableEntry pipeline = table.getEntry("pipeline");
/** Creates a new Limelight3. */
public Limelight3() {
for(int port = 5800; port <=5807; port++){
PortForwarder.add(port, "limelight.local", port);
}
}
public double getX(){
return LimelightHelpers.getTX("limelight-balon");
}
public boolean getV(){
return LimelightHelpers.getTV("limelight-balon");
}
public void Apriltag(){
pipeline.setNumber(1);
}
public void Forme(){
pipeline.setNumber(0);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -0,0 +1,28 @@
// 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.net.PortForwarder;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.LimelightHelpers;
public class Limelight3G extends SubsystemBase {
/** Creates a new Limelight3. */
public Limelight3G() {
for(int port = 5800; port <=5807; port++){
PortForwarder.add(port, "limelight.local", port);
}
}
public double getX(){
return LimelightHelpers.getTX("limelight-tag");
}
public boolean getV(){
return LimelightHelpers.getTV("limelight-tag");
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -0,0 +1,71 @@
// 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.revrobotics.spark.SparkLowLevel.MotorType;
import com.revrobotics.spark.SparkMax;
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 Pince extends SubsystemBase {
/** Creates a new Pince. */
ShuffleboardTab teb = Shuffleboard.getTab("teb");
public Pince() {
teb.addBoolean("limit pince",this::position);
teb.addDouble("encodeur pince", this::encodeurpivot);
teb.addDouble("amperage corail", this::emperagecoral);
teb.addDouble("amperage algue", this::emperagealgue);
}
final SparkMax coral = new SparkMax(20, MotorType.kBrushless);
final SparkMax pivoti = new SparkMax(14, MotorType.kBrushless);
final SparkMax algue1 = new SparkMax(16, MotorType.kBrushless);
final SparkMax algue2 = new SparkMax(19, MotorType.kBrushless);
final DigitalInput limit6 = new DigitalInput(9);
public void aspirecoral(double vitesse){
coral.set(vitesse);
}
public void pivote(double vitesse){
if (position()) {
if (vitesse < 0) {
pivoti.set(0);
}
else{
pivoti.set(vitesse);
}
}
else{
pivoti.set(vitesse);
}
}
public void aspirealgue(double vitesse){
algue2.set(-vitesse);
algue1.set(-vitesse);
}
public double encodeurpivot(){
return pivoti.getEncoder().getPosition();
}
public boolean position(){
return limit6.get();
}
public void reset(){
pivoti.getEncoder().setPosition(0);
}
public double emperagecoral(){
return coral.getOutputCurrent();
}
public double emperagealgue(){
return algue1.getOutputCurrent();
}
public boolean x = false;
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

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 com.revrobotics.spark.SparkFlex;
import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType;
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 Requin extends SubsystemBase {
/** Creates a new Requin. */
ShuffleboardTab teb = Shuffleboard.getTab("teb");
public Requin() {
teb.addBoolean("limit requin", this::enHaut);
teb.addDouble("amparge requin", this::amp);
teb.addDouble("encodeur requin", this::encodeur);
}
final SparkFlex balaye = new SparkFlex(15, MotorType.kBrushless);
final SparkMax rotatione = new SparkMax(17, MotorType.kBrushless);
final DigitalInput limit3 = new DigitalInput(1);
public void balaye(double vitesse){
balaye.set(vitesse);
}
public void rotationer(double vitesse){
rotatione.set(vitesse);
}
public boolean enHaut(){
return limit3.get();
}
public double encodeur(){
return rotatione.getEncoder().getPosition();
}
public void reset(){
rotatione.getEncoder().setPosition(0);
}
public double amp(){
return balaye.getOutputCurrent();
}
public boolean xRequin = false;
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"fileName": "PathplannerLib-2025.2.2.json", "fileName": "PathplannerLib-2025.2.3.json",
"name": "PathplannerLib", "name": "PathplannerLib",
"version": "2025.2.2", "version": "2025.2.3",
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
"frcYear": "2025", "frcYear": "2025",
"mavenUrls": [ "mavenUrls": [
@ -12,7 +12,7 @@
{ {
"groupId": "com.pathplanner.lib", "groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-java", "artifactId": "PathplannerLib-java",
"version": "2025.2.2" "version": "2025.2.3"
} }
], ],
"jniDependencies": [], "jniDependencies": [],
@ -20,7 +20,7 @@
{ {
"groupId": "com.pathplanner.lib", "groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-cpp", "artifactId": "PathplannerLib-cpp",
"version": "2025.2.2", "version": "2025.2.3",
"libName": "PathplannerLib", "libName": "PathplannerLib",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": false, "sharedLibrary": false,

View File

@ -1,7 +1,7 @@
{ {
"fileName": "Phoenix6-25.2.1.json", "fileName": "Phoenix6-25.2.2.json",
"name": "CTRE-Phoenix (v6)", "name": "CTRE-Phoenix (v6)",
"version": "25.2.1", "version": "25.2.2",
"frcYear": "2025", "frcYear": "2025",
"uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19",
"mavenUrls": [ "mavenUrls": [
@ -19,14 +19,14 @@
{ {
"groupId": "com.ctre.phoenix6", "groupId": "com.ctre.phoenix6",
"artifactId": "wpiapi-java", "artifactId": "wpiapi-java",
"version": "25.2.1" "version": "25.2.2"
} }
], ],
"jniDependencies": [ "jniDependencies": [
{ {
"groupId": "com.ctre.phoenix6", "groupId": "com.ctre.phoenix6",
"artifactId": "api-cpp", "artifactId": "api-cpp",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -40,7 +40,7 @@
{ {
"groupId": "com.ctre.phoenix6", "groupId": "com.ctre.phoenix6",
"artifactId": "tools", "artifactId": "tools",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -54,7 +54,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "api-cpp-sim", "artifactId": "api-cpp-sim",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -68,7 +68,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "tools-sim", "artifactId": "tools-sim",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -82,7 +82,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simTalonSRX", "artifactId": "simTalonSRX",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -96,7 +96,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simVictorSPX", "artifactId": "simVictorSPX",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -110,7 +110,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simPigeonIMU", "artifactId": "simPigeonIMU",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -124,7 +124,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simCANCoder", "artifactId": "simCANCoder",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -138,7 +138,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProTalonFX", "artifactId": "simProTalonFX",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -152,7 +152,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProTalonFXS", "artifactId": "simProTalonFXS",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -166,7 +166,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProCANcoder", "artifactId": "simProCANcoder",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -180,7 +180,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProPigeon2", "artifactId": "simProPigeon2",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -194,7 +194,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProCANrange", "artifactId": "simProCANrange",
"version": "25.2.1", "version": "25.2.2",
"isJar": false, "isJar": false,
"skipInvalidPlatforms": true, "skipInvalidPlatforms": true,
"validPlatforms": [ "validPlatforms": [
@ -210,7 +210,7 @@
{ {
"groupId": "com.ctre.phoenix6", "groupId": "com.ctre.phoenix6",
"artifactId": "wpiapi-cpp", "artifactId": "wpiapi-cpp",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_Phoenix6_WPI", "libName": "CTRE_Phoenix6_WPI",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -226,7 +226,7 @@
{ {
"groupId": "com.ctre.phoenix6", "groupId": "com.ctre.phoenix6",
"artifactId": "tools", "artifactId": "tools",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_PhoenixTools", "libName": "CTRE_PhoenixTools",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -242,7 +242,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "wpiapi-cpp-sim", "artifactId": "wpiapi-cpp-sim",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_Phoenix6_WPISim", "libName": "CTRE_Phoenix6_WPISim",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -258,7 +258,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "tools-sim", "artifactId": "tools-sim",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_PhoenixTools_Sim", "libName": "CTRE_PhoenixTools_Sim",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -274,7 +274,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simTalonSRX", "artifactId": "simTalonSRX",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimTalonSRX", "libName": "CTRE_SimTalonSRX",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -290,7 +290,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simVictorSPX", "artifactId": "simVictorSPX",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimVictorSPX", "libName": "CTRE_SimVictorSPX",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -306,7 +306,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simPigeonIMU", "artifactId": "simPigeonIMU",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimPigeonIMU", "libName": "CTRE_SimPigeonIMU",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -322,7 +322,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simCANCoder", "artifactId": "simCANCoder",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimCANCoder", "libName": "CTRE_SimCANCoder",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -338,7 +338,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProTalonFX", "artifactId": "simProTalonFX",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimProTalonFX", "libName": "CTRE_SimProTalonFX",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -354,7 +354,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProTalonFXS", "artifactId": "simProTalonFXS",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimProTalonFXS", "libName": "CTRE_SimProTalonFXS",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -370,7 +370,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProCANcoder", "artifactId": "simProCANcoder",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimProCANcoder", "libName": "CTRE_SimProCANcoder",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -386,7 +386,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProPigeon2", "artifactId": "simProPigeon2",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimProPigeon2", "libName": "CTRE_SimProPigeon2",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,
@ -402,7 +402,7 @@
{ {
"groupId": "com.ctre.phoenix6.sim", "groupId": "com.ctre.phoenix6.sim",
"artifactId": "simProCANrange", "artifactId": "simProCANrange",
"version": "25.2.1", "version": "25.2.2",
"libName": "CTRE_SimProCANrange", "libName": "CTRE_SimProCANrange",
"headerClassifier": "headers", "headerClassifier": "headers",
"sharedLibrary": true, "sharedLibrary": true,