Compare commits
77 Commits
bd79b249e9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41f6e4747f | ||
|
|
7908d4c5df | ||
|
|
2263961829 | ||
|
|
27ea9d96e3 | ||
|
|
01edf1cb01 | ||
|
|
0b4c0e09ff | ||
|
|
6c86b2ed5c | ||
|
|
6885b80d6a | ||
|
|
2472c67adf | ||
|
|
c8d0ee3a03 | ||
|
|
3300d74a78 | ||
|
|
bdffb48ece | ||
|
|
5f44d5304a | ||
|
|
9aa7018812 | ||
|
|
d98dc4e467 | ||
|
|
b0ad34519e | ||
|
|
7b734cc046 | ||
|
|
cdca0230a4 | ||
|
|
56b28100df | ||
|
|
db935eceda | ||
|
|
da28ff48db | ||
|
|
5b6e3ac7b2 | ||
|
|
9585c17bdb | ||
|
|
07eeaffa32 | ||
|
|
8202b012cb | ||
|
|
e5f7b05063 | ||
|
|
5916f4f141 | ||
| 4438560698 | |||
| b2d4647e41 | |||
| 75922f581c | |||
| a429b936d2 | |||
|
|
3b06cbd447 | ||
|
|
7b535a845f | ||
|
|
42e35fca8a | ||
|
|
272f89962a | ||
|
|
52c72e9a61 | ||
|
|
4d1b353e25 | ||
|
|
9d09af20b0 | ||
|
|
ae9a6bd046 | ||
|
|
10b0110315 | ||
| 098f16665a | |||
| 1240160ed7 | |||
| 4068016d36 | |||
|
|
6afc342006 | ||
| f7e88619e9 | |||
| 5c626f33e3 | |||
|
|
673a7fcb82 | ||
|
|
755d79aa18 | ||
|
|
799e3e34c3 | ||
|
|
fbd94fc33d | ||
|
|
9e3bd6e7d3 | ||
|
|
bd853dfc79 | ||
|
|
cb3104152c | ||
|
|
85da1dcad1 | ||
|
|
a92a7a0ea1 | ||
|
|
ba57959f4d | ||
|
|
79568a58b9 | ||
|
|
57fa3597e2 | ||
|
|
5ba5cce953 | ||
|
|
d0c50cbd6e | ||
|
|
0492c9a2c6 | ||
|
|
69fe4a58d0 | ||
|
|
92b876e7b0 | ||
|
|
22746ab8ca | ||
|
|
70b796e99a | ||
|
|
083288d3fc | ||
|
|
b83e689b97 | ||
|
|
33fd6ceb23 | ||
|
|
36a6bf2ab0 | ||
|
|
9249751f2b | ||
|
|
2c0bab873c | ||
|
|
2e7f9a6aa9 | ||
|
|
7f0f957ad1 | ||
|
|
7d2b2ea139 | ||
|
|
a7fb3108ea | ||
|
|
e0c1e26933 | ||
|
|
97387630aa |
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -56,5 +56,6 @@
|
|||||||
"edu.wpi.first.math.proto.*",
|
"edu.wpi.first.math.proto.*",
|
||||||
"edu.wpi.first.math.**.proto.*",
|
"edu.wpi.first.math.**.proto.*",
|
||||||
"edu.wpi.first.math.**.struct.*",
|
"edu.wpi.first.math.**.struct.*",
|
||||||
]
|
],
|
||||||
|
"java.dependency.enableDependencyCheckup": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"enableCppIntellisense": false,
|
"enableCppIntellisense": false,
|
||||||
"currentLanguage": "java",
|
"currentLanguage": "java",
|
||||||
"projectYear": "2025",
|
"projectYear": "2026",
|
||||||
"teamNumber": 5618
|
"teamNumber": 5618
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2009-2024 FIRST and other WPILib contributors
|
Copyright (c) 2009-2026 FIRST and other WPILib contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "java"
|
id "java"
|
||||||
id "edu.wpi.first.GradleRIO" version "2025.3.2"
|
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
@@ -43,7 +43,8 @@ deploy {
|
|||||||
|
|
||||||
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
|
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
|
||||||
|
|
||||||
// Set to true to use debug for JNI.
|
// Set to true to use debug for all targets including JNI, which will drastically impact
|
||||||
|
// performance.
|
||||||
wpi.java.debugJni = false
|
wpi.java.debugJni = false
|
||||||
|
|
||||||
// Set this to true to enable desktop support.
|
// Set this to true to enable desktop support.
|
||||||
@@ -88,7 +89,9 @@ wpi.sim.addDriverstation()
|
|||||||
// knows where to look for our Robot Class.
|
// knows where to look for our Robot Class.
|
||||||
jar {
|
jar {
|
||||||
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||||
from sourceSets.main.allSource
|
from('src') { into 'backup/src' }
|
||||||
|
from('vendordeps') { into 'backup/vendordeps' }
|
||||||
|
from('build.gradle') { into 'backup' }
|
||||||
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
||||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ pluginManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
String frcYear = '2025'
|
String frcYear = '2026'
|
||||||
File frcHome
|
File frcHome
|
||||||
if (OperatingSystem.current().isWindows()) {
|
if (OperatingSystem.current().isWindows()) {
|
||||||
String publicFolder = System.getenv('PUBLIC')
|
String publicFolder = System.getenv('PUBLIC')
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"System Joysticks": {
|
||||||
|
"window": {
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"keyboardJoysticks": [
|
"keyboardJoysticks": [
|
||||||
{
|
{
|
||||||
"axisConfig": [
|
"axisConfig": [
|
||||||
|
|||||||
@@ -4,20 +4,26 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "deadline",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "wait",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "Depot"
|
"waitTime": 3.0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "path",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "DescendreBalayeuse"
|
"pathName": "Depot"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -36,11 +42,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "Limelighter"
|
"commands": [
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -50,7 +54,10 @@
|
|||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "TournerAZero"
|
"name": "Aspirer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -72,9 +79,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "MonterReservoir"
|
"name": "gauche"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "Limelighter"
|
"name": "DescendreBalayeuse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -4,6 +4,12 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "deadline",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -14,12 +20,6 @@
|
|||||||
"pathName": "Depot"
|
"pathName": "Depot"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "DescendreBalayeuse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -35,12 +35,6 @@
|
|||||||
"pathName": "Tir"
|
"pathName": "Tir"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "Limelighter"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -4,20 +4,26 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "deadline",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "wait",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "Depot"
|
"waitTime": 3.0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "path",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "DescendreBalayeuse"
|
"pathName": "Depot"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -36,11 +42,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "Limelighter"
|
"commands": [
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -50,7 +54,10 @@
|
|||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "TournerA180"
|
"name": "Aspirer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -72,9 +79,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "MonterMur"
|
"name": "droite"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "deadline",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -14,12 +20,6 @@
|
|||||||
"pathName": "ChercherMilieuDroite"
|
"pathName": "ChercherMilieuDroite"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "DescendreBalayeuse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "deadline",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -14,12 +20,6 @@
|
|||||||
"pathName": "ChercherMilieuDroiteProche"
|
"pathName": "ChercherMilieuDroiteProche"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "DescendreBalayeuse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "deadline",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -14,12 +20,6 @@
|
|||||||
"pathName": "ChercherMilieuGauche"
|
"pathName": "ChercherMilieuGauche"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "DescendreBalayeuse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "deadline",
|
"type": "deadline",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -14,12 +20,6 @@
|
|||||||
"pathName": "ChercherMilieuGaucheProche"
|
"pathName": "ChercherMilieuGaucheProche"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "DescendreBalayeuse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
68
src/main/deploy/pathplanner/autos/Tirgrimpe.auto
Normal file
68
src/main/deploy/pathplanner/autos/Tirgrimpe.auto
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"command": {
|
||||||
|
"type": "sequential",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "tirgrimpe1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreBalayeuse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "deadline",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "Lancer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "Aspirer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "GrimperReservoir"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "MonterGrimpeur"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "gauche"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "DescendreGrimpeur"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resetOdom": true,
|
||||||
|
"folder": null,
|
||||||
|
"choreoAuto": false
|
||||||
|
}
|
||||||
@@ -3,12 +3,12 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 3.5732667617689007,
|
"x": 3.6120827389443653,
|
||||||
"y": 5.917574893009986
|
"y": 5.917574893009986
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 2.266462196861626,
|
"x": 2.3052781740370905,
|
||||||
"y": 5.904636233951498
|
"y": 5.904636233951498
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 1.1796148359486442,
|
"x": 0.23509272467902986,
|
||||||
"y": 5.917574893009986
|
"y": 5.917574893009986
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 1.7230385164051354,
|
"x": 0.778516405135521,
|
||||||
"y": 5.930513552068473
|
"y": 5.930513552068473
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 2.4476034236804565,
|
"x": 1.878,
|
||||||
"y": 4.85660485021398
|
"y": 5.154
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 1.6971611982881591,
|
"x": 1.1275577746077026,
|
||||||
"y": 4.85660485021398
|
"y": 5.154
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
"linkedName": null
|
"linkedName": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 1.0761055634807417,
|
"x": 1.0372895863052778,
|
||||||
"y": 4.85660485021398
|
"y": 5.011868758915835
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 1.503081312410841,
|
"x": 1.4642653352353772,
|
||||||
"y": 4.869543509272469
|
"y": 5.024807417974324
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 2.4476034236804565,
|
"x": 1.878,
|
||||||
"y": 4.85660485021398
|
"y": 5.154
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 2.3958487874465044,
|
"x": 1.8262453637660478,
|
||||||
"y": 2.695848787446506
|
"y": 2.993243937232526
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
"linkedName": null
|
"linkedName": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 1.0502282453637657,
|
"x": 2.0076890156918683,
|
||||||
"y": 2.4758915834522113
|
"y": 2.2041797432239663
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 2.292339514978602,
|
"x": 3.2498002853067054,
|
||||||
"y": 2.3982596291012843
|
"y": 2.1265477888730393
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
},
|
},
|
||||||
"goalEndState": {
|
"goalEndState": {
|
||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
"rotation": 0.0
|
"rotation": 32.10625595511781
|
||||||
},
|
},
|
||||||
"reversed": false,
|
"reversed": false,
|
||||||
"folder": null,
|
"folder": null,
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 1.0502282453637657,
|
"x": 1.0,
|
||||||
"y": 2.4758915834522113
|
"y": 2.6
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 1.0408884389937225,
|
"x": 0.9906601936299568,
|
||||||
"y": 2.742159765250622
|
"y": 2.866268181798411
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
"linkedName": null
|
"linkedName": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 1.0502282453637657,
|
"x": 1.0,
|
||||||
"y": 2.7734807417974334
|
"y": 2.9
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 1.0547546338516156,
|
"x": 1.00452638848785,
|
||||||
"y": 2.523521721541598
|
"y": 2.6500409797441646
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 1.1796148359486442,
|
"x": 0.29978601997146925,
|
||||||
"y": 5.917574893009986
|
"y": 5.917574893009986
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 2.3570328102710407,
|
"x": 1.4772039942938657,
|
||||||
"y": 5.982268188302426
|
"y": 5.982268188302426
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
@@ -16,12 +16,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 2.4476034236804565,
|
"x": 1.8783024251069897,
|
||||||
"y": 4.85660485021398
|
"y": 5.154194008559203
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 2.382910128388017,
|
"x": 1.8136091298145502,
|
||||||
"y": 5.400028530670471
|
"y": 5.6976176890156935
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
],
|
],
|
||||||
"rotationTargets": [
|
"rotationTargets": [
|
||||||
{
|
{
|
||||||
"waypointRelativePos": 0.2179128348660559,
|
"waypointRelativePos": 0.3240938166311289,
|
||||||
"rotationDegrees": 180.0
|
"rotationDegrees": 180.0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 3.5473894436519258,
|
"x": 3.602,
|
||||||
"y": 4.015592011412268
|
"y": 4.015592011412268
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 2.494897544356074,
|
"x": 2.549508100704148,
|
||||||
"y": 4.011425161481168
|
"y": 4.011425161481168
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
@@ -16,12 +16,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 1.7359771754636228,
|
"x": 1.643730569948188,
|
||||||
"y": 4.015592011412268
|
"y": 4.015592011412268
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 2.627549770741877,
|
"x": 2.5679620034542325,
|
||||||
"y": 4.02839075681212
|
"y": 4.011502590673576
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"pointTowardsZones": [],
|
"pointTowardsZones": [],
|
||||||
"eventMarkers": [],
|
"eventMarkers": [],
|
||||||
"globalConstraints": {
|
"globalConstraints": {
|
||||||
"maxVelocity": 3.0,
|
"maxVelocity": 5.0,
|
||||||
"maxAcceleration": 3.0,
|
"maxAcceleration": 3.0,
|
||||||
"maxAngularVelocity": 540.0,
|
"maxAngularVelocity": 540.0,
|
||||||
"maxAngularAcceleration": 720.0,
|
"maxAngularAcceleration": 720.0,
|
||||||
@@ -50,5 +50,5 @@
|
|||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
"rotation": 0.0
|
"rotation": 0.0
|
||||||
},
|
},
|
||||||
"useDefaultConstraints": true
|
"useDefaultConstraints": false
|
||||||
}
|
}
|
||||||
54
src/main/deploy/pathplanner/paths/tirgrimpe1.path
Normal file
54
src/main/deploy/pathplanner/paths/tirgrimpe1.path
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"waypoints": [
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.5991440798858774,
|
||||||
|
"y": 2.3465049928673327
|
||||||
|
},
|
||||||
|
"prevControl": null,
|
||||||
|
"nextControl": {
|
||||||
|
"x": 2.589928673323822,
|
||||||
|
"y": 1.7513266761768898
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 1.8783024251069897,
|
||||||
|
"y": 2.3465049928673327
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 2.706376604850214,
|
||||||
|
"y": 1.7125106990014274
|
||||||
|
},
|
||||||
|
"nextControl": null,
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rotationTargets": [],
|
||||||
|
"constraintZones": [],
|
||||||
|
"pointTowardsZones": [],
|
||||||
|
"eventMarkers": [],
|
||||||
|
"globalConstraints": {
|
||||||
|
"maxVelocity": 3.0,
|
||||||
|
"maxAcceleration": 3.0,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
},
|
||||||
|
"goalEndState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": 33.11134196037204
|
||||||
|
},
|
||||||
|
"reversed": false,
|
||||||
|
"folder": null,
|
||||||
|
"idealStartingState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": 180.0
|
||||||
|
},
|
||||||
|
"useDefaultConstraints": true
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"robotWidth": 0.9,
|
"robotWidth": 0.83,
|
||||||
"robotLength": 0.9,
|
"robotLength": 0.87,
|
||||||
"holonomicMode": true,
|
"holonomicMode": true,
|
||||||
"pathFolders": [
|
"pathFolders": [
|
||||||
"Milieu"
|
"Milieu"
|
||||||
@@ -13,23 +13,23 @@
|
|||||||
"defaultMaxAngVel": 540.0,
|
"defaultMaxAngVel": 540.0,
|
||||||
"defaultMaxAngAccel": 720.0,
|
"defaultMaxAngAccel": 720.0,
|
||||||
"defaultNominalVoltage": 12.0,
|
"defaultNominalVoltage": 12.0,
|
||||||
"robotMass": 74.088,
|
"robotMass": 51.673,
|
||||||
"robotMOI": 6.883,
|
"robotMOI": 6.883,
|
||||||
"robotTrackwidth": 0.546,
|
"robotTrackwidth": 0.546,
|
||||||
"driveWheelRadius": 0.048,
|
"driveWheelRadius": 0.051,
|
||||||
"driveGearing": 5.143,
|
"driveGearing": 6.2,
|
||||||
"maxDriveSpeed": 5.45,
|
"maxDriveSpeed": 9.82,
|
||||||
"driveMotorType": "krakenX60",
|
"driveMotorType": "krakenX60",
|
||||||
"driveCurrentLimit": 60.0,
|
"driveCurrentLimit": 120.0,
|
||||||
"wheelCOF": 1.2,
|
"wheelCOF": 1.2,
|
||||||
"flModuleX": 0.273,
|
"flModuleX": 0.288925,
|
||||||
"flModuleY": 0.273,
|
"flModuleY": 0.269875,
|
||||||
"frModuleX": 0.273,
|
"frModuleX": 0.288925,
|
||||||
"frModuleY": -0.273,
|
"frModuleY": -0.27,
|
||||||
"blModuleX": -0.273,
|
"blModuleX": -0.288925,
|
||||||
"blModuleY": 0.273,
|
"blModuleY": 0.269875,
|
||||||
"brModuleX": -0.273,
|
"brModuleX": -0.288925,
|
||||||
"brModuleY": -0.273,
|
"brModuleY": -0.27,
|
||||||
"bumperOffsetX": 0.0,
|
"bumperOffsetX": 0.0,
|
||||||
"bumperOffsetY": 0.0,
|
"bumperOffsetY": 0.0,
|
||||||
"robotFeatures": []
|
"robotFeatures": []
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
package frc.robot;
|
package frc.robot;
|
||||||
|
|
||||||
|
import edu.wpi.first.math.util.Units;
|
||||||
import edu.wpi.first.wpilibj.TimedRobot;
|
import edu.wpi.first.wpilibj.TimedRobot;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.CommandScheduler;
|
import edu.wpi.first.wpilibj2.command.CommandScheduler;
|
||||||
@@ -20,6 +21,15 @@ public class Robot extends TimedRobot {
|
|||||||
@Override
|
@Override
|
||||||
public void robotPeriodic() {
|
public void robotPeriodic() {
|
||||||
CommandScheduler.getInstance().run();
|
CommandScheduler.getInstance().run();
|
||||||
|
var driveState = m_robotContainer.drivetrain.getState();
|
||||||
|
double headingDeg = driveState.Pose.getRotation().getDegrees();
|
||||||
|
double omegaRps = Units.radiansToRotations(driveState.Speeds.omegaRadiansPerSecond);
|
||||||
|
|
||||||
|
LimelightHelpers.SetRobotOrientation("limelight_tag", headingDeg, 0, 0, 0, 0, 0);
|
||||||
|
var llMeasurement = LimelightHelpers.getBotPoseEstimate_wpiBlue_MegaTag2("limelight_tag");
|
||||||
|
if (llMeasurement != null && llMeasurement.tagCount > 0 && Math.abs(omegaRps) < 2.0) {
|
||||||
|
m_robotContainer.drivetrain.addVisionMeasurement(llMeasurement.pose, llMeasurement.timestampSeconds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -14,33 +14,40 @@ import com.pathplanner.lib.auto.NamedCommands;
|
|||||||
import edu.wpi.first.cameraserver.CameraServer;
|
import edu.wpi.first.cameraserver.CameraServer;
|
||||||
import edu.wpi.first.math.MathUtil;
|
import edu.wpi.first.math.MathUtil;
|
||||||
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||||
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||||
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.button.CommandXboxController;
|
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||||
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
|
|
||||||
import frc.robot.commands.Aspirer;
|
import frc.robot.commands.Aspirer;
|
||||||
import frc.robot.commands.DescendreBalyeuse;
|
import frc.robot.commands.DescendreBalyeuse;
|
||||||
import frc.robot.commands.DescendreGrimpeur;
|
import frc.robot.commands.DescendreGrimpeur;
|
||||||
|
import frc.robot.commands.DescendreGrimpeurPlus;
|
||||||
|
import frc.robot.commands.Inverser;
|
||||||
import frc.robot.commands.Lancer;
|
import frc.robot.commands.Lancer;
|
||||||
|
import frc.robot.commands.LancerAspirer;
|
||||||
import frc.robot.commands.LancerBaseVitesse;
|
import frc.robot.commands.LancerBaseVitesse;
|
||||||
import frc.robot.commands.Limelighter;
|
import frc.robot.commands.Limelighter;
|
||||||
import frc.robot.commands.ModeOposer;
|
import frc.robot.commands.ModeOposer;
|
||||||
|
import frc.robot.commands.ModeOposerBalayeuse;
|
||||||
|
import frc.robot.commands.ModeOposerDemeleur;
|
||||||
import frc.robot.commands.MonterBalyeuse;
|
import frc.robot.commands.MonterBalyeuse;
|
||||||
import frc.robot.commands.MonterGrimpeur;
|
import frc.robot.commands.MonterGrimpeur;
|
||||||
import frc.robot.commands.ModeAuto.AspirerAuto;
|
import frc.robot.commands.ModeAuto.AspirerAuto;
|
||||||
|
import frc.robot.commands.ModeAuto.BougerDroiteAuto;
|
||||||
|
import frc.robot.commands.ModeAuto.BougerGaucheAuto;
|
||||||
import frc.robot.commands.ModeAuto.GrimperMur;
|
import frc.robot.commands.ModeAuto.GrimperMur;
|
||||||
import frc.robot.commands.ModeAuto.GrimperReservoir;
|
import frc.robot.commands.ModeAuto.GrimperReservoir;
|
||||||
import frc.robot.commands.ModeAuto.LancerAuto;
|
import frc.robot.commands.ModeAuto.LancerAuto;
|
||||||
|
import frc.robot.commands.ModeAuto.LimelighterAuto;
|
||||||
import frc.robot.commands.ModeAuto.RetourMilieuDroite;
|
import frc.robot.commands.ModeAuto.RetourMilieuDroite;
|
||||||
import frc.robot.commands.ModeAuto.RetourMilieuGauche;
|
import frc.robot.commands.ModeAuto.RetourMilieuGauche;
|
||||||
import frc.robot.commands.ModeAuto.TournerA180;
|
import frc.robot.commands.ModeAuto.TournerVersMur;
|
||||||
import frc.robot.commands.ModeAuto.TournerAZero;
|
import frc.robot.commands.ModeAuto.TournerVersReservoir;
|
||||||
import frc.robot.generated.TunerConstants;
|
import frc.robot.generated.TunerConstants;
|
||||||
import frc.robot.subsystems.Balayeuse;
|
import frc.robot.subsystems.Balayeuse;
|
||||||
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
import frc.robot.subsystems.Grimpeur;
|
import frc.robot.subsystems.Grimpeur;
|
||||||
|
//import frc.robot.subsystems.LEDSubsystem;
|
||||||
import frc.robot.subsystems.Lanceur;
|
import frc.robot.subsystems.Lanceur;
|
||||||
import frc.robot.subsystems.Led;
|
|
||||||
import frc.robot.subsystems.LimeLight3;
|
import frc.robot.subsystems.LimeLight3;
|
||||||
import frc.robot.subsystems.Limelight3G;
|
import frc.robot.subsystems.Limelight3G;
|
||||||
|
|
||||||
@@ -51,66 +58,85 @@ public class RobotContainer {
|
|||||||
Lanceur lanceur = new Lanceur();
|
Lanceur lanceur = new Lanceur();
|
||||||
LimeLight3 limeLight3 = new LimeLight3();
|
LimeLight3 limeLight3 = new LimeLight3();
|
||||||
Limelight3G limeLight3G = new Limelight3G();
|
Limelight3G limeLight3G = new Limelight3G();
|
||||||
Led led = new Led();
|
//LEDSubsystem ledSubsystem = new LEDSubsystem();
|
||||||
CommandXboxController manette = new CommandXboxController(0);
|
CommandXboxController manette = new CommandXboxController(0);
|
||||||
private double MaxSpeed = 1.0 * TunerConstants.kSpeedAt12Volts.in(MetersPerSecond); // kSpeedAt12Volts desired top speed
|
CommandXboxController manette1 = new CommandXboxController(1);
|
||||||
|
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
|
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 SwerveRequest.SwerveDriveBrake brake = new SwerveRequest.SwerveDriveBrake();
|
|
||||||
private final SwerveRequest.PointWheelsAt point = new SwerveRequest.PointWheelsAt();
|
|
||||||
|
|
||||||
private final Telemetry logger = new Telemetry(MaxSpeed);
|
|
||||||
|
|
||||||
public final CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
|
public final CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
|
||||||
|
|
||||||
|
|
||||||
public RobotContainer() {
|
public RobotContainer() {
|
||||||
autoChooser = AutoBuilder.buildAutoChooser();
|
NamedCommands.registerCommand("droite", new BougerDroiteAuto(drivetrain));
|
||||||
CameraServer.startAutomaticCapture();
|
NamedCommands.registerCommand("gauche", new BougerGaucheAuto(drivetrain));
|
||||||
configureBindings();
|
|
||||||
NamedCommands.registerCommand("GrimperMur", new GrimperMur(limeLight3,drivetrain));
|
NamedCommands.registerCommand("GrimperMur", new GrimperMur(limeLight3,drivetrain));
|
||||||
NamedCommands.registerCommand("GrimperReservoir", new GrimperReservoir(limeLight3G,drivetrain));
|
NamedCommands.registerCommand("GrimperReservoir", new GrimperReservoir(limeLight3G,drivetrain));
|
||||||
NamedCommands.registerCommand("Lancer", new LancerAuto(lanceur));
|
NamedCommands.registerCommand("Lancer", new LancerAuto(lanceur, limeLight3G));
|
||||||
NamedCommands.registerCommand("RetourMilieuDroite", new RetourMilieuDroite());
|
NamedCommands.registerCommand("RetourMilieuDroite", new RetourMilieuDroite(drivetrain,limeLight3G));
|
||||||
NamedCommands.registerCommand("RetourMilieuGauche", new RetourMilieuGauche());
|
NamedCommands.registerCommand("RetourMilieuGauche", new RetourMilieuGauche(drivetrain, limeLight3G));
|
||||||
NamedCommands.registerCommand("Limelighter", new Limelighter(limeLight3G,drivetrain));
|
NamedCommands.registerCommand("Limelighter", new LimelighterAuto(limeLight3G,drivetrain));
|
||||||
NamedCommands.registerCommand("DescendreBalayeuse", new DescendreBalyeuse(balayeuse));
|
NamedCommands.registerCommand("DescendreBalayeuse", new DescendreBalyeuse(balayeuse));
|
||||||
NamedCommands.registerCommand("Aspirer", new AspirerAuto(balayeuse));
|
NamedCommands.registerCommand("Aspirer", new AspirerAuto(balayeuse));
|
||||||
NamedCommands.registerCommand("TournerAZero", new TournerAZero(drivetrain));
|
NamedCommands.registerCommand("TournerA180", new TournerVersReservoir(drivetrain));
|
||||||
NamedCommands.registerCommand("TournerA180", new TournerA180(drivetrain));
|
NamedCommands.registerCommand("TournerAZero", new TournerVersMur(drivetrain));
|
||||||
NamedCommands.registerCommand("MonterGrimpeur", new MonterGrimpeur(grimpeur));
|
NamedCommands.registerCommand("MonterGrimpeur", new MonterGrimpeur(grimpeur));
|
||||||
NamedCommands.registerCommand("DescendreGrimpeur", new DescendreGrimpeur(grimpeur));
|
NamedCommands.registerCommand("DescendreGrimpeur", new DescendreGrimpeur(grimpeur));
|
||||||
|
autoChooser = AutoBuilder.buildAutoChooser();
|
||||||
|
SmartDashboard.putData("Auto Chooser", autoChooser);
|
||||||
|
|
||||||
|
CameraServer.startAutomaticCapture();
|
||||||
|
|
||||||
|
configureBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureBindings() {
|
private void configureBindings() {
|
||||||
|
//ledSubsystem.setDefaultCommand(ledSubsystem.updateLEDs());
|
||||||
drivetrain.setDefaultCommand(
|
drivetrain.setDefaultCommand(
|
||||||
drivetrain.applyRequest(() ->
|
drivetrain.applyRequest(() ->
|
||||||
drive.withVelocityY(MathUtil.applyDeadband(-manette.getLeftX()*Math.abs(-manette.getLeftX())*MaxSpeed, 0.05))
|
drive.withVelocityY(MathUtil.applyDeadband(-manette.getLeftX()*Math.abs(-manette.getLeftX())*MaxSpeed*0.7, 0.05))
|
||||||
.withVelocityX(MathUtil.applyDeadband(-manette.getLeftY()*Math.abs(-manette.getLeftY())*MaxSpeed, 0.05))
|
.withVelocityX(MathUtil.applyDeadband(-manette.getLeftY()*Math.abs(-manette.getLeftY())*MaxSpeed*0.7, 0.05))
|
||||||
.withRotationalRate(MathUtil.applyDeadband(-manette.getRightX()*Math.abs(-manette.getRightX())*MaxAngularRate, 0.05))
|
.withRotationalRate(MathUtil.applyDeadband(-manette.getRightX()*Math.abs(-manette.getRightX())*MaxAngularRate*1.5, 0.05))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
manette.y().whileTrue(drivetrain.sysIdQuasistatic(SysIdRoutine.Direction.kForward));
|
//manette 1
|
||||||
manette.a().whileTrue(drivetrain.sysIdQuasistatic(SysIdRoutine.Direction.kReverse));
|
// manette1.povUp().whileTrue(drivetrain.sysIdQuasistatic(SysIdRoutine.Direction.kForward));
|
||||||
manette.b().whileTrue(drivetrain.sysIdDynamic(SysIdRoutine.Direction.kForward));
|
// manette1.povDown().whileTrue(drivetrain.sysIdQuasistatic(SysIdRoutine.Direction.kReverse));
|
||||||
manette.x().whileTrue(drivetrain.sysIdDynamic(SysIdRoutine.Direction.kReverse));
|
// manette1.povRight().whileTrue(drivetrain.sysIdDynamic(SysIdRoutine.Direction.kForward));
|
||||||
|
// manette1.povLeft().whileTrue(drivetrain.sysIdDynamic(SysIdRoutine.Direction.kReverse));
|
||||||
|
|
||||||
manette.povUp().whileTrue(new LancerAuto(lanceur));
|
manette.povUp().whileTrue(new MonterGrimpeur(grimpeur));
|
||||||
manette.a().whileTrue(new Lancer(lanceur,limeLight3G,balayeuse,led));
|
manette.povDown().whileTrue(new DescendreGrimpeurPlus(grimpeur));
|
||||||
manette.y().whileTrue(new ModeOposer(lanceur, balayeuse));
|
manette.rightTrigger().whileTrue(new Lancer(lanceur, limeLight3G));
|
||||||
manette.x().whileTrue(new LancerBaseVitesse(lanceur, limeLight3, balayeuse, led));
|
manette.leftTrigger().whileTrue(new Limelighter(limeLight3G, drivetrain));
|
||||||
manette.rightTrigger().whileTrue(new MonterGrimpeur(grimpeur));
|
|
||||||
manette.leftTrigger().whileTrue(new DescendreGrimpeur(grimpeur));
|
|
||||||
manette.rightBumper().whileTrue(new MonterBalyeuse(balayeuse));
|
|
||||||
manette.leftBumper().whileTrue(new DescendreBalyeuse(balayeuse));
|
manette.leftBumper().whileTrue(new DescendreBalyeuse(balayeuse));
|
||||||
manette.b().whileTrue(new Aspirer(balayeuse,led));
|
manette.rightBumper().whileTrue(new Aspirer(balayeuse));
|
||||||
|
manette.b().whileTrue(new GrimperReservoir(limeLight3G, drivetrain));
|
||||||
|
manette.x().whileTrue(new GrimperMur(limeLight3, drivetrain));
|
||||||
|
|
||||||
|
|
||||||
|
//manette 2
|
||||||
|
manette1.rightTrigger().whileTrue(new Aspirer(balayeuse));
|
||||||
|
manette1.rightBumper().whileTrue(new MonterBalyeuse(balayeuse));
|
||||||
|
manette1.leftTrigger().whileTrue(new LancerBaseVitesse(lanceur));
|
||||||
|
manette1.leftBumper().whileTrue(new DescendreBalyeuse(balayeuse));
|
||||||
|
manette1.x().whileTrue(new LancerAspirer(lanceur, balayeuse, limeLight3G));
|
||||||
|
manette1.b().whileTrue(new ModeOposer(lanceur));
|
||||||
|
manette1.a().whileTrue(new ModeOposerDemeleur(lanceur));
|
||||||
|
manette1.y().whileTrue(new ModeOposerBalayeuse(balayeuse));
|
||||||
|
manette1.povRight().whileTrue(new BougerDroiteAuto(drivetrain));
|
||||||
|
manette1.povLeft().whileTrue(new BougerGaucheAuto(drivetrain));
|
||||||
|
manette1.povDown().whileTrue(new DescendreGrimpeur(grimpeur));
|
||||||
|
manette1.start().whileTrue(new Inverser(drivetrain));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command getAutonomousCommand() {
|
public Command getAutonomousCommand() {
|
||||||
return autoChooser.getSelected();
|
return autoChooser.getSelected();
|
||||||
|
// return getAutonomousCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,66 +4,36 @@
|
|||||||
|
|
||||||
package frc.robot.commands;
|
package frc.robot.commands;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj.Timer;
|
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.subsystems.Balayeuse;
|
import frc.robot.subsystems.Balayeuse;
|
||||||
import frc.robot.subsystems.Led;
|
|
||||||
|
|
||||||
/* 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 */
|
/* 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 Aspirer extends Command {
|
public class Aspirer extends Command {
|
||||||
private Balayeuse balayeuse;
|
private Balayeuse balayeuse;
|
||||||
private Timer timer;
|
|
||||||
private Led led;
|
|
||||||
private double temp;
|
|
||||||
/** Creates a new Aspirer. */
|
/** Creates a new Aspirer. */
|
||||||
public Aspirer(Balayeuse balayeuse, Led led) {
|
public Aspirer(Balayeuse balayeuse) {
|
||||||
this.balayeuse = balayeuse;
|
this.balayeuse = balayeuse;
|
||||||
this.led = led;
|
addRequirements(balayeuse);
|
||||||
this.timer = new Timer();
|
|
||||||
addRequirements(balayeuse, led);
|
|
||||||
this.temp = 0;
|
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
timer.reset();
|
|
||||||
temp = balayeuse.Amp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
timer.start();
|
balayeuse.BalayerEnbas(-0.5);
|
||||||
int nbFois = 0;
|
balayeuse.BalayerPadle(-0.2);
|
||||||
double moyenneAmp = 0;
|
|
||||||
if(timer.get() <3){
|
|
||||||
nbFois++;
|
|
||||||
moyenneAmp += balayeuse.Amp() / nbFois;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
nbFois++;
|
|
||||||
moyenneAmp -= temp;
|
|
||||||
moyenneAmp += balayeuse.Amp() / nbFois;
|
|
||||||
temp = balayeuse.Amp();
|
|
||||||
}
|
|
||||||
if(moyenneAmp < balayeuse.AmpMax()){
|
|
||||||
timer.reset();
|
|
||||||
balayeuse.Balayer(-0.5);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
balayeuse.Balayer(0);
|
|
||||||
led.Jaune2();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
balayeuse.Balayer(0);
|
balayeuse.BalayerEnbas(0);
|
||||||
timer.stop();
|
balayeuse.BalayerPadle(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class DescendreBalyeuse extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(Math.abs(balayeuse.Distance()) < balayeuse.EncodeurBalayeuse()){
|
if(Math.abs(balayeuse.Distance()) < balayeuse.EncodeurBalayeuse()){
|
||||||
balayeuse.Pivoter(-0.2);
|
balayeuse.Pivoter(-0.5);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
balayeuse.Pivoter(0);
|
balayeuse.Pivoter(0);
|
||||||
@@ -41,6 +41,6 @@ public class DescendreBalyeuse extends Command {
|
|||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return false;
|
return Math.abs(balayeuse.Distance()) > balayeuse.EncodeurBalayeuse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public class DescendreGrimpeur extends Command {
|
|||||||
/** Creates a new DescendreGrimpeur. */
|
/** Creates a new DescendreGrimpeur. */
|
||||||
public DescendreGrimpeur(Grimpeur grimpeur) {
|
public DescendreGrimpeur(Grimpeur grimpeur) {
|
||||||
this.grimpeur = grimpeur;
|
this.grimpeur = grimpeur;
|
||||||
|
addRequirements(grimpeur);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,18 +25,21 @@ public class DescendreGrimpeur extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(!grimpeur.Limit()){
|
if(!grimpeur.Limit()){
|
||||||
grimpeur.Grimper(-0.3);
|
grimpeur.GrimperGauche(-0.4);
|
||||||
|
grimpeur.GrimperDroit(-0.4);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
grimpeur.Reset();
|
grimpeur.Reset();
|
||||||
grimpeur.Grimper(0);
|
grimpeur.GrimperGauche(0);
|
||||||
|
grimpeur.GrimperDroit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
grimpeur.Grimper(0);
|
grimpeur.GrimperGauche(0);
|
||||||
|
grimpeur.GrimperDroit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
|||||||
50
src/main/java/frc/robot/commands/DescendreGrimpeurPlus.java
Normal file
50
src/main/java/frc/robot/commands/DescendreGrimpeurPlus.java
Normal 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;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.subsystems.Grimpeur;
|
||||||
|
|
||||||
|
/* 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 DescendreGrimpeurPlus extends Command {
|
||||||
|
private Grimpeur grimpeur;
|
||||||
|
/** Creates a new DescendreGrimpeur. */
|
||||||
|
public DescendreGrimpeurPlus(Grimpeur grimpeur) {
|
||||||
|
this.grimpeur = grimpeur;
|
||||||
|
addRequirements(grimpeur);
|
||||||
|
// 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(!grimpeur.Limit()){
|
||||||
|
grimpeur.GrimperGauche(-0.4);
|
||||||
|
grimpeur.GrimperDroit(-0.4);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
grimpeur.Reset();
|
||||||
|
grimpeur.GrimperGauche(0);
|
||||||
|
grimpeur.GrimperDroit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called once the command ends or is interrupted.
|
||||||
|
@Override
|
||||||
|
public void end(boolean interrupted) {
|
||||||
|
grimpeur.GrimperGauche(0);
|
||||||
|
grimpeur.GrimperDroit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true when the command should end.
|
||||||
|
@Override
|
||||||
|
public boolean isFinished() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
41
src/main/java/frc/robot/commands/Inverser.java
Normal file
41
src/main/java/frc/robot/commands/Inverser.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
// 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.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 Inverser extends Command {
|
||||||
|
CommandSwerveDrivetrain drivetrain;
|
||||||
|
boolean inverse = false;
|
||||||
|
/** Creates a new Inverser. */
|
||||||
|
public Inverser(CommandSwerveDrivetrain drivetrain) {
|
||||||
|
this.drivetrain = drivetrain;
|
||||||
|
addRequirements(drivetrain);
|
||||||
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the command is initially scheduled.
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
drivetrain.getPigeon2().setYaw(drivetrain.getPigeon2().getYaw().getValueAsDouble()+180);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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) {}
|
||||||
|
|
||||||
|
// Returns true when the command should end.
|
||||||
|
@Override
|
||||||
|
public boolean isFinished() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,12 +4,14 @@
|
|||||||
|
|
||||||
package frc.robot.commands;
|
package frc.robot.commands;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import edu.wpi.first.math.controller.PIDController;
|
import edu.wpi.first.math.controller.PIDController;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj.Timer;
|
import edu.wpi.first.wpilibj.Timer;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.subsystems.Balayeuse;
|
|
||||||
import frc.robot.subsystems.Lanceur;
|
import frc.robot.subsystems.Lanceur;
|
||||||
import frc.robot.subsystems.Led;
|
|
||||||
import frc.robot.subsystems.Limelight3G;
|
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 */
|
/* 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 */
|
||||||
@@ -18,74 +20,64 @@ public class Lancer extends Command {
|
|||||||
private PIDController pidController;
|
private PIDController pidController;
|
||||||
private Limelight3G limeLight3G;
|
private Limelight3G limeLight3G;
|
||||||
private Timer timer;
|
private Timer timer;
|
||||||
private Balayeuse balayeuse;
|
double vitesse = 0;
|
||||||
private Led led;
|
double botx = 0;
|
||||||
private double temp;
|
double boty = 0;
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
|
|
||||||
/** Creates a new Lancer. */
|
/** Creates a new Lancer. */
|
||||||
public Lancer(Lanceur lanceur, Limelight3G limeLight3G, Balayeuse balayeuse,Led led) {
|
public Lancer(Lanceur lanceur, Limelight3G limeLight3G) {
|
||||||
this.lanceur = lanceur;
|
this.lanceur = lanceur;
|
||||||
this.balayeuse = balayeuse;
|
|
||||||
this.led = led;
|
|
||||||
this.timer = new Timer();
|
this.timer = new Timer();
|
||||||
this.limeLight3G = new Limelight3G();
|
this.limeLight3G = limeLight3G;
|
||||||
addRequirements(lanceur, balayeuse, led, limeLight3G);
|
addRequirements(lanceur, limeLight3G);
|
||||||
this.temp = 0;
|
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
pidController = new PIDController(1, 0,0, 0);
|
if(limeLight3G.getV()){}
|
||||||
|
pidController = new PIDController(0.0007, 0,0, 0.001);
|
||||||
timer.reset();
|
timer.reset();
|
||||||
timer.start();
|
alliance = DriverStation.getAlliance();
|
||||||
temp = lanceur.Amp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
double botx = 0;
|
|
||||||
double boty = 0;
|
|
||||||
double[] BotPose = new double[6];
|
double[] BotPose = new double[6];
|
||||||
if(limeLight3G.getV()){
|
if(limeLight3G.getV()){
|
||||||
BotPose = limeLight3G.getBotPoseBlue();
|
if(!alliance.isPresent()){
|
||||||
botx = BotPose[0];
|
return;
|
||||||
boty = BotPose[1];
|
|
||||||
}
|
}
|
||||||
int nbFois = 0;
|
if(alliance.get() == Alliance.Blue){
|
||||||
|
BotPose = limeLight3G.getBotPoseBlue();
|
||||||
double moyenneAmp = 0;
|
|
||||||
if(timer.get() < 3){
|
|
||||||
nbFois++;
|
|
||||||
moyenneAmp += balayeuse.Amp() / nbFois;
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
nbFois++;
|
BotPose = limeLight3G.getBotPoseRed();
|
||||||
moyenneAmp -= temp;
|
|
||||||
moyenneAmp += balayeuse.Amp() / nbFois;
|
|
||||||
temp = balayeuse.Amp();
|
|
||||||
}
|
}
|
||||||
// if(moyenneAmp > lanceur.AmpBas() && nbFois > 10){
|
botx = BotPose[0];
|
||||||
timer.reset();
|
boty = BotPose[1];
|
||||||
balayeuse.Balayer(-0.5);
|
vitesse = 410.57 * ((Math.sqrt(Math.pow(Math.abs(4.625594-botx), 2) + Math.pow(Math.abs(4.034536-boty), 2)))) + 2250;
|
||||||
// led.Jaune2();
|
}
|
||||||
// }
|
// if(limeLight3G.getV()){
|
||||||
// else{
|
|
||||||
|
|
||||||
double vitesse = 0.5;
|
if(vitesse > 2000){
|
||||||
if(limeLight3G.getV()){
|
double output = pidController.calculate(lanceur.Vitesse(),vitesse);
|
||||||
//pythagore |
|
|
||||||
// \/
|
|
||||||
vitesse = Math.sqrt(Math.pow(Math.abs(4.625594-botx), 2) + Math.pow(Math.abs(4.034536-boty), 2));
|
|
||||||
}
|
|
||||||
double output = vitesse; /*pidController.calculate(lanceur.Vitesse(),vitesse);*/
|
|
||||||
lanceur.Lancer(output);
|
lanceur.Lancer(output);
|
||||||
if(lanceur.Vitesse() >= vitesse){
|
System.out.println(output);
|
||||||
lanceur.Demeler(0.5);
|
if(lanceur.Vitesse() >= vitesse-800){
|
||||||
|
timer.start();
|
||||||
|
if(timer.get() >1){
|
||||||
|
lanceur.Demeler(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
lanceur.Lancer(3500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@@ -93,7 +85,8 @@ public class Lancer extends Command {
|
|||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
lanceur.Demeler(0);
|
lanceur.Demeler(0);
|
||||||
lanceur.Lancer(0);
|
lanceur.Lancer(0);
|
||||||
balayeuse.Pivoter(0);
|
timer.reset();
|
||||||
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
|||||||
23
src/main/java/frc/robot/commands/LancerAspirer.java
Normal file
23
src/main/java/frc/robot/commands/LancerAspirer.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// 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.ParallelCommandGroup;
|
||||||
|
import frc.robot.subsystems.Balayeuse;
|
||||||
|
import frc.robot.subsystems.Lanceur;
|
||||||
|
import frc.robot.subsystems.Limelight3G;
|
||||||
|
|
||||||
|
|
||||||
|
// NOTE: Consider using this command inline, rather than writing a subclass. For more
|
||||||
|
// information, see:
|
||||||
|
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
|
||||||
|
public class LancerAspirer extends ParallelCommandGroup {
|
||||||
|
/** Creates a new LacerAspirer. */
|
||||||
|
public LancerAspirer(Lanceur lanceur, Balayeuse balayeuse, Limelight3G limeLight3G) {
|
||||||
|
addCommands(new Lancer(lanceur, limeLight3G), new Aspirer(balayeuse));
|
||||||
|
// Add your commands in the addCommands() call, e.g.
|
||||||
|
// addCommands(new FooCommand(), new BarCommand());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,73 +5,44 @@
|
|||||||
package frc.robot.commands;
|
package frc.robot.commands;
|
||||||
|
|
||||||
import edu.wpi.first.math.controller.PIDController;
|
import edu.wpi.first.math.controller.PIDController;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
import edu.wpi.first.wpilibj.Timer;
|
import edu.wpi.first.wpilibj.Timer;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.subsystems.Balayeuse;
|
|
||||||
import frc.robot.subsystems.Lanceur;
|
import frc.robot.subsystems.Lanceur;
|
||||||
import frc.robot.subsystems.Led;
|
|
||||||
import frc.robot.subsystems.LimeLight3;
|
|
||||||
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 */
|
/* 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 LancerBaseVitesse extends Command {
|
public class LancerBaseVitesse extends Command {
|
||||||
private Lanceur lanceur;
|
private Lanceur lanceur;
|
||||||
private PIDController pidController;
|
private PIDController pidController;
|
||||||
private Limelight3G limeLight3G;
|
|
||||||
private Timer timer;
|
private Timer timer;
|
||||||
private Balayeuse balayeuse;
|
double tempsDebut = 0;
|
||||||
private Led led;
|
|
||||||
private double temp;
|
|
||||||
/** Creates a new Lancer. */
|
/** Creates a new Lancer. */
|
||||||
public LancerBaseVitesse(Lanceur lanceur, LimeLight3 limeLight3, Balayeuse balayeuse,Led led) {
|
public LancerBaseVitesse(Lanceur lanceur) {
|
||||||
this.lanceur = lanceur;
|
this.lanceur = lanceur;
|
||||||
this.balayeuse = balayeuse;
|
|
||||||
this.led = led;
|
|
||||||
this.timer = new Timer();
|
this.timer = new Timer();
|
||||||
this.limeLight3G = new Limelight3G();
|
addRequirements(lanceur);
|
||||||
addRequirements(lanceur, balayeuse, led, limeLight3G);
|
//this.temp = 0;
|
||||||
this.temp = 0;
|
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
pidController = new PIDController(1, 0,0, 0);
|
pidController = new PIDController(0.0007, 0,0, 0.001);
|
||||||
timer.reset();
|
timer.reset();
|
||||||
timer.start();
|
timer.start();
|
||||||
temp = lanceur.Amp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
// int nbFois = 0;
|
System.out.println(DriverStation.getMatchTime());
|
||||||
|
double vitesse = lanceur.vitesseDemander();
|
||||||
// double moyenneAmp = 0;
|
|
||||||
// if(timer.get() < 3){
|
|
||||||
// nbFois++;
|
|
||||||
// moyenneAmp += balayeuse.Amp() / nbFois;
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// nbFois++;
|
|
||||||
// moyenneAmp -= temp;
|
|
||||||
// moyenneAmp += balayeuse.Amp() / nbFois;
|
|
||||||
// temp = balayeuse.Amp();
|
|
||||||
// }
|
|
||||||
// if(moyenneAmp > 30 && nbFois > 10){
|
|
||||||
// timer.reset();
|
|
||||||
// balayeuse.Balayer(0.5);
|
|
||||||
// led.Jaune2();
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
double vitesse = 0.4;
|
|
||||||
double output = pidController.calculate(lanceur.Vitesse(),vitesse);
|
double output = pidController.calculate(lanceur.Vitesse(),vitesse);
|
||||||
lanceur.Lancer(output);
|
lanceur.Lancer(output);
|
||||||
if(lanceur.Vitesse() >= vitesse){
|
if(timer.get() > 1){
|
||||||
lanceur.Demeler(0.5);
|
lanceur.Demeler(1);
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +51,8 @@ public class LancerBaseVitesse extends Command {
|
|||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
lanceur.Demeler(0);
|
lanceur.Demeler(0);
|
||||||
lanceur.Lancer(0);
|
lanceur.Lancer(0);
|
||||||
balayeuse.Pivoter(0);
|
timer.reset();
|
||||||
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
|||||||
@@ -7,16 +7,19 @@ package frc.robot.commands;
|
|||||||
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
import com.ctre.phoenix6.swerve.SwerveRequest;
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj.Timer;
|
import edu.wpi.first.math.MathUtil;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.generated.TunerConstants;
|
import frc.robot.generated.TunerConstants;
|
||||||
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
import frc.robot.subsystems.Limelight3G;
|
import frc.robot.subsystems.Limelight3G;
|
||||||
import static edu.wpi.first.units.Units.*;
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/* 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 */
|
/* 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 Limelighter extends Command {
|
public class Limelighter extends Command {
|
||||||
Timer timer;
|
|
||||||
Limelight3G limelight3g;
|
Limelight3G limelight3g;
|
||||||
CommandSwerveDrivetrain drivetrain;
|
CommandSwerveDrivetrain drivetrain;
|
||||||
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
@@ -24,9 +27,13 @@ public class Limelighter extends Command {
|
|||||||
double botx;
|
double botx;
|
||||||
double boty;
|
double boty;
|
||||||
double angle;
|
double angle;
|
||||||
|
double calcul;
|
||||||
|
double x;
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
|
|
||||||
/** Creates a new Limelighter. */
|
/** Creates a new Limelighter. */
|
||||||
public Limelighter(Limelight3G limelight3g, CommandSwerveDrivetrain drivetrain) {
|
public Limelighter(Limelight3G limelight3g, CommandSwerveDrivetrain drivetrain) {
|
||||||
this.limelight3g = limelight3g;
|
this.limelight3g = limelight3g;
|
||||||
@@ -37,35 +44,91 @@ public class Limelighter extends Command {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
double[] BotPose = new double[6];
|
double[] BotPose = new double[6];
|
||||||
|
if (limelight3g.getV()) {
|
||||||
BotPose = limelight3g.getBotPoseBlue();
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
|
if (!alliance.isPresent()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (alliance.get() == Alliance.Blue) {
|
||||||
|
x = 4.6;
|
||||||
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//x = 11.915394;
|
||||||
|
x = 4.6;
|
||||||
|
BotPose = limelight3g.getBotPoseRed();
|
||||||
|
}
|
||||||
botx = BotPose[0];
|
botx = BotPose[0];
|
||||||
boty = BotPose[1];
|
boty = BotPose[1];
|
||||||
angle = BotPose[5];
|
angle = BotPose[5];
|
||||||
drivetrain.setControl(drive.withRotationalRate(limelight3g.Calcule(4.625594, botx, 4.034536, boty, BotPose[5])/90));
|
calcul = Math.toRadians(limelight3g.Calcule(boty, 4,botx, x, angle));
|
||||||
if(limelight3g.Calcule(4.625594, botx, 4.034536, boty, angle)/90 < 0.1){
|
System.out.println(calcul);
|
||||||
timer.start();
|
//drivetrain.setControl(drive.withRotationalRate(MathUtil.clamp(calcul, -3, 3)));
|
||||||
|
if(calcul > -5 && calcul < 5){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(0));
|
||||||
|
}
|
||||||
|
else if(calcul > 5){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(2));
|
||||||
|
}
|
||||||
|
else if(calcul < -5){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-2));
|
||||||
|
}
|
||||||
|
botx = BotPose[1];
|
||||||
|
boty = BotPose[0];
|
||||||
|
angle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
|
||||||
|
calcul = limelight3g.Calcule(botx, x, boty, 4, angle);
|
||||||
|
if(calcul < -5 && calcul > -180){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(0.5*(2*Math.PI)));
|
||||||
|
}
|
||||||
|
else if(calcul > 5 && calcul < 180){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(-0.5*(2*Math.PI)));
|
||||||
|
}
|
||||||
|
else if(calcul < -5){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(-0.5*(2*Math.PI)));
|
||||||
|
}
|
||||||
|
else if(calcul <= -180){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(0.5*(2*Math.PI)));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
timer.reset();
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(0));
|
||||||
|
}
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withVelocityX(0).withVelocityY(0).withRotationalRate(calcul));
|
||||||
|
System.out.println(angle);
|
||||||
|
if (calcul < 0.2 && calcul > -0.2) {
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
drivetrain.setControl(drive.withRotationalRate(0));
|
drivetrain.setControl(drive.withRotationalRate(0));
|
||||||
timer.stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return timer.get() > 1;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,15 @@ public class AspirerAuto extends Command {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
balayeuse.Balayer(0.5);
|
balayeuse.BalayerEnbas(-0.5);
|
||||||
|
balayeuse.BalayerPadle(-0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
balayeuse.Balayer(0);
|
balayeuse.BalayerEnbas(0);
|
||||||
|
balayeuse.BalayerPadle(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
|||||||
@@ -4,26 +4,32 @@
|
|||||||
|
|
||||||
package frc.robot.commands.ModeAuto;
|
package frc.robot.commands.ModeAuto;
|
||||||
|
|
||||||
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
import com.ctre.phoenix6.hardware.Pigeon2;
|
|
||||||
import com.ctre.phoenix6.swerve.SwerveRequest;
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.Timer;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.generated.TunerConstants;
|
import frc.robot.generated.TunerConstants;
|
||||||
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
import static edu.wpi.first.units.Units.*;
|
|
||||||
|
|
||||||
/* 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 */
|
/* 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 TournerA180 extends Command {
|
public class BougerDroiteAuto extends Command {
|
||||||
CommandSwerveDrivetrain drivetrain;
|
CommandSwerveDrivetrain drivetrain;
|
||||||
|
Timer timer = new Timer();
|
||||||
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
Pigeon2 pigeon2;
|
Optional<Alliance> alliance;
|
||||||
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
/** Creates a new TournerAZero. */
|
/** Creates a new AvanceAuto. */
|
||||||
public TournerA180(CommandSwerveDrivetrain drivetrain) {
|
public BougerDroiteAuto(CommandSwerveDrivetrain drivetrain) {
|
||||||
this.drivetrain = drivetrain;
|
this.drivetrain = drivetrain;
|
||||||
addRequirements(drivetrain);
|
addRequirements(drivetrain);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
@@ -31,26 +37,33 @@ public class TournerA180 extends Command {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
timer.reset();
|
||||||
|
timer.start();
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(pigeon2.getYaw().getValueAsDouble() >0 && pigeon2.getYaw().getValueAsDouble() <180){
|
if(timer.get() < 1.25){
|
||||||
drivetrain.setControl(drive.withRotationalRate(-0.5));
|
drivetrain.setControl(drive.withVelocityY(-1.5));
|
||||||
}
|
}
|
||||||
else if(pigeon2.getYaw().getValueAsDouble() >180){
|
else{
|
||||||
drivetrain.setControl(drive.withRotationalRate(0.5));
|
drivetrain.setControl(drive.withVelocityY(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {}
|
public void end(boolean interrupted) {
|
||||||
|
drivetrain.setControl(drive.withVelocityY(0));
|
||||||
|
timer.stop();
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return pigeon2.getYaw().getValueAsDouble() > 165 && pigeon2.getYaw().getValueAsDouble() < 195;
|
return timer.get() > 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,26 +4,32 @@
|
|||||||
|
|
||||||
package frc.robot.commands.ModeAuto;
|
package frc.robot.commands.ModeAuto;
|
||||||
|
|
||||||
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
import com.ctre.phoenix6.hardware.Pigeon2;
|
|
||||||
import com.ctre.phoenix6.swerve.SwerveRequest;
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.Timer;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.generated.TunerConstants;
|
import frc.robot.generated.TunerConstants;
|
||||||
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
import static edu.wpi.first.units.Units.*;
|
|
||||||
|
|
||||||
/* 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 */
|
/* 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 TournerAZero extends Command {
|
public class BougerGaucheAuto extends Command {
|
||||||
CommandSwerveDrivetrain drivetrain;
|
CommandSwerveDrivetrain drivetrain;
|
||||||
|
Timer timer = new Timer();
|
||||||
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
Pigeon2 pigeon2;
|
Optional<Alliance> alliance;
|
||||||
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
/** Creates a new TournerAZero. */
|
/** Creates a new AvanceAuto. */
|
||||||
public TournerAZero(CommandSwerveDrivetrain drivetrain) {
|
public BougerGaucheAuto(CommandSwerveDrivetrain drivetrain) {
|
||||||
this.drivetrain = drivetrain;
|
this.drivetrain = drivetrain;
|
||||||
addRequirements(drivetrain);
|
addRequirements(drivetrain);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
@@ -31,26 +37,33 @@ public class TournerAZero extends Command {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
timer.reset();
|
||||||
|
timer.start();
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(pigeon2.getYaw().getValueAsDouble() >0 && pigeon2.getYaw().getValueAsDouble() <180){
|
if(timer.get() < 1.25){
|
||||||
drivetrain.setControl(drive.withRotationalRate(0.5));
|
drivetrain.setControl(drive.withVelocityY(1.5));
|
||||||
}
|
}
|
||||||
else if(pigeon2.getYaw().getValueAsDouble() >180){
|
else{
|
||||||
drivetrain.setControl(drive.withRotationalRate(-0.5));
|
drivetrain.setControl(drive.withVelocityY(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {}
|
public void end(boolean interrupted) {
|
||||||
|
drivetrain.setControl(drive.withVelocityY(0));
|
||||||
|
timer.stop();
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return pigeon2.getYaw().getValueAsDouble() > 345 || pigeon2.getYaw().getValueAsDouble() < 15;
|
return timer.get() > 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,14 +8,20 @@ import static edu.wpi.first.units.Units.MetersPerSecond;
|
|||||||
import static edu.wpi.first.units.Units.RadiansPerSecond;
|
import static edu.wpi.first.units.Units.RadiansPerSecond;
|
||||||
import static edu.wpi.first.units.Units.RotationsPerSecond;
|
import static edu.wpi.first.units.Units.RotationsPerSecond;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import com.ctre.phoenix6.hardware.Pigeon2;
|
import com.ctre.phoenix6.hardware.Pigeon2;
|
||||||
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
import com.ctre.phoenix6.swerve.SwerveRequest;
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.math.MathUtil;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.generated.TunerConstants;
|
import frc.robot.generated.TunerConstants;
|
||||||
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
import frc.robot.subsystems.LimeLight3;
|
import frc.robot.subsystems.LimeLight3;
|
||||||
|
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 */
|
/* 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 GrimperMur extends Command {
|
public class GrimperMur extends Command {
|
||||||
@@ -24,9 +30,13 @@ public class GrimperMur extends Command {
|
|||||||
double[] BotPose = new double[6];
|
double[] BotPose = new double[6];
|
||||||
double botx;
|
double botx;
|
||||||
double boty;
|
double boty;
|
||||||
|
double x;
|
||||||
|
double y;
|
||||||
|
double angle;
|
||||||
|
double pigeonAngle;
|
||||||
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
Pigeon2 pigeon2;
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
@@ -40,19 +50,64 @@ public class GrimperMur extends Command {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
// if(drivetrain.Equipe()){
|
||||||
|
// angle+=180;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if(limeLight3.getV()){
|
||||||
BotPose = limeLight3.getBotPoseBlue();
|
BotPose = limeLight3.getBotPoseBlue();
|
||||||
botx = BotPose[0];
|
botx = BotPose[0];
|
||||||
boty = BotPose[1];
|
boty = BotPose[1];
|
||||||
if(180-pigeon2.getYaw().getValueAsDouble() < 10 && 180- pigeon2.getYaw().getValueAsDouble() > -10){
|
if(angle < 0){
|
||||||
drivetrain.setControl(drive.withVelocityX(2.961328-boty).withVelocityY(1.11-botx));
|
angle = angle + 360;
|
||||||
|
}
|
||||||
|
if(alliance.get() == Alliance.Red){
|
||||||
|
pigeonAngle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
|
||||||
|
System.out.println(pigeonAngle);
|
||||||
|
y = 3.6;
|
||||||
|
x = 15;
|
||||||
|
angle = 180;
|
||||||
|
if(pigeonAngle> 358 || pigeonAngle< 2){
|
||||||
|
drivetrain.setControl(drive.withVelocityY(MathUtil.clamp((-(y-boty)*10), -2, 2)).withVelocityX(MathUtil.clamp((-(x-botx)*10),-2,2)).withRotationalRate(0));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
drivetrain.setControl(drive.withRotationalRate(180-pigeon2.getYaw().getValueAsDouble()/45));
|
if(pigeonAngle>180){
|
||||||
|
drivetrain.setControl(drive.withVelocityY(0).withVelocityX(0).withRotationalRate(1));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withVelocityY(0).withVelocityX(0).withRotationalRate(-1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
pigeonAngle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
|
||||||
|
System.out.println(pigeonAngle);
|
||||||
|
y = 4.4;
|
||||||
|
x = 1.6;
|
||||||
|
angle = 0;
|
||||||
|
if(pigeonAngle> 182 || pigeonAngle< 178){
|
||||||
|
drivetrain.setControl(drive.withVelocityY(MathUtil.clamp(((y-boty)*10), -2, 2)).withVelocityX(MathUtil.clamp(((x-botx)*10),-2,2)).withRotationalRate(0));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(pigeonAngle>0 && pigeonAngle<180){
|
||||||
|
drivetrain.setControl(drive.withVelocityY(0).withVelocityX(0).withRotationalRate(-1));
|
||||||
|
System.out.println("x");
|
||||||
|
}
|
||||||
|
else if(pigeonAngle>180){
|
||||||
|
System.out.println("e");
|
||||||
|
drivetrain.setControl(drive.withVelocityY(0).withVelocityX(0).withRotationalRate(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withVelocityX(0).withVelocityY(0).withRotationalRate(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +120,6 @@ public class GrimperMur extends Command {
|
|||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return (2.961328-boty < 0.05 || 2.961328-boty >-0.05) && (1.11-botx < 0.05 || 1.11-botx > -0.05);
|
return (y-boty < 0.2 && y-boty >-0.2) && (x-botx < 0.06 && x-botx > -0.06);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,10 +8,15 @@ import static edu.wpi.first.units.Units.MetersPerSecond;
|
|||||||
import static edu.wpi.first.units.Units.RadiansPerSecond;
|
import static edu.wpi.first.units.Units.RadiansPerSecond;
|
||||||
import static edu.wpi.first.units.Units.RotationsPerSecond;
|
import static edu.wpi.first.units.Units.RotationsPerSecond;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import com.ctre.phoenix6.hardware.Pigeon2;
|
import com.ctre.phoenix6.hardware.Pigeon2;
|
||||||
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
import com.ctre.phoenix6.swerve.SwerveRequest;
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.math.MathUtil;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.generated.TunerConstants;
|
import frc.robot.generated.TunerConstants;
|
||||||
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
@@ -24,9 +29,13 @@ public class GrimperReservoir extends Command {
|
|||||||
double[] BotPose = new double[6];
|
double[] BotPose = new double[6];
|
||||||
double botx;
|
double botx;
|
||||||
double boty;
|
double boty;
|
||||||
|
double x;
|
||||||
|
double y;
|
||||||
|
double angle;
|
||||||
|
double pigeonAngle;
|
||||||
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
Pigeon2 pigeon2;
|
Optional<Alliance> alliance;
|
||||||
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
@@ -40,19 +49,64 @@ public class GrimperReservoir extends Command {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
// if(drivetrain.Equipe()){
|
||||||
|
// drivetrain.getPigeon2().setYaw(drivetrain.getPigeon2().getYaw().getValueAsDouble()+180);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if(limeLight3G.getV()){
|
||||||
BotPose = limeLight3G.getBotPoseBlue();
|
BotPose = limeLight3G.getBotPoseBlue();
|
||||||
botx = BotPose[0];
|
botx = BotPose[0];
|
||||||
boty = BotPose[1];
|
boty = BotPose[1];
|
||||||
if(0-pigeon2.getYaw().getValueAsDouble() < 10 && 0- pigeon2.getYaw().getValueAsDouble() > -10){
|
if(angle < 0){
|
||||||
drivetrain.setControl(drive.withVelocityX(5.081328-boty).withVelocityY(1.11-botx));
|
angle = angle + 360;
|
||||||
|
}
|
||||||
|
if(alliance.get() == Alliance.Red){
|
||||||
|
pigeonAngle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
|
||||||
|
System.out.println(pigeonAngle);
|
||||||
|
y = 5.2;
|
||||||
|
x = 15.6;
|
||||||
|
angle = 180;
|
||||||
|
if(pigeonAngle< 190 && pigeonAngle> 170){
|
||||||
|
drivetrain.setControl(drive.withVelocityY(MathUtil.clamp((-(y-boty)*10), -2, 2)).withVelocityX(MathUtil.clamp((-(x-botx)*10),-2,2)));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
drivetrain.setControl(drive.withRotationalRate(0-pigeon2.getYaw().getValueAsDouble()/45));
|
if(pigeonAngle>180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-1));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
pigeonAngle = drivetrain.getPigeon2().getYaw().getValueAsDouble()+180;
|
||||||
|
System.out.println(pigeonAngle);
|
||||||
|
y = 2.6;
|
||||||
|
x = 1.11;
|
||||||
|
angle = 0;
|
||||||
|
if(pigeonAngle> 358 || pigeonAngle< 2){
|
||||||
|
drivetrain.setControl(drive.withVelocityY(MathUtil.clamp(((y-boty)*10), -2, 2)).withVelocityX(MathUtil.clamp(((x-botx)*10),-2,2)).withRotationalRate(0));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(pigeonAngle>0 && pigeonAngle<180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-1));
|
||||||
|
System.out.println("x");
|
||||||
|
}
|
||||||
|
else if(pigeonAngle>180){
|
||||||
|
System.out.println("e");
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withVelocityX(0).withVelocityY(0).withRotationalRate(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +119,6 @@ public class GrimperReservoir extends Command {
|
|||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return 5.081328-boty < 0.05 || 5.081328-boty >-0.05 && 1.11-botx < 0.05 || 1.11-botx > -0.05;
|
return (y-boty < 0.2 && y-boty >-0.2) && (x-botx < 0.06 && x-botx > -0.06);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,33 +4,74 @@
|
|||||||
|
|
||||||
package frc.robot.commands.ModeAuto;
|
package frc.robot.commands.ModeAuto;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import edu.wpi.first.math.controller.PIDController;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj.Timer;
|
import edu.wpi.first.wpilibj.Timer;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.subsystems.Lanceur;
|
import frc.robot.subsystems.Lanceur;
|
||||||
|
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 */
|
/* 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 LancerAuto extends Command {
|
public class LancerAuto extends Command {
|
||||||
Lanceur lanceur;
|
Lanceur lanceur;
|
||||||
Timer timer;
|
Timer timer;
|
||||||
|
private PIDController pidController;
|
||||||
|
Limelight3G limelight3g;
|
||||||
|
double botx = 0;
|
||||||
|
double boty = 0;
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
|
|
||||||
/** Creates a new LancerAuto. */
|
/** Creates a new LancerAuto. */
|
||||||
public LancerAuto(Lanceur lanceur) {
|
public LancerAuto(Lanceur lanceur, Limelight3G limelight3g) {
|
||||||
this.lanceur = lanceur;
|
this.lanceur = lanceur;
|
||||||
addRequirements(lanceur);
|
timer = new Timer();
|
||||||
|
this.limelight3g = limelight3g;
|
||||||
|
addRequirements(lanceur, limelight3g);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
timer.start();
|
pidController = new PIDController(0.0007, 0, 0, 0.001);
|
||||||
|
timer.reset();
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
lanceur.Lancer(0.5);
|
double[] BotPose = new double[6];
|
||||||
|
if (limelight3g.getV()) {
|
||||||
|
if (!alliance.isPresent()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (alliance.get() == Alliance.Blue) {
|
||||||
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
|
} else {
|
||||||
|
BotPose = limelight3g.getBotPoseRed();
|
||||||
|
}
|
||||||
|
|
||||||
|
botx = BotPose[0];
|
||||||
|
boty = BotPose[1];
|
||||||
|
}
|
||||||
|
double vitesse = 0.5;
|
||||||
|
if (limelight3g.getV()) {
|
||||||
|
vitesse = 410.57 * ((Math.sqrt(Math.pow(Math.abs(4.625594 - botx), 2) + Math.pow(Math.abs(4.034536 - boty), 2))))
|
||||||
|
+ 2250;
|
||||||
|
System.out.println("lancer");
|
||||||
|
|
||||||
|
double output = pidController.calculate(lanceur.Vitesse(), vitesse);
|
||||||
|
lanceur.Lancer(output);
|
||||||
|
if (lanceur.Vitesse() >= vitesse - 800) {
|
||||||
|
timer.start();
|
||||||
if (timer.get() > 1) {
|
if (timer.get() > 1) {
|
||||||
lanceur.Demeler(0.5);
|
lanceur.Demeler(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,6 +87,7 @@ public class LancerAuto extends Command {
|
|||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return timer.get() > 3;
|
return timer.get() > 4;
|
||||||
|
// return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
133
src/main/java/frc/robot/commands/ModeAuto/LimelighterAuto.java
Normal file
133
src/main/java/frc/robot/commands/ModeAuto/LimelighterAuto.java
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
// 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.ModeAuto;
|
||||||
|
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.generated.TunerConstants;
|
||||||
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
|
import frc.robot.subsystems.Limelight3G;
|
||||||
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/* 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 LimelighterAuto extends Command {
|
||||||
|
Limelight3G limelight3g;
|
||||||
|
CommandSwerveDrivetrain drivetrain;
|
||||||
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
|
double botx;
|
||||||
|
double boty;
|
||||||
|
double angle;
|
||||||
|
double calcul;
|
||||||
|
double x;
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
|
|
||||||
|
/** Creates a new Limelighter. */
|
||||||
|
public LimelighterAuto(Limelight3G limelight3g, CommandSwerveDrivetrain drivetrain) {
|
||||||
|
this.limelight3g = limelight3g;
|
||||||
|
this.drivetrain = drivetrain;
|
||||||
|
addRequirements(drivetrain, limelight3g);
|
||||||
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the command is initially scheduled.
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
double[] BotPose = new double[6];
|
||||||
|
System.out.println("e");
|
||||||
|
if (limelight3g.getV()) {
|
||||||
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
|
if (!alliance.isPresent()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (alliance.get() == Alliance.Blue) {
|
||||||
|
x = 4.6;
|
||||||
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// x = 11.915394;
|
||||||
|
x = 4.6;
|
||||||
|
BotPose = limelight3g.getBotPoseRed();
|
||||||
|
}
|
||||||
|
botx = BotPose[0];
|
||||||
|
boty = BotPose[1];
|
||||||
|
angle = BotPose[5];
|
||||||
|
calcul = limelight3g.Calcule(botx, x, boty, 4, angle);
|
||||||
|
if(calcul > -5 && calcul < 5){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(0));
|
||||||
|
}
|
||||||
|
else if(calcul > 5){
|
||||||
|
drivetrain.setControl(
|
||||||
|
drive.withRotationalRate(2));
|
||||||
|
}
|
||||||
|
else if(calcul < -5){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-2));
|
||||||
|
}
|
||||||
|
// botx = BotPose[1];
|
||||||
|
// boty = BotPose[0];
|
||||||
|
// angle = drivetrain.getPigeon2().getYaw().getValueAsDouble();
|
||||||
|
// calcul = limelight3g.Calcule(botx, x, boty, 4, angle);
|
||||||
|
// if(calcul < -5 && calcul > -180){
|
||||||
|
// drivetrain.setControl(
|
||||||
|
// drive.withRotationalRate(0.5*(2*Math.PI)));
|
||||||
|
// }
|
||||||
|
// else if(calcul > 5 && calcul < 180){
|
||||||
|
// drivetrain.setControl(
|
||||||
|
// drive.withRotationalRate(-0.5*(2*Math.PI)));
|
||||||
|
// }
|
||||||
|
// else if(calcul < -5){
|
||||||
|
// drivetrain.setControl(
|
||||||
|
// drive.withRotationalRate(-0.5*(2*Math.PI)));
|
||||||
|
// }
|
||||||
|
// else if(calcul <= -180){
|
||||||
|
// drivetrain.setControl(
|
||||||
|
// drive.withRotationalRate(0.5*(2*Math.PI)));
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// drivetrain.setControl(
|
||||||
|
// drive.withRotationalRate(0));
|
||||||
|
// }
|
||||||
|
// drivetrain.setControl(
|
||||||
|
// drive.withVelocityX(0).withVelocityY(0).withRotationalRate(calcul));
|
||||||
|
// System.out.println(angle);
|
||||||
|
// if (calcul < 0.2 && calcul > -0.2) {
|
||||||
|
// drivetrain.setControl(drive.withRotationalRate(0));
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Called once the command ends or is interrupted.
|
||||||
|
@Override
|
||||||
|
public void end(boolean interrupted) {
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true when the command should end.
|
||||||
|
@Override
|
||||||
|
public boolean isFinished() {
|
||||||
|
return calcul > -5 && calcul < 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -4,12 +4,41 @@
|
|||||||
|
|
||||||
package frc.robot.commands.ModeAuto;
|
package frc.robot.commands.ModeAuto;
|
||||||
|
|
||||||
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import com.ctre.phoenix6.hardware.Pigeon2;
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.generated.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 */
|
/* 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 RetourMilieuDroite extends Command {
|
public class RetourMilieuDroite extends Command {
|
||||||
|
CommandSwerveDrivetrain drivetrain;
|
||||||
|
Limelight3G limelight3g;
|
||||||
|
double botx;
|
||||||
|
double boty;
|
||||||
|
double x;
|
||||||
|
double y;
|
||||||
|
double angle;
|
||||||
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
/** Creates a new RetourMilieu. */
|
/** Creates a new RetourMilieu. */
|
||||||
public RetourMilieuDroite() {
|
public RetourMilieuDroite(CommandSwerveDrivetrain drivetrain, Limelight3G limelight3g) {
|
||||||
|
this.drivetrain = drivetrain;
|
||||||
|
this.limelight3g = limelight3g;
|
||||||
|
addRequirements(drivetrain, limelight3g);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,15 +48,63 @@ public class RetourMilieuDroite extends Command {
|
|||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {}
|
public void execute() {
|
||||||
|
if(angle < 0){
|
||||||
|
angle = angle + 360;
|
||||||
|
}
|
||||||
|
if(alliance.get() == Alliance.Blue){
|
||||||
|
y = 0.639;
|
||||||
|
x = 2.305;
|
||||||
|
angle = 0;
|
||||||
|
if(limelight3g.getV()){
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >355 || drivetrain.getPigeon2().getYaw().getValueAsDouble() < 5){
|
||||||
|
if((y-boty < 0.05 && y-boty >-0.05) && (x-botx < 0.05 && x-botx > -0.05)){
|
||||||
|
drivetrain.setControl(drive.withVelocityX(0).withVelocityY(0));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(botx < 6){
|
||||||
|
drivetrain.setControl(drive.withVelocityX(y-boty));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withVelocityX(y-boty).withVelocityY(x-botx));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >angle && drivetrain.getPigeon2().getYaw().getValueAsDouble() <angle +180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0.5));
|
||||||
|
}
|
||||||
|
else if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >=angle +180){
|
||||||
|
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-0.5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
y = 7.380;
|
||||||
|
x = 13.963;
|
||||||
|
angle = 180;
|
||||||
|
if(limelight3g.getV()){
|
||||||
|
}
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >0 && drivetrain.getPigeon2().getYaw().getValueAsDouble() <180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0.5));
|
||||||
|
}
|
||||||
|
else if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-0.5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {}
|
public void end(boolean interrupted) {
|
||||||
|
drivetrain.setControl(drive.withVelocityX(0).withVelocityY(0));
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return false;
|
return (y-boty < 0.05 && y-boty >-0.05) && (x-botx < 0.05 && x-botx > -0.05);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,41 @@
|
|||||||
|
|
||||||
package frc.robot.commands.ModeAuto;
|
package frc.robot.commands.ModeAuto;
|
||||||
|
|
||||||
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import com.ctre.phoenix6.hardware.Pigeon2;
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.generated.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 */
|
/* 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 RetourMilieuGauche extends Command {
|
public class RetourMilieuGauche extends Command {
|
||||||
/** Creates a new RetourMilieuGauche. */
|
CommandSwerveDrivetrain drivetrain;
|
||||||
public RetourMilieuGauche() {
|
Limelight3G limelight3g;
|
||||||
|
double botx;
|
||||||
|
double boty;
|
||||||
|
double x;
|
||||||
|
double y;
|
||||||
|
double angle;
|
||||||
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
|
/** Creates a new RetourMilieu. */
|
||||||
|
public RetourMilieuGauche(CommandSwerveDrivetrain drivetrain, Limelight3G limelight3g) {
|
||||||
|
this.drivetrain = drivetrain;
|
||||||
|
this.limelight3g = limelight3g;
|
||||||
|
addRequirements(drivetrain, limelight3g);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,15 +48,85 @@ public class RetourMilieuGauche extends Command {
|
|||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {}
|
public void execute() {
|
||||||
|
if(angle < 0){
|
||||||
|
angle = angle + 360;
|
||||||
|
}
|
||||||
|
double[] BotPose = new double[6];
|
||||||
|
BotPose = limelight3g.getBotPoseBlue();
|
||||||
|
botx = BotPose[0];
|
||||||
|
boty = BotPose[1];
|
||||||
|
|
||||||
|
if(alliance.get() == Alliance.Blue){
|
||||||
|
y = 7.380;
|
||||||
|
x = 2.305;
|
||||||
|
angle = 0;
|
||||||
|
if(limelight3g.getV()){
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >355 || drivetrain.getPigeon2().getYaw().getValueAsDouble() < 5){
|
||||||
|
if((y-boty < 0.05 && y-boty >-0.05) && (x-botx < 0.05 && x-botx > -0.05)){
|
||||||
|
drivetrain.setControl(drive.withVelocityX(0).withVelocityY(0));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(botx < 6){
|
||||||
|
drivetrain.setControl(drive.withVelocityX(y-boty));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withVelocityX(y-boty).withVelocityY(x-botx));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >angle && drivetrain.getPigeon2().getYaw().getValueAsDouble() <angle +180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0.5));
|
||||||
|
}
|
||||||
|
else if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >=angle +180){
|
||||||
|
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-0.5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
y = 0.639;
|
||||||
|
x = 13.963;
|
||||||
|
angle = 180;
|
||||||
|
if(limelight3g.getV()){
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >175 && drivetrain.getPigeon2().getYaw().getValueAsDouble() < 185){
|
||||||
|
if((y-boty < 0.05 && y-boty >-0.05) && (x-botx < 0.05 && x-botx > -0.05)){
|
||||||
|
drivetrain.setControl(drive.withVelocityX(0).withVelocityY(0));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(botx > 10){
|
||||||
|
drivetrain.setControl(drive.withVelocityX(y-boty));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
drivetrain.setControl(drive.withVelocityX(y-boty).withVelocityY(x-botx));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >0 && drivetrain.getPigeon2().getYaw().getValueAsDouble() <180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-0.5));
|
||||||
|
}
|
||||||
|
else if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >=180){
|
||||||
|
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0.5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {}
|
public void end(boolean interrupted) {
|
||||||
|
drivetrain.setControl(drive.withVelocityX(0).withVelocityY(0));
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return false;
|
return (y-boty < 0.05 && y-boty >-0.05) && (x-botx < 0.05 && x-botx > -0.05);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
// 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.ModeAuto;
|
||||||
|
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
|
import com.ctre.phoenix6.hardware.Pigeon2;
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.generated.TunerConstants;
|
||||||
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/* 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 TournerVersMur extends Command {
|
||||||
|
CommandSwerveDrivetrain drivetrain;
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
|
double force;
|
||||||
|
double angle;
|
||||||
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
|
/** Creates a new TournerAZero. */
|
||||||
|
public TournerVersMur(CommandSwerveDrivetrain drivetrain) {
|
||||||
|
this.drivetrain = drivetrain;
|
||||||
|
addRequirements(drivetrain);
|
||||||
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the command is initially scheduled.
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
if(alliance.get() == Alliance.Blue){
|
||||||
|
force = 0.5;
|
||||||
|
angle = 0;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
force = -0.5;
|
||||||
|
angle = 180;
|
||||||
|
}
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble()>0 && drivetrain.getPigeon2().getYaw().getValueAsDouble()<180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(force*180/Math.PI));
|
||||||
|
}
|
||||||
|
else if(drivetrain.getPigeon2().getYaw().getValueAsDouble()>180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-force*180/Math.PI));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 drivetrain.getPigeon2().getYaw().getValueAsDouble()> angle && drivetrain.getPigeon2().getYaw().getValueAsDouble()< angle + 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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.ModeAuto;
|
||||||
|
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveModule.DriveRequestType;
|
||||||
|
import com.ctre.phoenix6.hardware.Pigeon2;
|
||||||
|
import com.ctre.phoenix6.swerve.SwerveRequest;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
import edu.wpi.first.wpilibj.DriverStation.Alliance;
|
||||||
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.generated.TunerConstants;
|
||||||
|
import frc.robot.subsystems.CommandSwerveDrivetrain;
|
||||||
|
import static edu.wpi.first.units.Units.*;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/* 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 TournerVersReservoir extends Command {
|
||||||
|
CommandSwerveDrivetrain drivetrain;
|
||||||
|
Optional<Alliance> alliance = DriverStation.getAlliance();
|
||||||
|
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
|
||||||
|
private double MaxAngularRate = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
|
||||||
|
double force;
|
||||||
|
double angle;
|
||||||
|
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
|
||||||
|
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1)
|
||||||
|
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
|
||||||
|
/** Creates a new TournerAZero. */
|
||||||
|
public TournerVersReservoir(CommandSwerveDrivetrain drivetrain) {
|
||||||
|
this.drivetrain = drivetrain;
|
||||||
|
addRequirements(drivetrain);
|
||||||
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the command is initially scheduled.
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
alliance = DriverStation.getAlliance();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
if(alliance.isPresent()){
|
||||||
|
if(alliance.get() == Alliance.Blue){
|
||||||
|
force = 0.5;
|
||||||
|
angle = 180;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
force = -0.5;
|
||||||
|
angle = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() > angle && drivetrain.getPigeon2().getYaw().getValueAsDouble() < angle + 10){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(0));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >0 && drivetrain.getPigeon2().getYaw().getValueAsDouble() <180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(-force*2));
|
||||||
|
}
|
||||||
|
else if(drivetrain.getPigeon2().getYaw().getValueAsDouble() >180){
|
||||||
|
drivetrain.setControl(drive.withRotationalRate(force*2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 drivetrain.getPigeon2().getYaw().getValueAsDouble() > angle && drivetrain.getPigeon2().getYaw().getValueAsDouble() < angle + 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,17 +5,14 @@
|
|||||||
package frc.robot.commands;
|
package frc.robot.commands;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.subsystems.Balayeuse;
|
|
||||||
import frc.robot.subsystems.Lanceur;
|
import frc.robot.subsystems.Lanceur;
|
||||||
/* 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 */
|
/* 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 ModeOposer extends Command {
|
public class ModeOposer extends Command {
|
||||||
private Lanceur lanceur;
|
private Lanceur lanceur;
|
||||||
private Balayeuse balayeuse;
|
|
||||||
/** Creates a new Lancer. */
|
/** Creates a new Lancer. */
|
||||||
public ModeOposer(Lanceur lanceur, Balayeuse balayeuse) {
|
public ModeOposer(Lanceur lanceur) {
|
||||||
this.lanceur = lanceur;
|
this.lanceur = lanceur;
|
||||||
this.balayeuse = balayeuse;
|
addRequirements(lanceur);
|
||||||
addRequirements(lanceur ,balayeuse);
|
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +26,6 @@ public class ModeOposer extends Command {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
lanceur.Lancer(-0.2);
|
lanceur.Lancer(-0.2);
|
||||||
lanceur.Demeler(-0.2);
|
lanceur.Demeler(-0.2);
|
||||||
balayeuse.Balayer(-0.2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@@ -37,7 +33,6 @@ public class ModeOposer extends Command {
|
|||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
lanceur.Demeler(0);
|
lanceur.Demeler(0);
|
||||||
lanceur.Lancer(0);
|
lanceur.Lancer(0);
|
||||||
balayeuse.Balayer(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
|||||||
43
src/main/java/frc/robot/commands/ModeOposerBalayeuse.java
Normal file
43
src/main/java/frc/robot/commands/ModeOposerBalayeuse.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// 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.Balayeuse;
|
||||||
|
/* 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 ModeOposerBalayeuse extends Command {
|
||||||
|
private Balayeuse balayeuse;
|
||||||
|
/** Creates a new Lancer. */
|
||||||
|
public ModeOposerBalayeuse(Balayeuse balayeuse) {
|
||||||
|
this.balayeuse = balayeuse;
|
||||||
|
addRequirements(balayeuse);
|
||||||
|
// 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() {
|
||||||
|
balayeuse.BalayerEnbas(0.5);
|
||||||
|
balayeuse.BalayerPadle(0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called once the command ends or is interrupted.
|
||||||
|
@Override
|
||||||
|
public void end(boolean interrupted) {
|
||||||
|
balayeuse.BalayerEnbas(0);
|
||||||
|
balayeuse.BalayerPadle(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true when the command should end.
|
||||||
|
@Override
|
||||||
|
public boolean isFinished() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,32 +5,33 @@
|
|||||||
package frc.robot.commands;
|
package frc.robot.commands;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import frc.robot.subsystems.Led;
|
import frc.robot.subsystems.Lanceur;
|
||||||
|
|
||||||
/* 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 */
|
/* 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 RainBowAnim extends Command {
|
public class ModeOposerDemeleur extends Command {
|
||||||
private Led led;
|
private Lanceur lanceur;
|
||||||
/** Creates a new RainBowAnim. */
|
/** Creates a new Lancer. */
|
||||||
public RainBowAnim(Led led) {
|
public ModeOposerDemeleur(Lanceur lanceur) {
|
||||||
this.led = led;
|
this.lanceur = lanceur;
|
||||||
addRequirements(led);
|
addRequirements(lanceur);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
led.RainBow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {}
|
public void execute() {
|
||||||
|
lanceur.Demeler(-0.2);
|
||||||
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
led.RainBowStop();
|
lanceur.Demeler(0);
|
||||||
|
lanceur.Lancer(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@@ -25,7 +25,7 @@ public class MonterBalyeuse extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(!balayeuse.GetLimiSwtich()){
|
if(!balayeuse.GetLimiSwtich()){
|
||||||
balayeuse.Pivoter(0.2);
|
balayeuse.Pivoter(0.5);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
balayeuse.Reset();
|
balayeuse.Reset();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public class MonterGrimpeur extends Command {
|
|||||||
/** Creates a new MonterGrimpeur. */
|
/** Creates a new MonterGrimpeur. */
|
||||||
public MonterGrimpeur(Grimpeur grimpeur) {
|
public MonterGrimpeur(Grimpeur grimpeur) {
|
||||||
this.grimpeur = grimpeur;
|
this.grimpeur = grimpeur;
|
||||||
|
addRequirements(grimpeur);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,23 +26,26 @@ public class MonterGrimpeur extends Command {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
|
|
||||||
if(Math.abs(grimpeur.Position()) < grimpeur.PositionFinal()){
|
if(Math.abs(grimpeur.Position()) < grimpeur.PositionFinal()){
|
||||||
grimpeur.Grimper(0.3);
|
grimpeur.GrimperGauche(0.5);
|
||||||
|
grimpeur.GrimperDroit(0.5);
|
||||||
System.out.println("monte");
|
System.out.println("monte");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
grimpeur.Grimper(0);
|
grimpeur.GrimperGauche(0);
|
||||||
|
grimpeur.GrimperDroit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
grimpeur.Grimper(0);
|
grimpeur.GrimperGauche(0);
|
||||||
|
grimpeur.GrimperDroit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
return false;
|
return Math.abs(grimpeur.Position()) > grimpeur.PositionFinal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ public class TunerConstants {
|
|||||||
|
|
||||||
private static final double kDriveGearRatio = 6.122448979591837;
|
private static final double kDriveGearRatio = 6.122448979591837;
|
||||||
private static final double kSteerGearRatio = 21.428571428571427;
|
private static final double kSteerGearRatio = 21.428571428571427;
|
||||||
private static final Distance kWheelRadius = Inches.of(3.895);
|
// private static final Distance kWheelRadius = Inches.of(3.895);
|
||||||
|
private static final Distance kWheelRadius = Inches.of(2);
|
||||||
|
|
||||||
private static final boolean kInvertLeftSide = false;
|
private static final boolean kInvertLeftSide = false;
|
||||||
private static final boolean kInvertRightSide = true;
|
private static final boolean kInvertRightSide = true;
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ public class Balayeuse extends SubsystemBase {
|
|||||||
SparkMax Pivot = new SparkMax(8, MotorType.kBrushless);
|
SparkMax Pivot = new SparkMax(8, MotorType.kBrushless);
|
||||||
DigitalInput limit = new DigitalInput(9);
|
DigitalInput limit = new DigitalInput(9);
|
||||||
private GenericEntry EncodeurBalayeuse =
|
private GenericEntry EncodeurBalayeuse =
|
||||||
teb.add("Position bas balayeuse", 10).getEntry();
|
teb.add("Position bas balayeuse", 1.8).getEntry();
|
||||||
private GenericEntry AmpBaleyeuse =
|
private GenericEntry AmpBaleyeuse =
|
||||||
teb.add("Ampérage Baleyeuse", 40).getEntry();
|
teb.add("Ampérage Baleyeuse", 40).getEntry();
|
||||||
public void Balayer(double vitesse){
|
public void BalayerEnbas(double vitesse){
|
||||||
Balaye1.set(vitesse);
|
Balaye1.set(vitesse);
|
||||||
|
}
|
||||||
|
public void BalayerPadle(double vitesse){
|
||||||
Balaye2.set(vitesse);
|
Balaye2.set(vitesse);
|
||||||
}
|
}
|
||||||
public void Pivoter(double vitesse){
|
public void Pivoter(double vitesse){
|
||||||
@@ -36,7 +38,7 @@ public class Balayeuse extends SubsystemBase {
|
|||||||
return Pivot.getEncoder().getPosition();
|
return Pivot.getEncoder().getPosition();
|
||||||
}
|
}
|
||||||
public void Reset(){
|
public void Reset(){
|
||||||
Pivot.getEncoder().setPosition(0);
|
Pivot.getEncoder().setPosition(0.6);
|
||||||
}
|
}
|
||||||
public boolean GetLimiSwtich(){
|
public boolean GetLimiSwtich(){
|
||||||
return !limit.get();
|
return !limit.get();
|
||||||
@@ -52,7 +54,7 @@ public class Balayeuse extends SubsystemBase {
|
|||||||
timer.start();
|
timer.start();
|
||||||
}
|
}
|
||||||
public double EncodeurBalayeuse(){
|
public double EncodeurBalayeuse(){
|
||||||
return EncodeurBalayeuse.getDouble(10);
|
return EncodeurBalayeuse.getDouble(1.8);
|
||||||
}
|
}
|
||||||
/** Creates a new Balayeuse. */
|
/** Creates a new Balayeuse. */
|
||||||
public Balayeuse() {
|
public Balayeuse() {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.function.Supplier;
|
|||||||
|
|
||||||
import com.ctre.phoenix6.SignalLogger;
|
import com.ctre.phoenix6.SignalLogger;
|
||||||
import com.ctre.phoenix6.Utils;
|
import com.ctre.phoenix6.Utils;
|
||||||
|
import com.ctre.phoenix6.hardware.Pigeon2;
|
||||||
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;
|
||||||
@@ -42,6 +43,7 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
|
|||||||
private static final double kSimLoopPeriod = 0.004; // 4 ms
|
private static final double kSimLoopPeriod = 0.004; // 4 ms
|
||||||
private Notifier m_simNotifier = null;
|
private Notifier m_simNotifier = null;
|
||||||
private double m_lastSimTime;
|
private double m_lastSimTime;
|
||||||
|
Pigeon2 pigeon2;
|
||||||
|
|
||||||
/* Blue alliance sees forward as 0 degrees (toward red alliance wall) */
|
/* Blue alliance sees forward as 0 degrees (toward red alliance wall) */
|
||||||
private static final Rotation2d kBlueAlliancePerspectiveRotation = Rotation2d.kZero;
|
private static final Rotation2d kBlueAlliancePerspectiveRotation = Rotation2d.kZero;
|
||||||
@@ -53,7 +55,6 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
|
|||||||
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. */
|
/* SysId routine for characterizing translation. This is used to find PID gains for the drive motors. */
|
||||||
private final SysIdRoutine m_sysIdRoutineTranslation = new SysIdRoutine(
|
private final SysIdRoutine m_sysIdRoutineTranslation = new SysIdRoutine(
|
||||||
new SysIdRoutine.Config(
|
new SysIdRoutine.Config(
|
||||||
@@ -246,6 +247,12 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void periodic() {
|
public void periodic() {
|
||||||
|
if(getPigeon2().getYaw().getValueAsDouble() > 360){
|
||||||
|
getPigeon2().setYaw(getPigeon2().getYaw().getValueAsDouble()-360);
|
||||||
|
}
|
||||||
|
else if(getPigeon2().getYaw().getValueAsDouble() < 0){
|
||||||
|
getPigeon2().setYaw(getPigeon2().getYaw().getValueAsDouble()+360);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Periodically try to apply the operator perspective.
|
* Periodically try to apply the operator perspective.
|
||||||
* If we haven't applied the operator perspective before, then we should apply it regardless of DS state.
|
* If we haven't applied the operator perspective before, then we should apply it regardless of DS state.
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
package frc.robot.subsystems;
|
package frc.robot.subsystems;
|
||||||
|
|
||||||
import com.revrobotics.spark.SparkMax;
|
import com.revrobotics.spark.SparkMax;
|
||||||
import com.revrobotics.spark.config.SparkMaxConfig;
|
|
||||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||||
|
|
||||||
import edu.wpi.first.networktables.GenericEntry;
|
import edu.wpi.first.networktables.GenericEntry;
|
||||||
@@ -18,26 +17,42 @@ public class Grimpeur extends SubsystemBase {
|
|||||||
ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
||||||
SparkMax grimpeur1 = new SparkMax(3, MotorType.kBrushless);
|
SparkMax grimpeur1 = new SparkMax(3, MotorType.kBrushless);
|
||||||
SparkMax grimpeur2 = new SparkMax(12, MotorType.kBrushless);
|
SparkMax grimpeur2 = new SparkMax(12, MotorType.kBrushless);
|
||||||
SparkMaxConfig slaveConfig = new SparkMaxConfig();
|
|
||||||
|
// SparkMaxConfig slaveConfig = new SparkMaxConfig();
|
||||||
DigitalInput limit = new DigitalInput(0);
|
DigitalInput limit = new DigitalInput(0);
|
||||||
private GenericEntry EncodeurGrimpeur =
|
private GenericEntry EncodeurGrimpeur = teb.add("Position haut grimpeur", 100).getEntry();
|
||||||
teb.add("Position haut grimpeur", 105).getEntry();
|
|
||||||
public void Grimper(double vitesse){
|
// public void Grimper(double vitesse){
|
||||||
|
// grimpeur1.configure(slaveConfig, ResetMode.kNoResetSafeParameters,
|
||||||
|
// PersistMode.kPersistParameters);
|
||||||
|
// grimpeur2.configure(slaveConfig.follow(grimpeur1),
|
||||||
|
// ResetMode.kNoResetSafeParameters, PersistMode.kPersistParameters);
|
||||||
|
// grimpeur1.set(vitesse);
|
||||||
|
// }
|
||||||
|
public void GrimperGauche(double vitesse) {
|
||||||
grimpeur1.set(vitesse);
|
grimpeur1.set(vitesse);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GrimperDroit(double vitesse) {
|
||||||
grimpeur2.set(vitesse);
|
grimpeur2.set(vitesse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double Position() {
|
public double Position() {
|
||||||
return grimpeur1.getEncoder().getPosition();
|
return grimpeur1.getEncoder().getPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset() {
|
public void Reset() {
|
||||||
grimpeur1.getEncoder().setPosition(0);
|
grimpeur1.getEncoder().setPosition(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean Limit() {
|
public boolean Limit() {
|
||||||
return limit.get();
|
return limit.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double PositionFinal() {
|
public double PositionFinal() {
|
||||||
return EncodeurGrimpeur.getDouble(105);
|
return EncodeurGrimpeur.getDouble(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates a new Grimpeur. */
|
/** Creates a new Grimpeur. */
|
||||||
public Grimpeur() {
|
public Grimpeur() {
|
||||||
teb.addDouble("encodeur grimpeur", this::Position);
|
teb.addDouble("encodeur grimpeur", this::Position);
|
||||||
|
|||||||
149
src/main/java/frc/robot/subsystems/LEDSubsystem.java
Normal file
149
src/main/java/frc/robot/subsystems/LEDSubsystem.java
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
// /* Generated by Phoenix Tuner X */
|
||||||
|
// package frc.robot.subsystems;
|
||||||
|
|
||||||
|
// import edu.wpi.first.networktables.GenericEntry;
|
||||||
|
// import edu.wpi.first.wpilibj.DriverStation;
|
||||||
|
// import edu.wpi.first.wpilibj.Timer;
|
||||||
|
// import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets;
|
||||||
|
// import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||||
|
// import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
||||||
|
// import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
// import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
|
||||||
|
// import com.ctre.phoenix6.CANBus;
|
||||||
|
// import com.ctre.phoenix6.controls.SolidColor;
|
||||||
|
// import com.ctre.phoenix6.hardware.CANdle;
|
||||||
|
// import com.ctre.phoenix6.signals.RGBWColor;
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * Subsystem that controls an addressable LED strip using a CANdle.
|
||||||
|
// */
|
||||||
|
// public class LEDSubsystem extends SubsystemBase {
|
||||||
|
// Timer _timer;
|
||||||
|
// boolean q = true;
|
||||||
|
// ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
||||||
|
// private GenericEntry equipe =
|
||||||
|
// teb.add("equipe commence (bleu = ouvert, rouge = fermé)", true).withWidget(BuiltInWidgets.kToggleSwitch).getEntry();
|
||||||
|
// private final CANBus kCANBus = new CANBus("rio");
|
||||||
|
// private final CANdle m_candle = new CANdle(17, kCANBus);
|
||||||
|
// public void Bleu(){
|
||||||
|
// m_candle.setControl(new SolidColor(0, 80).withColor(new RGBWColor(255, 0, 0, 0)));
|
||||||
|
// }
|
||||||
|
// public void Rouge(){
|
||||||
|
// m_candle.setControl(new SolidColor(0, 80).withColor(new RGBWColor(0, 0, 255, 0)));
|
||||||
|
// }
|
||||||
|
// public void Vert(){
|
||||||
|
// m_candle.setControl(new SolidColor(0, 80).withColor(new RGBWColor(0, 255, 0, 0)));
|
||||||
|
// }
|
||||||
|
// public void Noir(){
|
||||||
|
|
||||||
|
// m_candle.setControl(new SolidColor(0, 80).withColor(new RGBWColor(0, 0, 0, 0)));
|
||||||
|
// }
|
||||||
|
// public void Flash(boolean couleur){
|
||||||
|
// Timer timer = new Timer();
|
||||||
|
// if(timer.get() <0.5){
|
||||||
|
// if(couleur){
|
||||||
|
// Bleu();
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// Rouge();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// Noir();
|
||||||
|
// timer.reset();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// public LEDSubsystem() {
|
||||||
|
// setDefaultCommand(updateLEDs());
|
||||||
|
// _timer = new Timer();
|
||||||
|
// _timer.start();
|
||||||
|
// }
|
||||||
|
// public boolean Equipe(){
|
||||||
|
// return equipe.getBoolean(false);
|
||||||
|
// }
|
||||||
|
// /**
|
||||||
|
// * Updates the animations and LEDs of the CANdle.
|
||||||
|
// *
|
||||||
|
// * @return Command to run
|
||||||
|
// */
|
||||||
|
// public Command updateLEDs() {
|
||||||
|
// return run(() -> {
|
||||||
|
// // if(q){
|
||||||
|
// // _timer.reset();
|
||||||
|
// // q = false;
|
||||||
|
// // }
|
||||||
|
// double temps = _timer.get();
|
||||||
|
// System.out.println(temps);
|
||||||
|
// if(Equipe()){
|
||||||
|
// if(temps > 30){
|
||||||
|
// Vert();
|
||||||
|
// }
|
||||||
|
// else if(temps > 52){
|
||||||
|
|
||||||
|
// Bleu();
|
||||||
|
// }
|
||||||
|
// else if(temps > 55){
|
||||||
|
// Flash(true);
|
||||||
|
// }
|
||||||
|
// else if(temps > 67){
|
||||||
|
// Rouge();
|
||||||
|
// }
|
||||||
|
// else if(temps > 70){
|
||||||
|
// Flash(false);
|
||||||
|
// }
|
||||||
|
// else if(temps > 103){
|
||||||
|
// Bleu();
|
||||||
|
// }
|
||||||
|
// else if(temps > 105){
|
||||||
|
// Flash(true);
|
||||||
|
// }
|
||||||
|
// else if(temps > 127){
|
||||||
|
// Rouge();
|
||||||
|
// }
|
||||||
|
// else if(temps > 130){
|
||||||
|
// Flash(false);
|
||||||
|
// }
|
||||||
|
// else if(temps < 140){
|
||||||
|
// Vert();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// if(temps > 110){
|
||||||
|
// Vert();
|
||||||
|
// }
|
||||||
|
// else if(temps > 88){
|
||||||
|
|
||||||
|
// Rouge();
|
||||||
|
// }
|
||||||
|
// else if(temps > 85){
|
||||||
|
// Flash(false);
|
||||||
|
// }
|
||||||
|
// else if(temps > 63){
|
||||||
|
// Bleu();
|
||||||
|
// }
|
||||||
|
// else if(temps > 60){
|
||||||
|
// Flash(true);
|
||||||
|
// }
|
||||||
|
// else if(temps > 33){
|
||||||
|
// Rouge();
|
||||||
|
// }
|
||||||
|
// else if(temps > 30){
|
||||||
|
// Flash(false);
|
||||||
|
// }
|
||||||
|
// else if(temps > 13){
|
||||||
|
// Bleu();
|
||||||
|
// }
|
||||||
|
// else if(temps > 10){
|
||||||
|
// Flash(true);
|
||||||
|
// }
|
||||||
|
// else if(temps < 10){
|
||||||
|
// Vert();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // _timer.stop();
|
||||||
|
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
@@ -6,6 +6,7 @@ package frc.robot.subsystems;
|
|||||||
|
|
||||||
import com.revrobotics.spark.SparkFlex;
|
import com.revrobotics.spark.SparkFlex;
|
||||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||||
|
import com.revrobotics.spark.SparkMax;
|
||||||
|
|
||||||
import edu.wpi.first.networktables.GenericEntry;
|
import edu.wpi.first.networktables.GenericEntry;
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||||
@@ -16,13 +17,14 @@ public class Lanceur extends SubsystemBase {
|
|||||||
ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
||||||
SparkFlex moteur1 = new SparkFlex(15, MotorType.kBrushless);
|
SparkFlex moteur1 = new SparkFlex(15, MotorType.kBrushless);
|
||||||
SparkFlex moteur2 = new SparkFlex(18, MotorType.kBrushless);
|
SparkFlex moteur2 = new SparkFlex(18, MotorType.kBrushless);
|
||||||
SparkFlex Demeleur = new SparkFlex(19, MotorType.kBrushless);
|
SparkMax Demeleur = new SparkMax(19, MotorType.kBrushless);
|
||||||
GenericEntry vitesse =
|
GenericEntry vitesse =
|
||||||
teb.add("vitesse lanceur",0.5).getEntry();
|
teb.add("vitesse lanceur",4000).getEntry();
|
||||||
GenericEntry AmpLanceur =
|
GenericEntry AmpLanceur =
|
||||||
teb.add("ampérage lanceur",30).getEntry();
|
teb.add("ampérage lanceur",30).getEntry();
|
||||||
|
|
||||||
public void Lancer(double vitesse){
|
public void Lancer(double vitesse){
|
||||||
// moteur1.set(-vitesse);
|
moteur1.set(vitesse);
|
||||||
moteur2.set(vitesse);
|
moteur2.set(vitesse);
|
||||||
}
|
}
|
||||||
public void Demeler(double vitesse){
|
public void Demeler(double vitesse){
|
||||||
@@ -38,11 +40,12 @@ public class Lanceur extends SubsystemBase {
|
|||||||
return AmpLanceur.getDouble(30);
|
return AmpLanceur.getDouble(30);
|
||||||
}
|
}
|
||||||
public double vitesseDemander(){
|
public double vitesseDemander(){
|
||||||
return vitesse.getDouble(0.5);
|
return vitesse.getDouble(4000);
|
||||||
}
|
}
|
||||||
/** Creates a new Lanceur. */
|
/** Creates a new Lanceur. */
|
||||||
public Lanceur() {
|
public Lanceur() {
|
||||||
teb.addDouble("amperage lanceur", this::Amp);
|
teb.addDouble("amperage lanceur", this::Amp);
|
||||||
|
teb.addDouble("vitesse actuelle",this::Vitesse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,133 +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 com.ctre.phoenix.led.CANdle;
|
|
||||||
import com.ctre.phoenix.led.RainbowAnimation;
|
|
||||||
|
|
||||||
import edu.wpi.first.networktables.GenericEntry;
|
|
||||||
import edu.wpi.first.wpilibj.DriverStation;
|
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets;
|
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
||||||
|
|
||||||
public class Led extends SubsystemBase {
|
|
||||||
ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
|
||||||
private GenericEntry equipe =
|
|
||||||
teb.add("equipe commence (bleu = ouvert, rouge = fermé)", true).withWidget(BuiltInWidgets.kToggleSwitch).getEntry();
|
|
||||||
CANdle CANDle = new CANdle(17);
|
|
||||||
RainbowAnimation rainbowAnim = new RainbowAnimation();
|
|
||||||
public void bleu(){
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,0,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,16,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,32,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,56,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,72,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,88,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,104,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,120,8);
|
|
||||||
CANDle.setLEDs(0, 0, 255,0,136,8);
|
|
||||||
|
|
||||||
}
|
|
||||||
public void Vert1(){
|
|
||||||
CANDle.setLEDs(0, 255, 0,0,0,8);
|
|
||||||
CANDle.setLEDs(0, 255, 0,0,16,8);
|
|
||||||
CANDle.setLEDs(0, 255, 0,0,32,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);
|
|
||||||
CANDle.setLEDs(0, 255, 0,0,136,8);
|
|
||||||
}
|
|
||||||
public void Rouge(){
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,0,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,16,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,32,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,48,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,64,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,80,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,96,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,112,8);
|
|
||||||
CANDle.setLEDs(255, 0, 0,0,128,8);
|
|
||||||
}
|
|
||||||
public void Jaune2(){
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,8,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,24,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,40,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,56,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,72,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,88,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,104,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,120,8);
|
|
||||||
CANDle.setLEDs(255, 255, 0,0,136,8);
|
|
||||||
}
|
|
||||||
public void Vert2(){
|
|
||||||
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);
|
|
||||||
CANDle.setLEDs(0, 255, 0,0,136,8);
|
|
||||||
}
|
|
||||||
public void RainBow(){
|
|
||||||
CANDle.animate(rainbowAnim);
|
|
||||||
}
|
|
||||||
public void RainBowStop(){
|
|
||||||
CANDle.animate(null);
|
|
||||||
}
|
|
||||||
public boolean Equipe(){
|
|
||||||
return equipe.getBoolean(true);
|
|
||||||
}
|
|
||||||
/** Creates a new Led. */
|
|
||||||
public Led() {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void periodic() {
|
|
||||||
double temps = DriverStation.getMatchTime();
|
|
||||||
if(temps > 20 && temps < 30){
|
|
||||||
Vert1();
|
|
||||||
}
|
|
||||||
if(Equipe()){
|
|
||||||
if(temps > 30 && temps < 55){
|
|
||||||
bleu();
|
|
||||||
}
|
|
||||||
else if(temps > 30 && temps < 80){
|
|
||||||
Rouge();
|
|
||||||
}
|
|
||||||
else if(temps > 80 && temps < 105){
|
|
||||||
bleu();
|
|
||||||
}
|
|
||||||
else if(temps > 105 && temps < 130){
|
|
||||||
Rouge();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
RainBow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(temps > 30 && temps < 55){
|
|
||||||
Rouge();
|
|
||||||
}
|
|
||||||
else if(temps > 30 && temps < 80){
|
|
||||||
bleu();
|
|
||||||
}
|
|
||||||
else if(temps > 80 && temps < 105){
|
|
||||||
Rouge();
|
|
||||||
}
|
|
||||||
else if(temps > 105 && temps < 130){
|
|
||||||
bleu();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
RainBow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// This method will be called once per scheduler run
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,7 +12,7 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|||||||
import frc.robot.LimelightHelpers;
|
import frc.robot.LimelightHelpers;
|
||||||
|
|
||||||
public class LimeLight3 extends SubsystemBase {
|
public class LimeLight3 extends SubsystemBase {
|
||||||
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balaie");
|
||||||
NetworkTableEntry pipeline = table.getEntry("pipeline");
|
NetworkTableEntry pipeline = table.getEntry("pipeline");
|
||||||
/** Creates a new LimeLight3. */
|
/** Creates a new LimeLight3. */
|
||||||
public LimeLight3() {
|
public LimeLight3() {
|
||||||
@@ -21,34 +21,34 @@ public class LimeLight3 extends SubsystemBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public double[] getBotPoseBlue(){
|
public double[] getBotPoseBlue(){
|
||||||
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-balaie");
|
||||||
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_orb_wpiblue");
|
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_wpiblue");
|
||||||
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
||||||
return BotPose;
|
return BotPose;
|
||||||
}
|
}
|
||||||
public double[] getBotPoseRed(){
|
public double[] getBotPoseRed(){
|
||||||
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-balaie");
|
||||||
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_orb_wpired");
|
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_wpired");
|
||||||
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
||||||
return BotPose;
|
return BotPose;
|
||||||
}
|
}
|
||||||
public double getTx(){
|
public double getTx(){
|
||||||
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balaie");
|
||||||
NetworkTableEntry tx = table.getEntry("tx");
|
NetworkTableEntry tx = table.getEntry("tx");
|
||||||
return tx.getDouble(0.0);
|
return tx.getDouble(0.0);
|
||||||
}
|
}
|
||||||
public double getTId(){
|
public double getTId(){
|
||||||
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balaie");
|
||||||
NetworkTableEntry tid = table.getEntry("tid");
|
NetworkTableEntry tid = table.getEntry("tid");
|
||||||
return tid.getDouble(0.0);
|
return tid.getDouble(0.0);
|
||||||
}
|
}
|
||||||
public double getTA(){
|
public double getTA(){
|
||||||
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
|
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balaie");
|
||||||
NetworkTableEntry ta = table.getEntry("ta");
|
NetworkTableEntry ta = table.getEntry("ta");
|
||||||
return ta.getDouble(0.0);
|
return ta.getDouble(0.0);
|
||||||
}
|
}
|
||||||
public boolean getV(){
|
public boolean getV(){
|
||||||
return LimelightHelpers.getTV("limelight-balon");
|
return LimelightHelpers.getTV("limelight-balaie");
|
||||||
}
|
}
|
||||||
public void AprilTag(){
|
public void AprilTag(){
|
||||||
pipeline.setNumber(0);
|
pipeline.setNumber(0);
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-tag")
|
|||||||
}
|
}
|
||||||
public double[] getBotPoseBlue(){
|
public double[] getBotPoseBlue(){
|
||||||
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-tag");
|
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-tag");
|
||||||
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_orb_wpiblue");
|
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_wpiblue");
|
||||||
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
||||||
return BotPose;
|
return BotPose;
|
||||||
}
|
}
|
||||||
public double[] getBotPoseRed(){
|
public double[] getBotPoseRed(){
|
||||||
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-tag");
|
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-tag");
|
||||||
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_orb_wpired");
|
NetworkTableEntry BotPoseEntry = limelightTable.getEntry("botpose_wpired");
|
||||||
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
double[] BotPose = BotPoseEntry.getDoubleArray(new double[7]);
|
||||||
return BotPose;
|
return BotPose;
|
||||||
}
|
}
|
||||||
@@ -52,13 +52,27 @@ NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-tag")
|
|||||||
}
|
}
|
||||||
public double Calcule(double x1, double x2, double y1, double y2, double angle)
|
public double Calcule(double x1, double x2, double y1, double y2, double angle)
|
||||||
{
|
{
|
||||||
if (x1 > 4)
|
// if(x1 > x2){
|
||||||
{
|
// if(y1 > y2){
|
||||||
return (Math.abs(Math.atan2(x2 - x1, y2 - y1)) * (180 / Math.PI) - angle)/90;
|
// return Math.atan(90-((x2 - x1) / (y2 - y1))) * (180 / Math.PI) - angle;
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// return Math.atan((x2 - x1) / (y2 - y1)) * (180 / Math.PI)+90 - angle;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// if(y1 > y2){
|
||||||
|
// return Math.atan((x2 - x1) / (y2 - y1))* (180 / Math.PI)+270 - angle;
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// return Math.atan(90-((x2 - x1) / (y2 - y1))) * (180 / Math.PI)+180 - angle;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
if(y1 > y2){
|
||||||
|
return Math.toDegrees(Math.atan((x2 - x1) /(y2 - y1))) - angle;
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
return Math.toDegrees(-Math.atan((x2 - x1) / (y2 - y1))) - angle;
|
||||||
return (Math.abs(Math.atan2(x2 - x1, y2 - y1)) * (180 / Math.PI) + angle) * -1/90;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"fileName": "PathplannerLib-2025.2.7.json",
|
"fileName": "PathplannerLib-2026.1.2.json",
|
||||||
"name": "PathplannerLib",
|
"name": "PathplannerLib",
|
||||||
"version": "2025.2.7",
|
"version": "2026.1.2",
|
||||||
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
|
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
|
||||||
"frcYear": "2025",
|
"frcYear": "2026",
|
||||||
"mavenUrls": [
|
"mavenUrls": [
|
||||||
"https://3015rangerrobotics.github.io/pathplannerlib/repo"
|
"https://3015rangerrobotics.github.io/pathplannerlib/repo"
|
||||||
],
|
],
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.pathplanner.lib",
|
"groupId": "com.pathplanner.lib",
|
||||||
"artifactId": "PathplannerLib-java",
|
"artifactId": "PathplannerLib-java",
|
||||||
"version": "2025.2.7"
|
"version": "2026.1.2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jniDependencies": [],
|
"jniDependencies": [],
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.pathplanner.lib",
|
"groupId": "com.pathplanner.lib",
|
||||||
"artifactId": "PathplannerLib-cpp",
|
"artifactId": "PathplannerLib-cpp",
|
||||||
"version": "2025.2.7",
|
"version": "2026.1.2",
|
||||||
"libName": "PathplannerLib",
|
"libName": "PathplannerLib",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": false,
|
"sharedLibrary": false,
|
||||||
@@ -1,50 +1,50 @@
|
|||||||
{
|
{
|
||||||
"fileName": "Phoenix5-5.35.1.json",
|
"fileName": "Phoenix5-5.36.0.json",
|
||||||
"name": "CTRE-Phoenix (v5)",
|
"name": "CTRE-Phoenix (v5)",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"frcYear": "2025",
|
"frcYear": "2026",
|
||||||
"uuid": "ab676553-b602-441f-a38d-f1296eff6537",
|
"uuid": "ab676553-b602-441f-a38d-f1296eff6537",
|
||||||
"mavenUrls": [
|
"mavenUrls": [
|
||||||
"https://maven.ctr-electronics.com/release/"
|
"https://maven.ctr-electronics.com/release/"
|
||||||
],
|
],
|
||||||
"jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2025-latest.json",
|
"jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2026-latest.json",
|
||||||
"requires": [
|
"requires": [
|
||||||
{
|
{
|
||||||
"uuid": "e995de00-2c64-4df5-8831-c1441420ff19",
|
"uuid": "e995de00-2c64-4df5-8831-c1441420ff19",
|
||||||
"errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.",
|
"errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.",
|
||||||
"offlineFileName": "Phoenix6-frc2025-latest.json",
|
"offlineFileName": "Phoenix6-frc2026-latest.json",
|
||||||
"onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json"
|
"onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"conflictsWith": [
|
"conflictsWith": [
|
||||||
{
|
{
|
||||||
"uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af",
|
"uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af",
|
||||||
"errorMessage": "Users must use the Phoenix 5 replay vendordep when using the Phoenix 6 replay vendordep.",
|
"errorMessage": "Users must use the Phoenix 5 replay vendordep when using the Phoenix 6 replay vendordep.",
|
||||||
"offlineFileName": "Phoenix6-replay-frc2025-latest.json"
|
"offlineFileName": "Phoenix6-replay-frc2026-latest.json"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df",
|
"uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df",
|
||||||
"errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.",
|
"errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.",
|
||||||
"offlineFileName": "Phoenix5-replay-frc2025-latest.json"
|
"offlineFileName": "Phoenix5-replay-frc2026-latest.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"javaDependencies": [
|
"javaDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix",
|
"groupId": "com.ctre.phoenix",
|
||||||
"artifactId": "api-java",
|
"artifactId": "api-java",
|
||||||
"version": "5.35.1"
|
"version": "5.36.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix",
|
"groupId": "com.ctre.phoenix",
|
||||||
"artifactId": "wpiapi-java",
|
"artifactId": "wpiapi-java",
|
||||||
"version": "5.35.1"
|
"version": "5.36.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jniDependencies": [
|
"jniDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix",
|
"groupId": "com.ctre.phoenix",
|
||||||
"artifactId": "cci",
|
"artifactId": "cci",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix.sim",
|
"groupId": "com.ctre.phoenix.sim",
|
||||||
"artifactId": "cci-sim",
|
"artifactId": "cci-sim",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix",
|
"groupId": "com.ctre.phoenix",
|
||||||
"artifactId": "wpiapi-cpp",
|
"artifactId": "wpiapi-cpp",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"libName": "CTRE_Phoenix_WPI",
|
"libName": "CTRE_Phoenix_WPI",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix",
|
"groupId": "com.ctre.phoenix",
|
||||||
"artifactId": "api-cpp",
|
"artifactId": "api-cpp",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"libName": "CTRE_Phoenix",
|
"libName": "CTRE_Phoenix",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix",
|
"groupId": "com.ctre.phoenix",
|
||||||
"artifactId": "cci",
|
"artifactId": "cci",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"libName": "CTRE_PhoenixCCI",
|
"libName": "CTRE_PhoenixCCI",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix.sim",
|
"groupId": "com.ctre.phoenix.sim",
|
||||||
"artifactId": "wpiapi-cpp-sim",
|
"artifactId": "wpiapi-cpp-sim",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"libName": "CTRE_Phoenix_WPISim",
|
"libName": "CTRE_Phoenix_WPISim",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix.sim",
|
"groupId": "com.ctre.phoenix.sim",
|
||||||
"artifactId": "api-cpp-sim",
|
"artifactId": "api-cpp-sim",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"libName": "CTRE_PhoenixSim",
|
"libName": "CTRE_PhoenixSim",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix.sim",
|
"groupId": "com.ctre.phoenix.sim",
|
||||||
"artifactId": "cci-sim",
|
"artifactId": "cci-sim",
|
||||||
"version": "5.35.1",
|
"version": "5.36.0",
|
||||||
"libName": "CTRE_PhoenixCCISim",
|
"libName": "CTRE_PhoenixCCISim",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -1,32 +1,32 @@
|
|||||||
{
|
{
|
||||||
"fileName": "Phoenix6-frc2025-latest.json",
|
"fileName": "Phoenix6-26.1.3.json",
|
||||||
"name": "CTRE-Phoenix (v6)",
|
"name": "CTRE-Phoenix (v6)",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"frcYear": "2025",
|
"frcYear": "2026",
|
||||||
"uuid": "e995de00-2c64-4df5-8831-c1441420ff19",
|
"uuid": "e995de00-2c64-4df5-8831-c1441420ff19",
|
||||||
"mavenUrls": [
|
"mavenUrls": [
|
||||||
"https://maven.ctr-electronics.com/release/"
|
"https://maven.ctr-electronics.com/release/"
|
||||||
],
|
],
|
||||||
"jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json",
|
"jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json",
|
||||||
"conflictsWith": [
|
"conflictsWith": [
|
||||||
{
|
{
|
||||||
"uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af",
|
"uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af",
|
||||||
"errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.",
|
"errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.",
|
||||||
"offlineFileName": "Phoenix6-replay-frc2025-latest.json"
|
"offlineFileName": "Phoenix6-replay-frc2026-latest.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"javaDependencies": [
|
"javaDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6",
|
"groupId": "com.ctre.phoenix6",
|
||||||
"artifactId": "wpiapi-java",
|
"artifactId": "wpiapi-java",
|
||||||
"version": "25.4.0"
|
"version": "26.1.3"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jniDependencies": [
|
"jniDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6",
|
"groupId": "com.ctre.phoenix6",
|
||||||
"artifactId": "api-cpp",
|
"artifactId": "api-cpp",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"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.4.0",
|
"version": "26.1.3",
|
||||||
"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.4.0",
|
"version": "26.1.3",
|
||||||
"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.4.0",
|
"version": "26.1.3",
|
||||||
"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.4.0",
|
"version": "26.1.3",
|
||||||
"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.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -110,21 +110,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simPigeonIMU",
|
"artifactId": "simPigeonIMU",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
|
||||||
"skipInvalidPlatforms": true,
|
|
||||||
"validPlatforms": [
|
|
||||||
"windowsx86-64",
|
|
||||||
"linuxx86-64",
|
|
||||||
"linuxarm64",
|
|
||||||
"osxuniversal"
|
|
||||||
],
|
|
||||||
"simMode": "swsim"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
|
||||||
"artifactId": "simCANCoder",
|
|
||||||
"version": "25.4.0",
|
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -138,7 +124,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProTalonFX",
|
"artifactId": "simProTalonFX",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -152,7 +138,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProTalonFXS",
|
"artifactId": "simProTalonFXS",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -166,7 +152,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANcoder",
|
"artifactId": "simProCANcoder",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -180,7 +166,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProPigeon2",
|
"artifactId": "simProPigeon2",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -194,7 +180,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANrange",
|
"artifactId": "simProCANrange",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -208,7 +194,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANdi",
|
"artifactId": "simProCANdi",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -222,7 +208,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANdle",
|
"artifactId": "simProCANdle",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -238,7 +224,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6",
|
"groupId": "com.ctre.phoenix6",
|
||||||
"artifactId": "wpiapi-cpp",
|
"artifactId": "wpiapi-cpp",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_Phoenix6_WPI",
|
"libName": "CTRE_Phoenix6_WPI",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -254,7 +240,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6",
|
"groupId": "com.ctre.phoenix6",
|
||||||
"artifactId": "tools",
|
"artifactId": "tools",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_PhoenixTools",
|
"libName": "CTRE_PhoenixTools",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -270,7 +256,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "wpiapi-cpp-sim",
|
"artifactId": "wpiapi-cpp-sim",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_Phoenix6_WPISim",
|
"libName": "CTRE_Phoenix6_WPISim",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -286,7 +272,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "tools-sim",
|
"artifactId": "tools-sim",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_PhoenixTools_Sim",
|
"libName": "CTRE_PhoenixTools_Sim",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -302,7 +288,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simTalonSRX",
|
"artifactId": "simTalonSRX",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimTalonSRX",
|
"libName": "CTRE_SimTalonSRX",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -318,7 +304,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simVictorSPX",
|
"artifactId": "simVictorSPX",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimVictorSPX",
|
"libName": "CTRE_SimVictorSPX",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -334,7 +320,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simPigeonIMU",
|
"artifactId": "simPigeonIMU",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimPigeonIMU",
|
"libName": "CTRE_SimPigeonIMU",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -347,26 +333,10 @@
|
|||||||
],
|
],
|
||||||
"simMode": "swsim"
|
"simMode": "swsim"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
|
||||||
"artifactId": "simCANCoder",
|
|
||||||
"version": "25.4.0",
|
|
||||||
"libName": "CTRE_SimCANCoder",
|
|
||||||
"headerClassifier": "headers",
|
|
||||||
"sharedLibrary": true,
|
|
||||||
"skipInvalidPlatforms": true,
|
|
||||||
"binaryPlatforms": [
|
|
||||||
"windowsx86-64",
|
|
||||||
"linuxx86-64",
|
|
||||||
"linuxarm64",
|
|
||||||
"osxuniversal"
|
|
||||||
],
|
|
||||||
"simMode": "swsim"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProTalonFX",
|
"artifactId": "simProTalonFX",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimProTalonFX",
|
"libName": "CTRE_SimProTalonFX",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -382,7 +352,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProTalonFXS",
|
"artifactId": "simProTalonFXS",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimProTalonFXS",
|
"libName": "CTRE_SimProTalonFXS",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -398,7 +368,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANcoder",
|
"artifactId": "simProCANcoder",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimProCANcoder",
|
"libName": "CTRE_SimProCANcoder",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -414,7 +384,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProPigeon2",
|
"artifactId": "simProPigeon2",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimProPigeon2",
|
"libName": "CTRE_SimProPigeon2",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -430,7 +400,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANrange",
|
"artifactId": "simProCANrange",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimProCANrange",
|
"libName": "CTRE_SimProCANrange",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -446,7 +416,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANdi",
|
"artifactId": "simProCANdi",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimProCANdi",
|
"libName": "CTRE_SimProCANdi",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -462,7 +432,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.ctre.phoenix6.sim",
|
"groupId": "com.ctre.phoenix6.sim",
|
||||||
"artifactId": "simProCANdle",
|
"artifactId": "simProCANdle",
|
||||||
"version": "25.4.0",
|
"version": "26.1.3",
|
||||||
"libName": "CTRE_SimProCANdle",
|
"libName": "CTRE_SimProCANdle",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
@@ -1,25 +1,55 @@
|
|||||||
{
|
{
|
||||||
"fileName": "REVLib.json",
|
"fileName": "REVLib.json",
|
||||||
"name": "REVLib",
|
"name": "REVLib",
|
||||||
"version": "2025.0.3",
|
"version": "2026.0.5",
|
||||||
"frcYear": "2025",
|
"frcYear": "2026",
|
||||||
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
|
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
|
||||||
"mavenUrls": [
|
"mavenUrls": [
|
||||||
"https://maven.revrobotics.com/"
|
"https://maven.revrobotics.com/"
|
||||||
],
|
],
|
||||||
"jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2025.json",
|
"jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2026.json",
|
||||||
"javaDependencies": [
|
"javaDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.revrobotics.frc",
|
"groupId": "com.revrobotics.frc",
|
||||||
"artifactId": "REVLib-java",
|
"artifactId": "REVLib-java",
|
||||||
"version": "2025.0.3"
|
"version": "2026.0.5"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jniDependencies": [
|
"jniDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.revrobotics.frc",
|
"groupId": "com.revrobotics.frc",
|
||||||
"artifactId": "REVLib-driver",
|
"artifactId": "REVLib-driver",
|
||||||
"version": "2025.0.3",
|
"version": "2026.0.5",
|
||||||
|
"skipInvalidPlatforms": true,
|
||||||
|
"isJar": false,
|
||||||
|
"validPlatforms": [
|
||||||
|
"windowsx86-64",
|
||||||
|
"linuxarm64",
|
||||||
|
"linuxx86-64",
|
||||||
|
"linuxathena",
|
||||||
|
"linuxarm32",
|
||||||
|
"osxuniversal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"groupId": "com.revrobotics.frc",
|
||||||
|
"artifactId": "RevLibBackendDriver",
|
||||||
|
"version": "2026.0.5",
|
||||||
|
"skipInvalidPlatforms": true,
|
||||||
|
"isJar": false,
|
||||||
|
"validPlatforms": [
|
||||||
|
"windowsx86-64",
|
||||||
|
"linuxarm64",
|
||||||
|
"linuxx86-64",
|
||||||
|
"linuxathena",
|
||||||
|
"linuxarm32",
|
||||||
|
"osxuniversal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"groupId": "com.revrobotics.frc",
|
||||||
|
"artifactId": "RevLibWpiBackendDriver",
|
||||||
|
"version": "2026.0.5",
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
@@ -36,7 +66,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.revrobotics.frc",
|
"groupId": "com.revrobotics.frc",
|
||||||
"artifactId": "REVLib-cpp",
|
"artifactId": "REVLib-cpp",
|
||||||
"version": "2025.0.3",
|
"version": "2026.0.5",
|
||||||
"libName": "REVLib",
|
"libName": "REVLib",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": false,
|
"sharedLibrary": false,
|
||||||
@@ -53,7 +83,7 @@
|
|||||||
{
|
{
|
||||||
"groupId": "com.revrobotics.frc",
|
"groupId": "com.revrobotics.frc",
|
||||||
"artifactId": "REVLib-driver",
|
"artifactId": "REVLib-driver",
|
||||||
"version": "2025.0.3",
|
"version": "2026.0.5",
|
||||||
"libName": "REVLibDriver",
|
"libName": "REVLibDriver",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": false,
|
"sharedLibrary": false,
|
||||||
@@ -66,6 +96,38 @@
|
|||||||
"linuxarm32",
|
"linuxarm32",
|
||||||
"osxuniversal"
|
"osxuniversal"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"groupId": "com.revrobotics.frc",
|
||||||
|
"artifactId": "RevLibBackendDriver",
|
||||||
|
"version": "2026.0.5",
|
||||||
|
"libName": "BackendDriver",
|
||||||
|
"sharedLibrary": true,
|
||||||
|
"skipInvalidPlatforms": true,
|
||||||
|
"binaryPlatforms": [
|
||||||
|
"windowsx86-64",
|
||||||
|
"linuxarm64",
|
||||||
|
"linuxx86-64",
|
||||||
|
"linuxathena",
|
||||||
|
"linuxarm32",
|
||||||
|
"osxuniversal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"groupId": "com.revrobotics.frc",
|
||||||
|
"artifactId": "RevLibWpiBackendDriver",
|
||||||
|
"version": "2026.0.5",
|
||||||
|
"libName": "REVLibWpi",
|
||||||
|
"sharedLibrary": true,
|
||||||
|
"skipInvalidPlatforms": true,
|
||||||
|
"binaryPlatforms": [
|
||||||
|
"windowsx86-64",
|
||||||
|
"linuxarm64",
|
||||||
|
"linuxx86-64",
|
||||||
|
"linuxathena",
|
||||||
|
"linuxarm32",
|
||||||
|
"osxuniversal"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
"name": "WPILib-New-Commands",
|
"name": "WPILib-New-Commands",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266",
|
"uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266",
|
||||||
"frcYear": "2025",
|
"frcYear": "2026",
|
||||||
"mavenUrls": [],
|
"mavenUrls": [],
|
||||||
"jsonUrl": "",
|
"jsonUrl": "",
|
||||||
"javaDependencies": [
|
"javaDependencies": [
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
"sharedLibrary": true,
|
"sharedLibrary": true,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"binaryPlatforms": [
|
"binaryPlatforms": [
|
||||||
|
"linuxsystemcore",
|
||||||
"linuxathena",
|
"linuxathena",
|
||||||
"linuxarm32",
|
"linuxarm32",
|
||||||
"linuxarm64",
|
"linuxarm64",
|
||||||
|
|||||||
Reference in New Issue
Block a user