Skip to content

Commit 7bf9709

Browse files
fix right side auto rotation
1 parent 5fb2d5e commit 7bf9709

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

scripts/mirror-path.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def mirror(inPath):
2424
if not waypoint["nextControl"] is None:
2525
waypoint["nextControl"]["y"] = 8 - waypoint["nextControl"]["y"]
2626

27+
for rotationTarget in doc["rotationTargets"]:
28+
rotationTarget["rotationDegrees"] = -rotationTarget["rotationDegrees"]
29+
2730
doc["goalEndState"]["rotation"] *= -1
2831

2932
doc["idealStartingState"]["rotation"] *= -1

scripts/mirrorPaths.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Python mirror-path.py "../src/main/deploy/pathplanner/paths/Left Sweep & Scatter.path" "../src/main/deploy/pathplanner/paths/Right Sweep & Scatter.path"
2+
Python mirror-path.py "../src/main/deploy/pathplanner/paths/Left Sweep Reset.path" "../src/main/deploy/pathplanner/paths/Right Sweep Reset.path"
3+
Python mirror-path.py "../src/main/deploy/pathplanner/paths/Left Sweep Standard.path" "../src/main/deploy/pathplanner/paths/Right Sweep Standard.path"

src/main/deploy/pathplanner/paths/Right Sweep & Scatter.path

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,19 @@
127127
"rotationTargets": [
128128
{
129129
"waypointRelativePos": 0.5,
130-
"rotationDegrees": 0.0
130+
"rotationDegrees": -0.0
131131
},
132132
{
133133
"waypointRelativePos": 1.5,
134-
"rotationDegrees": -90.0
134+
"rotationDegrees": 90.0
135135
},
136136
{
137137
"waypointRelativePos": 4.376058041112453,
138-
"rotationDegrees": 91.0
138+
"rotationDegrees": -91.0
139139
},
140140
{
141141
"waypointRelativePos": 5.0,
142-
"rotationDegrees": 0.0
142+
"rotationDegrees": -0.0
143143
}
144144
],
145145
"constraintZones": [

src/main/deploy/pathplanner/paths/Right Sweep Standard.path

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,23 @@
127127
"rotationTargets": [
128128
{
129129
"waypointRelativePos": 0.5,
130-
"rotationDegrees": 0.0
130+
"rotationDegrees": -0.0
131131
},
132132
{
133133
"waypointRelativePos": 1.5,
134-
"rotationDegrees": -90.0
134+
"rotationDegrees": 90.0
135135
},
136136
{
137137
"waypointRelativePos": 3.0031987205117416,
138-
"rotationDegrees": -90.0
138+
"rotationDegrees": 90.0
139139
},
140140
{
141141
"waypointRelativePos": 4.376058041112453,
142-
"rotationDegrees": 91.0
142+
"rotationDegrees": -91.0
143143
},
144144
{
145145
"waypointRelativePos": 5.365453818472621,
146-
"rotationDegrees": 0.0
146+
"rotationDegrees": -0.0
147147
}
148148
],
149149
"constraintZones": [

0 commit comments

Comments
 (0)