Skip to content

Commit d3ffd09

Browse files
Merge branch 'main' into addressable-led
2 parents b5dda59 + 58b1191 commit d3ffd09

File tree

121 files changed

+3540
-3605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+3540
-3605
lines changed

elastic-layout-tank.json

Lines changed: 360 additions & 13 deletions
Large diffs are not rendered by default.

elastic-layout-tank1.json

Lines changed: 524 additions & 0 deletions
Large diffs are not rendered by default.

scripts/autosubscoringcmds.py

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,40 @@
33
import pathlib
44

55
if len(sys.argv) < 2:
6-
raise SystemExit("Usage: python[3] " + sys.argv[0] + " <path to auto file>")
6+
raise SystemExit("Usage: python[3] " + sys.argv[0] + " <path to auto file or directory>")
77

88
in_path = pathlib.Path(sys.argv[1])
99
if not in_path.exists():
10-
raise SystemExit("Specified auto file does not exist!")
10+
raise SystemExit("Specified auto path does not exist!")
1111

12-
with open(in_path, "r+") as file:
13-
doc = json.load(file)
14-
auto_cmds = doc["command"]["data"]["commands"]
15-
for cmd in auto_cmds:
16-
if cmd["type"] == "wait":
17-
cmd["type"] = "named"
18-
if cmd["data"]["waitTime"] == 1.5:
19-
cmd["data"]["name"] = "l4"
20-
del cmd["data"]["waitTime"]
21-
elif cmd["data"]["waitTime"] == 2.5:
22-
cmd["data"]["name"] = "intake"
23-
del cmd["data"]["waitTime"]
24-
elif cmd["data"]["waitTime"] == 4.0:
25-
cmd["data"]["name"] = "l4_algae"
26-
del cmd["data"]["waitTime"]
27-
28-
file.seek(0)
29-
file.truncate()
30-
json.dump(doc, file, indent=2)
12+
def do_file(in_path):
13+
with open(in_path, "r+") as file:
14+
doc = json.load(file)
15+
auto_cmds = doc["command"]["data"]["commands"]
16+
for cmd in auto_cmds:
17+
if cmd["type"] == "wait":
18+
cmd["type"] = "named"
19+
if cmd["data"]["waitTime"] == 1.5:
20+
cmd["data"]["name"] = "l4"
21+
del cmd["data"]["waitTime"]
22+
elif cmd["data"]["waitTime"] == 2.5:
23+
cmd["data"]["name"] = "intake"
24+
del cmd["data"]["waitTime"]
25+
elif cmd["data"]["waitTime"] == 4.0:
26+
cmd["data"]["name"] = "l4_algae"
27+
del cmd["data"]["waitTime"]
28+
29+
file.seek(0)
30+
file.truncate()
31+
json.dump(doc, file, indent=2)
32+
33+
print("Wrote to \"" + in_path.__str__() + "\"!")
34+
35+
if in_path.is_file():
36+
do_file(in_path)
37+
elif in_path.is_dir():
38+
for child in in_path.iterdir():
39+
do_file(child)
3140

32-
print("Complete!")
41+
else:
42+
raise SystemExit("Unknown type of path!")

scripts/mirror-path.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import sys
2+
import json
3+
import pathlib
4+
5+
locationMirror = {
6+
"S1": "S6",
7+
"S2": "S5",
8+
"S3": "S4",
9+
"S4": "S3",
10+
"S5": "S2",
11+
"S6": "S1",
12+
"D1": "D6",
13+
"D2": "D5",
14+
"D3": "D4",
15+
"D4": "D3",
16+
"D5": "D2",
17+
"D6": "D1",
18+
"P1": "P2",
19+
"P2": "P1"
20+
}
21+
22+
if len(sys.argv) < 3:
23+
raise SystemExit("Usage: python[3] " + sys.argv[0] + " <path to auto file or directory> <path to write output>")
24+
25+
in_path = pathlib.Path(sys.argv[1])
26+
if not in_path.exists():
27+
raise SystemExit("Specified auto path does not exist!")
28+
29+
out_path = pathlib.Path(sys.argv[2])
30+
31+
def mirror(inPath):
32+
file = open(inPath)
33+
34+
doc = json.load(file)
35+
36+
for waypoint in doc["waypoints"]:
37+
waypoint["anchor"]["y"] = 8 - waypoint["anchor"]["y"]
38+
if not waypoint["prevControl"] is None:
39+
waypoint["prevControl"]["y"] = 8 - waypoint["prevControl"]["y"]
40+
if not waypoint["nextControl"] is None:
41+
waypoint["nextControl"]["y"] = 8 - waypoint["nextControl"]["y"]
42+
43+
doc["goalEndState"]["rotation"] *= -1
44+
45+
doc["idealStartingState"]["rotation"] *= -1
46+
47+
return doc
48+
49+
try:
50+
outfile = open(out_path, "x")
51+
except:
52+
raise SystemExit("Specified out path already exists")
53+
54+
json.dump(mirror(in_path), outfile, indent=2)

