Compare commits
11 Commits
tuning
...
a8833aaf5b
| Author | SHA1 | Date | |
|---|---|---|---|
| a8833aaf5b | |||
| 47606ade0f | |||
| a6dca0925f | |||
|
|
72a07b3d7a | ||
| 5e1eadf887 | |||
| 21c0421a88 | |||
| 81d6c36436 | |||
| f1f523de73 | |||
| 10fb8d4aa5 | |||
| 77f2c54a90 | |||
|
|
4171da889f |
37
src/main/deploy/pathplanner/autos/Center to Shoot.auto
Normal file
37
src/main/deploy/pathplanner/autos/Center to Shoot.auto
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"command": {
|
||||||
|
"type": "sequential",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intake down"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "spinup"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "Center to Shoot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "shoot close"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resetOdom": true,
|
||||||
|
"folder": null,
|
||||||
|
"choreoAuto": false
|
||||||
|
}
|
||||||
67
src/main/deploy/pathplanner/autos/Left Shoot.auto
Normal file
67
src/main/deploy/pathplanner/autos/Left Shoot.auto
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"command": {
|
||||||
|
"type": "sequential",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intake down"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "spinup"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "start to score left"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "shoot close"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "Left to Outpost"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "stop spindexer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "trough to shot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "spinup"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "shoot N jimmy"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resetOdom": true,
|
||||||
|
"folder": null,
|
||||||
|
"choreoAuto": false
|
||||||
|
}
|
||||||
25
src/main/deploy/pathplanner/autos/left to center.auto
Normal file
25
src/main/deploy/pathplanner/autos/left to center.auto
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"command": {
|
||||||
|
"type": "sequential",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intake down"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "left start to center"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resetOdom": true,
|
||||||
|
"folder": null,
|
||||||
|
"choreoAuto": false
|
||||||
|
}
|
||||||
54
src/main/deploy/pathplanner/paths/Center to Shoot.path
Normal file
54
src/main/deploy/pathplanner/paths/Center to Shoot.path
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"waypoints": [
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.622028469750891,
|
||||||
|
"y": 4.008102016607354
|
||||||
|
},
|
||||||
|
"prevControl": null,
|
||||||
|
"nextControl": {
|
||||||
|
"x": 3.266975088967973,
|
||||||
|
"y": 4.0403795966785285
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.1271055753262162,
|
||||||
|
"y": 4.008102016607354
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 4.0416370106761565,
|
||||||
|
"y": 4.0403795966785285
|
||||||
|
},
|
||||||
|
"nextControl": null,
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rotationTargets": [],
|
||||||
|
"constraintZones": [],
|
||||||
|
"pointTowardsZones": [],
|
||||||
|
"eventMarkers": [],
|
||||||
|
"globalConstraints": {
|
||||||
|
"maxVelocity": 2.0,
|
||||||
|
"maxAcceleration": 1.5,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
},
|
||||||
|
"goalEndState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": 0.0
|
||||||
|
},
|
||||||
|
"reversed": false,
|
||||||
|
"folder": null,
|
||||||
|
"idealStartingState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": 0.0
|
||||||
|
},
|
||||||
|
"useDefaultConstraints": true
|
||||||
|
}
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
"pointTowardsZones": [],
|
"pointTowardsZones": [],
|
||||||
"eventMarkers": [],
|
"eventMarkers": [],
|
||||||
"globalConstraints": {
|
"globalConstraints": {
|
||||||
"maxVelocity": 3.0,
|
"maxVelocity": 2.0,
|
||||||
"maxAcceleration": 3.0,
|
"maxAcceleration": 1.5,
|
||||||
"maxAngularVelocity": 540.0,
|
"maxAngularVelocity": 540.0,
|
||||||
"maxAngularAcceleration": 720.0,
|
"maxAngularAcceleration": 720.0,
|
||||||
"nominalVoltage": 12.0,
|
"nominalVoltage": 12.0,
|
||||||
|
|||||||
80
src/main/deploy/pathplanner/paths/Left to Outpost.path
Normal file
80
src/main/deploy/pathplanner/paths/Left to Outpost.path
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"waypoints": [
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.2515736040609142,
|
||||||
|
"y": 4.914375634517767
|
||||||
|
},
|
||||||
|
"prevControl": null,
|
||||||
|
"nextControl": {
|
||||||
|
"x": 2.4338749089244973,
|
||||||
|
"y": 5.333984175443034
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": "left close"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.77458883248731,
|
||||||
|
"y": 5.927269035532995
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 2.3777086426889733,
|
||||||
|
"y": 6.110175322602984
|
||||||
|
},
|
||||||
|
"nextControl": null,
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": "trough"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rotationTargets": [
|
||||||
|
{
|
||||||
|
"waypointRelativePos": 0.5,
|
||||||
|
"rotationDegrees": 180.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"constraintZones": [
|
||||||
|
{
|
||||||
|
"name": "Constraints Zone",
|
||||||
|
"minWaypointRelativePos": 0.3963599595551063,
|
||||||
|
"maxWaypointRelativePos": 1.0,
|
||||||
|
"constraints": {
|
||||||
|
"maxVelocity": 3.0,
|
||||||
|
"maxAcceleration": 4.0,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pointTowardsZones": [],
|
||||||
|
"eventMarkers": [
|
||||||
|
{
|
||||||
|
"name": "Intake Start",
|
||||||
|
"waypointRelativePos": 0.09706774519716882,
|
||||||
|
"endWaypointRelativePos": null,
|
||||||
|
"command": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"globalConstraints": {
|
||||||
|
"maxVelocity": 2.0,
|
||||||
|
"maxAcceleration": 1.5,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
},
|
||||||
|
"goalEndState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": 178.80651057601818
|
||||||
|
},
|
||||||
|
"reversed": false,
|
||||||
|
"folder": null,
|
||||||
|
"idealStartingState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": -31.15930450834445
|
||||||
|
},
|
||||||
|
"useDefaultConstraints": true
|
||||||
|
}
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 8.08578683847011,
|
"x": 8.08578683847011,
|
||||||
"y": 0.49077040160283747
|
"y": 0.4907704016028374
|
||||||
},
|
},
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 8.318287488908608,
|
"x": 8.318287488908608,
|
||||||
@@ -130,8 +130,8 @@
|
|||||||
"pointTowardsZones": [],
|
"pointTowardsZones": [],
|
||||||
"eventMarkers": [],
|
"eventMarkers": [],
|
||||||
"globalConstraints": {
|
"globalConstraints": {
|
||||||
"maxVelocity": 3.0,
|
"maxVelocity": 2.0,
|
||||||
"maxAcceleration": 3.0,
|
"maxAcceleration": 1.5,
|
||||||
"maxAngularVelocity": 540.0,
|
"maxAngularVelocity": 540.0,
|
||||||
"maxAngularAcceleration": 720.0,
|
"maxAngularAcceleration": 720.0,
|
||||||
"nominalVoltage": 12.0,
|
"nominalVoltage": 12.0,
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
"pointTowardsZones": [],
|
"pointTowardsZones": [],
|
||||||
"eventMarkers": [],
|
"eventMarkers": [],
|
||||||
"globalConstraints": {
|
"globalConstraints": {
|
||||||
"maxVelocity": 3.0,
|
"maxVelocity": 2.0,
|
||||||
"maxAcceleration": 3.0,
|
"maxAcceleration": 1.5,
|
||||||
"maxAngularVelocity": 540.0,
|
"maxAngularVelocity": 540.0,
|
||||||
"maxAngularAcceleration": 720.0,
|
"maxAngularAcceleration": 720.0,
|
||||||
"nominalVoltage": 12.0,
|
"nominalVoltage": 12.0,
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
},
|
},
|
||||||
"goalEndState": {
|
"goalEndState": {
|
||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
"rotation": 24.304549265936604
|
"rotation": 24.304549265936608
|
||||||
},
|
},
|
||||||
"reversed": false,
|
"reversed": false,
|
||||||
"folder": "Right Outpost",
|
"folder": "Right Outpost",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"y": 0.668228980317108
|
"y": 0.668228980317108
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 1.6987119856944102,
|
"x": 1.6987119856944104,
|
||||||
"y": 1.0414132379199703
|
"y": 1.0414132379199703
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
@@ -45,8 +45,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalConstraints": {
|
"globalConstraints": {
|
||||||
"maxVelocity": 3.0,
|
"maxVelocity": 2.0,
|
||||||
"maxAcceleration": 3.0,
|
"maxAcceleration": 1.5,
|
||||||
"maxAngularVelocity": 540.0,
|
"maxAngularVelocity": 540.0,
|
||||||
"maxAngularAcceleration": 720.0,
|
"maxAngularAcceleration": 720.0,
|
||||||
"nominalVoltage": 12.0,
|
"nominalVoltage": 12.0,
|
||||||
|
|||||||
132
src/main/deploy/pathplanner/paths/left start to center.path
Normal file
132
src/main/deploy/pathplanner/paths/left start to center.path
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"waypoints": [
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.573857868020305,
|
||||||
|
"y": 6.3692588832487305
|
||||||
|
},
|
||||||
|
"prevControl": null,
|
||||||
|
"nextControl": {
|
||||||
|
"x": 3.1594923857868027,
|
||||||
|
"y": 6.424507614213196
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": "start left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 2.634629441624366,
|
||||||
|
"y": 5.558944162436549
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 2.4136345177664977,
|
||||||
|
"y": 5.908852791878173
|
||||||
|
},
|
||||||
|
"nextControl": {
|
||||||
|
"x": 2.895419769065523,
|
||||||
|
"y": 5.146026143988051
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 4.522294416243654,
|
||||||
|
"y": 5.558944162436549
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 3.5095162657293457,
|
||||||
|
"y": 5.533304209258972
|
||||||
|
},
|
||||||
|
"nextControl": {
|
||||||
|
"x": 6.704619289340102,
|
||||||
|
"y": 5.614192893401015
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 7.478101522849547,
|
||||||
|
"y": 7.244030456855094
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 6.765542310662505,
|
||||||
|
"y": 7.465169522706244
|
||||||
|
},
|
||||||
|
"nextControl": {
|
||||||
|
"x": 8.012172588839395,
|
||||||
|
"y": 7.078284263961693
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 7.671472081218274,
|
||||||
|
"y": 4.7670456852791885
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 7.726720812182741,
|
||||||
|
"y": 7.639979695431472
|
||||||
|
},
|
||||||
|
"nextControl": null,
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rotationTargets": [
|
||||||
|
{
|
||||||
|
"waypointRelativePos": 1.5636363636363326,
|
||||||
|
"rotationDegrees": -45.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"waypointRelativePos": 3.0318181818182266,
|
||||||
|
"rotationDegrees": -90.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"constraintZones": [
|
||||||
|
{
|
||||||
|
"name": "Constraints Zone",
|
||||||
|
"minWaypointRelativePos": 2.6208291203235685,
|
||||||
|
"maxWaypointRelativePos": 4.0,
|
||||||
|
"constraints": {
|
||||||
|
"maxVelocity": 1.0,
|
||||||
|
"maxAcceleration": 1.5,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pointTowardsZones": [],
|
||||||
|
"eventMarkers": [
|
||||||
|
{
|
||||||
|
"name": "Intake Start",
|
||||||
|
"waypointRelativePos": 0,
|
||||||
|
"endWaypointRelativePos": null,
|
||||||
|
"command": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"globalConstraints": {
|
||||||
|
"maxVelocity": 2.0,
|
||||||
|
"maxAcceleration": 1.5,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
},
|
||||||
|
"goalEndState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": -89.09061955080092
|
||||||
|
},
|
||||||
|
"reversed": false,
|
||||||
|
"folder": null,
|
||||||
|
"idealStartingState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": -90.0
|
||||||
|
},
|
||||||
|
"useDefaultConstraints": true
|
||||||
|
}
|
||||||
54
src/main/deploy/pathplanner/paths/start to score left.path
Normal file
54
src/main/deploy/pathplanner/paths/start to score left.path
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"waypoints": [
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.573857868020305,
|
||||||
|
"y": 6.3692588832487305
|
||||||
|
},
|
||||||
|
"prevControl": null,
|
||||||
|
"nextControl": {
|
||||||
|
"x": 2.7991959463121194,
|
||||||
|
"y": 6.260219737341258
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": "start left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.2515736040609142,
|
||||||
|
"y": 4.914375634517767
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 3.44523908448796,
|
||||||
|
"y": 5.430816915656558
|
||||||
|
},
|
||||||
|
"nextControl": null,
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": "left close"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rotationTargets": [],
|
||||||
|
"constraintZones": [],
|
||||||
|
"pointTowardsZones": [],
|
||||||
|
"eventMarkers": [],
|
||||||
|
"globalConstraints": {
|
||||||
|
"maxVelocity": 2.0,
|
||||||
|
"maxAcceleration": 1.5,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
},
|
||||||
|
"goalEndState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": -31.15930450834445
|
||||||
|
},
|
||||||
|
"reversed": false,
|
||||||
|
"folder": null,
|
||||||
|
"idealStartingState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": -90.0
|
||||||
|
},
|
||||||
|
"useDefaultConstraints": true
|
||||||
|
}
|
||||||
54
src/main/deploy/pathplanner/paths/trough to shot.path
Normal file
54
src/main/deploy/pathplanner/paths/trough to shot.path
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"waypoints": [
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.77458883248731,
|
||||||
|
"y": 5.927269035532995
|
||||||
|
},
|
||||||
|
"prevControl": null,
|
||||||
|
"nextControl": {
|
||||||
|
"x": 1.7745888324873098,
|
||||||
|
"y": 5.927269035532995
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": "trough"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.2515736040609142,
|
||||||
|
"y": 4.914375634517767
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 2.6254213197969554,
|
||||||
|
"y": 5.420822335025381
|
||||||
|
},
|
||||||
|
"nextControl": null,
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": "left close"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rotationTargets": [],
|
||||||
|
"constraintZones": [],
|
||||||
|
"pointTowardsZones": [],
|
||||||
|
"eventMarkers": [],
|
||||||
|
"globalConstraints": {
|
||||||
|
"maxVelocity": 2.0,
|
||||||
|
"maxAcceleration": 1.5,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
},
|
||||||
|
"goalEndState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": -31.15930450834445
|
||||||
|
},
|
||||||
|
"reversed": false,
|
||||||
|
"folder": null,
|
||||||
|
"idealStartingState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": 178.80651057601818
|
||||||
|
},
|
||||||
|
"useDefaultConstraints": true
|
||||||
|
}
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
"Right Outpost"
|
"Right Outpost"
|
||||||
],
|
],
|
||||||
"autoFolders": [],
|
"autoFolders": [],
|
||||||
"defaultMaxVel": 3.0,
|
"defaultMaxVel": 2.0,
|
||||||
"defaultMaxAccel": 3.0,
|
"defaultMaxAccel": 1.5,
|
||||||
"defaultMaxAngVel": 540.0,
|
"defaultMaxAngVel": 540.0,
|
||||||
"defaultMaxAngAccel": 720.0,
|
"defaultMaxAngAccel": 720.0,
|
||||||
"defaultNominalVoltage": 12.0,
|
"defaultNominalVoltage": 12.0,
|
||||||
|
|||||||
@@ -12,12 +12,16 @@ import org.littletonrobotics.junction.Logger;
|
|||||||
|
|
||||||
import com.pathplanner.lib.auto.AutoBuilder;
|
import com.pathplanner.lib.auto.AutoBuilder;
|
||||||
import com.pathplanner.lib.auto.NamedCommands;
|
import com.pathplanner.lib.auto.NamedCommands;
|
||||||
|
import com.pathplanner.lib.events.EventTrigger;
|
||||||
|
import com.pathplanner.lib.path.EventMarker;
|
||||||
|
|
||||||
import edu.wpi.first.math.geometry.Pose2d;
|
import edu.wpi.first.math.geometry.Pose2d;
|
||||||
|
import edu.wpi.first.math.util.Units;
|
||||||
import edu.wpi.first.wpilibj.Timer;
|
import edu.wpi.first.wpilibj.Timer;
|
||||||
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.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.InstantCommand;
|
import edu.wpi.first.wpilibj2.command.InstantCommand;
|
||||||
import edu.wpi.first.wpilibj2.command.PrintCommand;
|
import edu.wpi.first.wpilibj2.command.PrintCommand;
|
||||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||||
@@ -67,9 +71,10 @@ public class RobotContainer {
|
|||||||
intakeRoller = new IntakeRoller();
|
intakeRoller = new IntakeRoller();
|
||||||
spindexer = new Spindexer();
|
spindexer = new Spindexer();
|
||||||
//climber = new Climber();
|
//climber = new Climber();
|
||||||
|
configureNamedCommands();
|
||||||
|
|
||||||
|
|
||||||
vision.addPoseEstimateConsumer(drivetrain::consumeVisualPose);
|
//vision.addPoseEstimateConsumer(drivetrain::consumeVisualPose);
|
||||||
vision.addPoseEstimateConsumer((vp) -> {
|
vision.addPoseEstimateConsumer((vp) -> {
|
||||||
Logger.recordOutput(
|
Logger.recordOutput(
|
||||||
"Vision/" + vp.cameraName() + "/Pose",
|
"Vision/" + vp.cameraName() + "/Pose",
|
||||||
@@ -77,19 +82,21 @@ public class RobotContainer {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
driver = new CommandXboxController(OIConstants.kDriverControllerPort);
|
driver = new CommandXboxController(OIConstants.kDriverControllerPort);
|
||||||
secondary = new CommandXboxController(OIConstants.kOperatorControllerPort);
|
secondary = new CommandXboxController(OIConstants.kOperatorControllerPort);
|
||||||
|
|
||||||
shiftTimer = new Timer();
|
shiftTimer = new Timer();
|
||||||
shiftTimer.reset();
|
shiftTimer.reset();
|
||||||
|
|
||||||
//configureBindings();
|
configureBindings();
|
||||||
testConfigureBindings();
|
//testConfigureBindings();
|
||||||
configureShiftDisplay();
|
configureShiftDisplay();
|
||||||
|
|
||||||
if(AutoConstants.kAutoConfigOk) {
|
if(AutoConstants.kAutoConfigOk) {
|
||||||
autoChooser = AutoBuilder.buildAutoChooser();
|
autoChooser = AutoBuilder.buildAutoChooser();
|
||||||
configureNamedCommands();
|
SmartDashboard.putData("Auto Chooser", autoChooser);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,8 +252,15 @@ public class RobotContainer {
|
|||||||
() -> true
|
() -> true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
shooter.setDefaultCommand(shooter.stop());
|
||||||
|
intakeRoller.setDefaultCommand(intakeRoller.stop());
|
||||||
|
spindexer.setDefaultCommand(spindexer.stop());
|
||||||
|
|
||||||
driver.a().whileTrue(
|
intakePivot.setDefaultCommand(intakePivot.manualSpeed(() -> secondary.getLeftY()));
|
||||||
|
|
||||||
|
driver.y().whileTrue(drivetrain.zeroHeading());
|
||||||
|
|
||||||
|
driver.leftTrigger().whileTrue(
|
||||||
drivetrain.lockRotationToHub(
|
drivetrain.lockRotationToHub(
|
||||||
driver::getLeftY,
|
driver::getLeftY,
|
||||||
driver::getLeftX,
|
driver::getLeftX,
|
||||||
@@ -254,8 +268,12 @@ public class RobotContainer {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
driver.leftBumper().whileTrue(intakeRoller.runOut());
|
||||||
driver.b().whileTrue(
|
driver.rightBumper().whileTrue(intakeRoller.runIn());
|
||||||
|
|
||||||
|
driver.rightTrigger().whileTrue(spindexer.spinToShooter());
|
||||||
|
driver.b().whileTrue(spindexer.spinToIntake());
|
||||||
|
/* driver.b().whileTrue(
|
||||||
drivetrain.lockToYaw(
|
drivetrain.lockToYaw(
|
||||||
() -> {
|
() -> {
|
||||||
OptionalDouble maybeYaw = vision.getBestYawForTag(Utilities.getHubCenterAprilTagID());
|
OptionalDouble maybeYaw = vision.getBestYawForTag(Utilities.getHubCenterAprilTagID());
|
||||||
@@ -267,10 +285,17 @@ public class RobotContainer {
|
|||||||
)
|
)
|
||||||
);*/
|
);*/
|
||||||
|
|
||||||
shooter.setDefaultCommand(
|
secondary.a().toggleOnTrue(shooter.maintainSpeed(ShooterSpeeds.kHubSpeed));
|
||||||
shooter.maintainSpeed(ShooterSpeeds.kHubSpeed)
|
secondary.x().toggleOnTrue(shooter.maintainSpeed(ShooterSpeeds.kFeedSpeed));
|
||||||
);
|
|
||||||
|
|
||||||
|
secondary.y().onTrue(hood.trackToAngle(() -> Units.degreesToRadians(40)));
|
||||||
|
//40 good for feeding
|
||||||
|
secondary.b().onTrue(hood.trackToAngle(() -> Units.degreesToRadians(30)));
|
||||||
|
//30 degrees good for shooter far near outpost
|
||||||
|
secondary.rightBumper().onTrue(hood.trackToAngle(() -> Units.degreesToRadians(10)));
|
||||||
|
//10 degrees good for shooting ~33in away from hub
|
||||||
|
|
||||||
|
/*
|
||||||
hood.setDefaultCommand(hood.trackToAngle(() -> {
|
hood.setDefaultCommand(hood.trackToAngle(() -> {
|
||||||
Pose2d drivetrainPose = drivetrain.getPose();
|
Pose2d drivetrainPose = drivetrain.getPose();
|
||||||
Pose2d hubPose = Utilities.getHubPose();
|
Pose2d hubPose = Utilities.getHubPose();
|
||||||
@@ -292,7 +317,7 @@ public class RobotContainer {
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}));
|
}));*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureNamedCommands() {
|
private void configureNamedCommands() {
|
||||||
@@ -308,14 +333,52 @@ public class RobotContainer {
|
|||||||
false // TODO Should this be true by default?
|
false // TODO Should this be true by default?
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
NamedCommands.registerCommand(
|
||||||
|
"intake down",
|
||||||
|
intakePivot.manualSpeed(()->0.75)
|
||||||
|
.withTimeout(1)
|
||||||
|
);
|
||||||
|
|
||||||
|
NamedCommands.registerCommand("spinup",
|
||||||
|
shooter.maintainSpeed(ShooterSpeeds.kHubSpeed)
|
||||||
|
.withTimeout(3));
|
||||||
|
|
||||||
|
NamedCommands.registerCommand("shoot close",
|
||||||
|
spindexer.spinToShooter()
|
||||||
|
.alongWith(shooter.maintainSpeed(ShooterSpeeds.kHubSpeed))
|
||||||
|
.alongWith(hood.trackToAngle(() -> Units.degreesToRadians(10)))
|
||||||
|
.withTimeout(3).andThen(spindexer.instantaneousStop()));
|
||||||
|
|
||||||
|
// NamedCommands.registerCommand("Intake Start", intakeRoller.runIn());
|
||||||
|
|
||||||
|
new EventTrigger("Intake Start")
|
||||||
|
.onTrue(intakeRoller.runIn());
|
||||||
|
|
||||||
|
NamedCommands.registerCommand("stop spindexer", spindexer.instantaneousStop());
|
||||||
|
|
||||||
|
NamedCommands.registerCommand("jimmy",
|
||||||
|
Commands.repeatingSequence(
|
||||||
|
intakePivot.manualSpeed(() -> -0.75).withTimeout(0.2)
|
||||||
|
.andThen(intakePivot.manualSpeed(() -> 0.75).withTimeout(0.2))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
NamedCommands.registerCommand("shoot N jimmy",
|
||||||
|
Commands.parallel(
|
||||||
|
Commands.repeatingSequence(
|
||||||
|
intakePivot.manualSpeed(() -> -0.75).withTimeout(0.5),
|
||||||
|
intakePivot.manualSpeed(() -> 0.75).withTimeout(0.5)
|
||||||
|
),
|
||||||
|
spindexer.spinToShooter()
|
||||||
|
.alongWith(shooter.maintainSpeed(ShooterSpeeds.kHubSpeed),
|
||||||
|
hood.trackToAngle(() -> Units.degreesToRadians(10)))
|
||||||
|
|
||||||
|
).withTimeout(3).andThen(spindexer.instantaneousStop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command getAutonomousCommand() {
|
public Command getAutonomousCommand() {
|
||||||
if(AutoConstants.kAutoConfigOk) {
|
|
||||||
return autoChooser.getSelected();
|
return autoChooser.getSelected();
|
||||||
} else {
|
|
||||||
return new PrintCommand("Robot Config loading failed, autonomous disabled");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class IntakePivotConstants {
|
|||||||
KLeftMotorConfig
|
KLeftMotorConfig
|
||||||
.idleMode(kIdleMode)
|
.idleMode(kIdleMode)
|
||||||
.smartCurrentLimit(kCurrentLimit)
|
.smartCurrentLimit(kCurrentLimit)
|
||||||
.inverted(kInvertMotors);
|
.inverted(false);
|
||||||
KLeftMotorConfig.encoder
|
KLeftMotorConfig.encoder
|
||||||
.positionConversionFactor(kConversionFactor)
|
.positionConversionFactor(kConversionFactor)
|
||||||
.velocityConversionFactor(kConversionFactor / 60);
|
.velocityConversionFactor(kConversionFactor / 60);
|
||||||
@@ -67,7 +67,7 @@ public class IntakePivotConstants {
|
|||||||
kRightMotorConfig
|
kRightMotorConfig
|
||||||
.idleMode(kIdleMode)
|
.idleMode(kIdleMode)
|
||||||
.smartCurrentLimit(kCurrentLimit)
|
.smartCurrentLimit(kCurrentLimit)
|
||||||
.inverted(kInvertMotors)
|
.inverted(true)
|
||||||
.follow(kLeftMotorCANID);
|
;//.follow(kLeftMotorCANID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,24 +5,32 @@ import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;
|
|||||||
|
|
||||||
public class IntakeRollerConstants {
|
public class IntakeRollerConstants {
|
||||||
// TODO Real values
|
// TODO Real values
|
||||||
public static final int kMotorCANID = 20;
|
public static final int kRightMotorCANID = 20;
|
||||||
|
public static final int kLeftMotorCANID = 1;
|
||||||
|
|
||||||
public static final int kCurrentLimit = 40;
|
public static final int kCurrentLimit = 65;
|
||||||
|
|
||||||
public static final boolean kInvertMotors = true;
|
public static final boolean kInvertLeftMotor = false;
|
||||||
|
public static final boolean kInvertRightMotor = true;
|
||||||
|
|
||||||
public static final double kSpeed = .6;
|
public static final double kSpeed = 1;
|
||||||
|
|
||||||
public static final IdleMode kIdleMode = IdleMode.kCoast;
|
public static final IdleMode kIdleMode = IdleMode.kCoast;
|
||||||
|
|
||||||
// YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE UNLESS YOU'RE ADDING A CONFIGURATION ITEM
|
// YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE UNLESS YOU'RE ADDING A CONFIGURATION ITEM
|
||||||
|
|
||||||
public static final SparkMaxConfig leftMotorConfig = new SparkMaxConfig();
|
public static final SparkMaxConfig leftMotorConfig = new SparkMaxConfig();
|
||||||
|
public static final SparkMaxConfig rightMotorConfig = new SparkMaxConfig();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
leftMotorConfig
|
leftMotorConfig
|
||||||
.idleMode(kIdleMode)
|
.idleMode(kIdleMode)
|
||||||
.smartCurrentLimit(kCurrentLimit)
|
.smartCurrentLimit(kCurrentLimit)
|
||||||
.inverted(kInvertMotors);
|
.inverted(kInvertLeftMotor);
|
||||||
|
rightMotorConfig
|
||||||
|
.idleMode(kIdleMode)
|
||||||
|
.smartCurrentLimit(kCurrentLimit)
|
||||||
|
.inverted(kInvertRightMotor)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package frc.robot.constants;
|
package frc.robot.constants;
|
||||||
|
|
||||||
import com.ctre.phoenix6.configs.AudioConfigs;
|
import com.ctre.phoenix6.configs.AudioConfigs;
|
||||||
|
import com.ctre.phoenix6.configs.ClosedLoopRampsConfigs;
|
||||||
import com.ctre.phoenix6.configs.CurrentLimitsConfigs;
|
import com.ctre.phoenix6.configs.CurrentLimitsConfigs;
|
||||||
import com.ctre.phoenix6.configs.FeedbackConfigs;
|
import com.ctre.phoenix6.configs.FeedbackConfigs;
|
||||||
import com.ctre.phoenix6.configs.MotorOutputConfigs;
|
import com.ctre.phoenix6.configs.MotorOutputConfigs;
|
||||||
@@ -34,7 +35,7 @@ public class ModuleConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DRIVING MOTOR CONFIG (Kraken)
|
// DRIVING MOTOR CONFIG (Kraken)
|
||||||
public static final double kDrivingMotorReduction = (14.0 * 28.0 * 15.0) / (50 * 16 * 45);
|
public static final double kDrivingMotorReduction = (50 * 16 * 45)/(14.0 * 28.0 * 15.0);
|
||||||
|
|
||||||
public static final double kDrivingMotorFeedSpeedRPS = KrakenMotorConstants.kFreeSpeedRPM / 60;
|
public static final double kDrivingMotorFeedSpeedRPS = KrakenMotorConstants.kFreeSpeedRPM / 60;
|
||||||
public static final double kWheelDiameterMeters = Units.inchesToMeters(4);
|
public static final double kWheelDiameterMeters = Units.inchesToMeters(4);
|
||||||
@@ -45,16 +46,17 @@ public class ModuleConstants {
|
|||||||
public static final double kDrivingVelocityFeedForward = 1 / kDriveWheelFreeSpeedRPS;
|
public static final double kDrivingVelocityFeedForward = 1 / kDriveWheelFreeSpeedRPS;
|
||||||
|
|
||||||
// TODO Hold over from 2025, adjust?
|
// TODO Hold over from 2025, adjust?
|
||||||
public static final double kDriveP = .04;
|
public static final double kDriveP = .06;
|
||||||
public static final double kDriveI = 0;
|
public static final double kDriveI = 0;
|
||||||
public static final double kDriveD = 0;
|
public static final double kDriveD = 0;
|
||||||
public static final double kDriveS = 0;
|
public static final double kDriveS = 0;
|
||||||
public static final double kDriveV = kDrivingVelocityFeedForward;
|
public static final double kDriveV = kDrivingVelocityFeedForward;
|
||||||
public static final double kDriveA = 0;
|
public static final double kDriveA = 0;
|
||||||
|
public static final double kClosedLoopRampRate = .01;
|
||||||
|
|
||||||
// TODO Hold over from 2025, adjust?
|
// TODO Hold over from 2025, adjust?
|
||||||
public static final int kDriveMotorStatorCurrentLimit = 100;
|
public static final int kDriveMotorStatorCurrentLimit = 90;
|
||||||
public static final int kDriveMotorSupplyCurrentLimit = 65;
|
public static final int kDriveMotorSupplyCurrentLimit = 55;
|
||||||
|
|
||||||
// TODO Hold over from 2025, adjust?
|
// TODO Hold over from 2025, adjust?
|
||||||
public static final InvertedValue kDriveInversionState = InvertedValue.Clockwise_Positive;
|
public static final InvertedValue kDriveInversionState = InvertedValue.Clockwise_Positive;
|
||||||
@@ -88,6 +90,7 @@ public class ModuleConstants {
|
|||||||
public static final MotorOutputConfigs kDriveMotorConfig = new MotorOutputConfigs();
|
public static final MotorOutputConfigs kDriveMotorConfig = new MotorOutputConfigs();
|
||||||
public static final AudioConfigs kAudioConfig = new AudioConfigs();
|
public static final AudioConfigs kAudioConfig = new AudioConfigs();
|
||||||
public static final Slot0Configs kDriveSlot0Config = new Slot0Configs();
|
public static final Slot0Configs kDriveSlot0Config = new Slot0Configs();
|
||||||
|
public static final ClosedLoopRampsConfigs kDriveClosedLoopRampConfig = new ClosedLoopRampsConfigs();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
kDriveFeedConfig.SensorToMechanismRatio = kDrivingMotorReduction;
|
kDriveFeedConfig.SensorToMechanismRatio = kDrivingMotorReduction;
|
||||||
@@ -109,6 +112,8 @@ public class ModuleConstants {
|
|||||||
kDriveSlot0Config.kV = kDriveV;
|
kDriveSlot0Config.kV = kDriveV;
|
||||||
kDriveSlot0Config.kA = kDriveA;
|
kDriveSlot0Config.kA = kDriveA;
|
||||||
|
|
||||||
|
kDriveClosedLoopRampConfig.withVoltageClosedLoopRampPeriod(kClosedLoopRampRate);
|
||||||
|
|
||||||
turningConfig
|
turningConfig
|
||||||
.idleMode(kTurnIdleMode)
|
.idleMode(kTurnIdleMode)
|
||||||
.smartCurrentLimit(kTurnMotorCurrentLimit)
|
.smartCurrentLimit(kTurnMotorCurrentLimit)
|
||||||
|
|||||||
@@ -8,19 +8,28 @@ import edu.wpi.first.math.util.Units;
|
|||||||
import frc.robot.utilities.PhotonVisionConfig;
|
import frc.robot.utilities.PhotonVisionConfig;
|
||||||
|
|
||||||
public class PhotonConstants {
|
public class PhotonConstants {
|
||||||
public static final String kCamera1Name = "pv1";
|
public static final String kCamera1Name = "CameraPV1";
|
||||||
public static final String kCamera2Name = "pv2";
|
public static final String kCamera2Name = "CameraPV2";
|
||||||
|
|
||||||
// TODO Need actual values for all of this
|
// TODO Need actual values for all of this
|
||||||
public static final Transform3d kCamera1RobotToCam = new Transform3d();
|
public static final Transform3d kCamera1RobotToCam = new Transform3d(
|
||||||
|
Units.inchesToMeters(1.5),
|
||||||
|
Units.inchesToMeters(-8.5),
|
||||||
|
Units.inchesToMeters(28.5),
|
||||||
|
new Rotation3d(
|
||||||
|
Units.degreesToRadians(0),
|
||||||
|
Units.degreesToRadians(24.0),
|
||||||
|
Units.degreesToRadians(30.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
public static final Transform3d kCamera2RobotToCam = new Transform3d(
|
public static final Transform3d kCamera2RobotToCam = new Transform3d(
|
||||||
Units.inchesToMeters(1.5),
|
Units.inchesToMeters(1.5),
|
||||||
Units.inchesToMeters(-10.5),
|
Units.inchesToMeters(-10.5),
|
||||||
Units.inchesToMeters(28.5),
|
Units.inchesToMeters(28.5),
|
||||||
new Rotation3d(
|
new Rotation3d(
|
||||||
Units.degreesToRadians(0),
|
Units.degreesToRadians(0.0),
|
||||||
Units.degreesToRadians(24),
|
Units.degreesToRadians(24.0),
|
||||||
Units.degreesToRadians(-10)
|
Units.degreesToRadians(-10.0)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -32,7 +41,7 @@ public class PhotonConstants {
|
|||||||
// YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE UNLESS YOU'RE ADDING A CONFIGURATION ITEM
|
// YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE UNLESS YOU'RE ADDING A CONFIGURATION ITEM
|
||||||
|
|
||||||
public static final List<PhotonVisionConfig> configs = List.of(
|
public static final List<PhotonVisionConfig> configs = List.of(
|
||||||
//new PhotonVisionConfig(kCamera1Name, kCamera1RobotToCam, kCamera1HeightMeters, kCamera1PitchRadians),
|
new PhotonVisionConfig(kCamera1Name, kCamera1RobotToCam, kCamera1HeightMeters, kCamera1PitchRadians),
|
||||||
new PhotonVisionConfig(kCamera2Name, kCamera2RobotToCam, kCamera2HeightMeters, kCamera2PitchRadians)
|
new PhotonVisionConfig(kCamera2Name, kCamera2RobotToCam, kCamera2HeightMeters, kCamera2PitchRadians)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,8 @@ import edu.wpi.first.math.util.Units;
|
|||||||
public class ShooterConstants {
|
public class ShooterConstants {
|
||||||
public enum ShooterSpeeds {
|
public enum ShooterSpeeds {
|
||||||
kHubSpeed(3000.0),
|
kHubSpeed(3000.0),
|
||||||
kFeedSpeed(5000.0);
|
kFeedSpeed(5000.0),
|
||||||
|
kIdleSpeed(750.0);
|
||||||
|
|
||||||
private double speedMPS;
|
private double speedMPS;
|
||||||
private double speedRPM;
|
private double speedRPM;
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ public class SpindexerConstants {
|
|||||||
public static final int kSpindexerMotorCANID = 0;
|
public static final int kSpindexerMotorCANID = 0;
|
||||||
public static final int kFeederMotorCANID = 4;
|
public static final int kFeederMotorCANID = 4;
|
||||||
|
|
||||||
public static final int kSpindexerStatorCurrentLimit = 110;
|
public static final int kSpindexerStatorCurrentLimit = 95;
|
||||||
public static final int kSpindexerSupplyCurrentLimit = 60;
|
public static final int kSpindexerSupplyCurrentLimit = 50;
|
||||||
public static final int kFeederCurrentLimit = 40;
|
public static final int kFeederCurrentLimit = 30;
|
||||||
|
|
||||||
public static final double kSpindexerSpeed = 1;
|
public static final double kSpindexerSpeed = 1;
|
||||||
public static final double kFeederSpeed = 1;
|
public static final double kFeederSpeed = 1;
|
||||||
|
|
||||||
public static final boolean kFeederMotorInverted = true;
|
public static final boolean kFeederMotorInverted = false;
|
||||||
|
|
||||||
public static final InvertedValue kSpindexerInversionState = InvertedValue.Clockwise_Positive;
|
public static final InvertedValue kSpindexerInversionState = InvertedValue.Clockwise_Positive;
|
||||||
public static final NeutralModeValue kSpindexerIdleMode = NeutralModeValue.Coast;
|
public static final NeutralModeValue kSpindexerIdleMode = NeutralModeValue.Coast;
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ public class Drivetrain extends SubsystemBase {
|
|||||||
Logger.recordOutput("Drivetrain/Pose", getPose());
|
Logger.recordOutput("Drivetrain/Pose", getPose());
|
||||||
Logger.recordOutput("Drivetrain/Gyro Angle", getGyroValue());
|
Logger.recordOutput("Drivetrain/Gyro Angle", getGyroValue());
|
||||||
Logger.recordOutput("Drivetrain/Heading", getHeadingDegrees());
|
Logger.recordOutput("Drivetrain/Heading", getHeadingDegrees());
|
||||||
|
Logger.recordOutput("Drivetrain/Velocity", getCurrentChassisSpeeds());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -331,6 +332,10 @@ public class Drivetrain extends SubsystemBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void consumeVisualPose(VisualPose pose) {
|
public void consumeVisualPose(VisualPose pose) {
|
||||||
|
if(Math.abs(pose.visualPose().minus(getPose()).getTranslation().getNorm()) > 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
estimator.addVisionMeasurement(
|
estimator.addVisionMeasurement(
|
||||||
pose.visualPose(),
|
pose.visualPose(),
|
||||||
pose.timestamp()
|
pose.timestamp()
|
||||||
@@ -375,7 +380,8 @@ public class Drivetrain extends SubsystemBase {
|
|||||||
SwerveModuleState[] swerveModuleStates = DrivetrainConstants.kDriveKinematics.toSwerveModuleStates(
|
SwerveModuleState[] swerveModuleStates = DrivetrainConstants.kDriveKinematics.toSwerveModuleStates(
|
||||||
fieldRelative ?
|
fieldRelative ?
|
||||||
ChassisSpeeds.fromFieldRelativeSpeeds(xSpeedDelivered, ySpeedDelivered, rotationDelivered,
|
ChassisSpeeds.fromFieldRelativeSpeeds(xSpeedDelivered, ySpeedDelivered, rotationDelivered,
|
||||||
estimator.getEstimatedPosition().getRotation()) :
|
//estimator.getEstimatedPosition().getRotation()) :
|
||||||
|
Rotation2d.fromDegrees(getGyroValue())) :
|
||||||
new ChassisSpeeds(xSpeedDelivered, ySpeedDelivered, rotationDelivered)
|
new ChassisSpeeds(xSpeedDelivered, ySpeedDelivered, rotationDelivered)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ public class Hood extends SubsystemBase {
|
|||||||
|
|
||||||
private SparkClosedLoopController controller;
|
private SparkClosedLoopController controller;
|
||||||
|
|
||||||
private Trigger resetTrigger;
|
//private Trigger resetTrigger;
|
||||||
private Trigger timerTrigger;
|
//private Trigger timerTrigger;
|
||||||
|
|
||||||
private Timer resetTimer;
|
//private Timer resetTimer;
|
||||||
|
|
||||||
private double currentTargetDegrees;
|
private double currentTargetDegrees;
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ public class Hood extends SubsystemBase {
|
|||||||
|
|
||||||
controller = motor.getClosedLoopController();
|
controller = motor.getClosedLoopController();
|
||||||
|
|
||||||
resetTimer = new Timer();
|
/*resetTimer = new Timer();
|
||||||
resetTimer.reset();
|
resetTimer.reset();
|
||||||
|
|
||||||
resetTrigger = new Trigger(() -> (motor.getOutputCurrent() > HoodConstants.kAmpsToTriggerPositionReset));
|
resetTrigger = new Trigger(() -> (motor.getOutputCurrent() > HoodConstants.kAmpsToTriggerPositionReset));
|
||||||
@@ -61,7 +61,7 @@ public class Hood extends SubsystemBase {
|
|||||||
timerTrigger.onTrue(new InstantCommand(() -> {
|
timerTrigger.onTrue(new InstantCommand(() -> {
|
||||||
encoder.setPosition(0);
|
encoder.setPosition(0);
|
||||||
resetTimer.reset();
|
resetTimer.reset();
|
||||||
}));
|
}));*/
|
||||||
|
|
||||||
currentTargetDegrees = HoodConstants.kStartupAngle;
|
currentTargetDegrees = HoodConstants.kStartupAngle;
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ public class Hood extends SubsystemBase {
|
|||||||
*
|
*
|
||||||
* @return A complete Command structure that performs the specified action
|
* @return A complete Command structure that performs the specified action
|
||||||
*/
|
*/
|
||||||
public Command automatedRezero() {
|
/*public Command automatedRezero() {
|
||||||
return manualSpeed(() -> -1)
|
return manualSpeed(() -> -1)
|
||||||
.until(timerTrigger)
|
.until(timerTrigger)
|
||||||
.andThen(
|
.andThen(
|
||||||
@@ -112,11 +112,11 @@ public class Hood extends SubsystemBase {
|
|||||||
*
|
*
|
||||||
* @return A complete Command structure that performs the specified action
|
* @return A complete Command structure that performs the specified action
|
||||||
*/
|
*/
|
||||||
public Command automatedRezeroNoTimer() {
|
/*public Command automatedRezeroNoTimer() {
|
||||||
return manualSpeed(() -> -1)
|
return manualSpeed(() -> -1)
|
||||||
.until(() -> motor.getOutputCurrent() >= HoodConstants.kAmpsToTriggerPositionReset)
|
.until(() -> motor.getOutputCurrent() >= HoodConstants.kAmpsToTriggerPositionReset)
|
||||||
.andThen(new InstantCommand(() -> encoder.setPosition(0)));
|
.andThen(new InstantCommand(() -> encoder.setPosition(0)));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public Command manualSpeed(DoubleSupplier speed) {
|
public Command manualSpeed(DoubleSupplier speed) {
|
||||||
currentTargetDegrees = 0;
|
currentTargetDegrees = 0;
|
||||||
|
|||||||
@@ -76,9 +76,17 @@ public class IntakePivot extends SubsystemBase {
|
|||||||
currentTargetPosition = null;
|
currentTargetPosition = null;
|
||||||
|
|
||||||
leftMotor.set(speed.getAsDouble() * IntakePivotConstants.kMaxManualSpeedMultiplier);
|
leftMotor.set(speed.getAsDouble() * IntakePivotConstants.kMaxManualSpeedMultiplier);
|
||||||
|
rightMotor.set(speed.getAsDouble() * IntakePivotConstants.kMaxManualSpeedMultiplier);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public Command jimmy(){
|
||||||
|
// return run(() -> {
|
||||||
|
// leftMotor.set(0.5 * IntakePivotConstants.kMaxManualSpeedMultiplier);
|
||||||
|
// rightMotor.set(0.5 * IntakePivotConstants.kMaxManualSpeedMultiplier);
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
public Command stop() {
|
public Command stop() {
|
||||||
return manualSpeed(() -> 0);
|
return manualSpeed(() -> 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,33 +10,44 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|||||||
import frc.robot.constants.IntakeRollerConstants;
|
import frc.robot.constants.IntakeRollerConstants;
|
||||||
|
|
||||||
public class IntakeRoller extends SubsystemBase {
|
public class IntakeRoller extends SubsystemBase {
|
||||||
private SparkMax motor;
|
private SparkMax leftMotor;
|
||||||
|
private SparkMax rightMotor;
|
||||||
|
|
||||||
public IntakeRoller() {
|
public IntakeRoller() {
|
||||||
motor = new SparkMax(IntakeRollerConstants.kMotorCANID, MotorType.kBrushless);
|
leftMotor = new SparkMax(IntakeRollerConstants.kLeftMotorCANID, MotorType.kBrushless);
|
||||||
|
rightMotor = new SparkMax(IntakeRollerConstants.kRightMotorCANID, MotorType.kBrushless);
|
||||||
|
|
||||||
motor.configure(
|
leftMotor.configure(
|
||||||
IntakeRollerConstants.leftMotorConfig,
|
IntakeRollerConstants.leftMotorConfig,
|
||||||
ResetMode.kResetSafeParameters,
|
ResetMode.kResetSafeParameters,
|
||||||
PersistMode.kPersistParameters
|
PersistMode.kPersistParameters
|
||||||
);
|
);
|
||||||
|
|
||||||
|
rightMotor.configure(
|
||||||
|
IntakeRollerConstants.rightMotorConfig,
|
||||||
|
ResetMode.kResetSafeParameters,
|
||||||
|
PersistMode.kPersistParameters
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command runIn() {
|
public Command runIn() {
|
||||||
return run(() -> {
|
return run(() -> {
|
||||||
motor.set(IntakeRollerConstants.kSpeed);
|
leftMotor.set(IntakeRollerConstants.kSpeed*0.8);
|
||||||
|
rightMotor.set(IntakeRollerConstants.kSpeed*0.8);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command runOut() {
|
public Command runOut() {
|
||||||
return run(() -> {
|
return run(() -> {
|
||||||
motor.set(-IntakeRollerConstants.kSpeed);
|
leftMotor.set(-IntakeRollerConstants.kSpeed);
|
||||||
|
rightMotor.set(-IntakeRollerConstants.kSpeed);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command stop() {
|
public Command stop() {
|
||||||
return run(() -> {
|
return run(() -> {
|
||||||
motor.set(0);
|
leftMotor.set(0);
|
||||||
|
rightMotor.set(0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,4 +60,11 @@ public class Spindexer extends SubsystemBase {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Command instantaneousStop() {
|
||||||
|
return runOnce(() -> {
|
||||||
|
spindexerMotor.setControl(spindexerMotorOutput.withOutput(0));
|
||||||
|
feederMotor.set(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ public class SwerveModule {
|
|||||||
drive.getConfigurator().apply(ModuleConstants.kDriveMotorConfig);
|
drive.getConfigurator().apply(ModuleConstants.kDriveMotorConfig);
|
||||||
drive.getConfigurator().apply(ModuleConstants.kAudioConfig);
|
drive.getConfigurator().apply(ModuleConstants.kAudioConfig);
|
||||||
drive.getConfigurator().apply(ModuleConstants.kDriveSlot0Config);
|
drive.getConfigurator().apply(ModuleConstants.kDriveSlot0Config);
|
||||||
|
drive.getConfigurator().apply(ModuleConstants.kDriveClosedLoopRampConfig);
|
||||||
|
|
||||||
turning.configure(
|
turning.configure(
|
||||||
ModuleConstants.turningConfig,
|
ModuleConstants.turningConfig,
|
||||||
|
|||||||
Reference in New Issue
Block a user