scripts/pathsubcorrectrot.py

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,29 @@
99
if not in_path.exists():
1010
raise SystemExit("Specified path file does not exist!")
1111

12-
with open(in_path, "r+") as file:
13-
doc = json.load(file)
14-
rot = doc["idealStartingState"]["rotation"]
15-
rot -= 180
16-
while rot < 0 or rot > 360:
17-
if rot < 0:
18-
rot += 360
19-
else:
20-
rot -= 360
21-
22-
doc["idealStartingState"]["rotation"] = rot
23-
file.seek(0)
24-
file.truncate()
25-
json.dump(doc, file, indent=2)
12+
def do_file(in_path):
13+
with open(in_path, "r+") as file:
14+
doc = json.load(file)
15+
rot = doc["idealStartingState"]["rotation"]
16+
rot -= 180
17+
while rot < 0 or rot > 360:
18+
if rot < 0:
19+
rot += 360
20+
else:
21+
rot -= 360
22+
23+
doc["idealStartingState"]["rotation"] = rot
24+
file.seek(0)
25+
file.truncate()
26+
json.dump(doc, file, indent=2)
27+
28+
print("Wrote to \"" + in_path.__str__() + "\"!")
29+
30+
if in_path.is_file():
31+
do_file(in_path)
32+
elif in_path.is_dir():
33+
for child in in_path.iterdir():
34+
do_file(child)
2635

27-
print("Complete!")
36+
else:
37+
raise SystemExit("Unknown type of path!")

src/main/deploy/pathplanner/autos/Mid Spawn D6, D6 MonoL3 Auto.auto renamed to src/main/deploy/pathplanner/autos/Center-Auto.auto

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,25 @@
77
{
88
"type": "path",
99
"data": {
10-
"pathName": "Top Spawn to D6"
10+
"pathName": "SC-C6"
1111
}
1212
},
1313
{
1414
"type": "named",
1515
"data": {
16-
"name": "l4_algae"
17-
}
18-
},
19-
{
20-
"type": "path",
21-
"data": {
22-
"pathName": "D6 to P1"
16+
"name": "l1"
2317
}
2418
},
2519
{
2620
"type": "named",
2721
"data": {
28-
"name": "intake"
29-
}
30-
},
31-
{
32-
"type": "path",
33-
"data": {
34-
"pathName": "P1 to D6 C2"
22+
"name": "stow"
3523
}
3624
}
3725
]
3826
}
3927
},
4028
"resetOdom": true,
41-
"folder": "Algae Clear",
29+
"folder": "No Algae Clear",
4230
"choreoAuto": false
4331
}

src/main/deploy/pathplanner/autos/Inner.auto

Lines changed: 0 additions & 97 deletions
This file was deleted.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"version": "2025.0",
3+
"command": {
4+
"type": "sequential",
5+
"data": {
6+
"commands": [
7+
{
8+
"type": "path",
9+
"data": {
10+
"pathName": "SL-C4"
11+
}
12+
},
13+
{
14+
"type": "named",
15+
"data": {
16+
"name": "l1"
17+
}
18+
},
19+
{
20+
"type": "parallel",
21+
"data": {
22+
"commands": [
23+
{
24+
"type": "path",
25+
"data": {
26+
"pathName": "C4-PL"
27+
}
28+
},
29+
{
30+
"type": "named",
31+
"data": {
32+
"name": "stow"
33+
}
34+
}
35+
]
36+
}
37+
},
38+
{
39+
"type": "parallel",
40+
"data": {
41+
"commands": [
42+
{
43+
"type": "wait",
44+
"data": {
45+
"waitTime": 1.0
46+
}
47+
},
48+
{
49+
"type": "named",
50+
"data": {
51+
"name": "intake"
52+
}
53+
}
54+
]
55+
}
56+
},
57+
{
58+
"type": "path",
59+
"data": {
60+
"pathName": "PL-C1"
61+
}
62+
},
63+
{
64+
"type": "named",
65+
"data": {
66+
"name": "l1"
67+
}
68+
},
69+
{
70+
"type": "named",
71+
"data": {
72+
"name": "stow"
73+
}
74+
}
75+
]
76+
}
77+
},
78+
"resetOdom": true,
79+
"folder": "No Algae Clear",
80+
"choreoAuto": false
81+
}

0 commit comments

Comments
 (0)