├── .DS_Store
├── .idea
├── .gitignore
├── AWS-Deepracer-Optimal-Path-Generator.iml
├── inspectionProfiles
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── .ipynb_checkpoints
└── ImproveWaypointsGeneratedReinvent2019-checkpoint.ipynb
├── CubicSpline
├── .DS_Store
├── IMG
│ ├── a*.png
│ ├── plot of the track.png
│ ├── rear wheel feedback.png
│ └── result.png
├── __pycache__
│ └── cubic_spline_planner.cpython-36.pyc
├── a_star.py
├── cubic_spline_planner.py
├── rear_wheel_feedback.py
└── track_planner.py
├── ImproveWaypointsGeneratedReinvent2019.ipynb
├── Pipfile
├── README.md
├── all_waypoints.py
├── data
├── .DS_Store
├── _reinvent_waypoints2019_4__10__20191206-102941.png
├── _reinvent_waypoints2019_4__10__20191206-102941SP.txt
├── _reinvent_waypoints2019_4__10__20191206-102941WP.txt
├── _reinvent_waypoints2019_5__10__20191206-164237.png
├── _reinvent_waypoints2019_5__10__20191206-164237SP.txt
└── _reinvent_waypoints2019_5__10__20191206-164237WP.txt
├── generate_track.py
├── requirements.txt
└── shortest_path_points.csv
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/.DS_Store
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /workspace.xml
--------------------------------------------------------------------------------
/.idea/AWS-Deepracer-Optimal-Path-Generator.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CubicSpline/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/CubicSpline/.DS_Store
--------------------------------------------------------------------------------
/CubicSpline/IMG/a*.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/CubicSpline/IMG/a*.png
--------------------------------------------------------------------------------
/CubicSpline/IMG/plot of the track.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/CubicSpline/IMG/plot of the track.png
--------------------------------------------------------------------------------
/CubicSpline/IMG/rear wheel feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/CubicSpline/IMG/rear wheel feedback.png
--------------------------------------------------------------------------------
/CubicSpline/IMG/result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/CubicSpline/IMG/result.png
--------------------------------------------------------------------------------
/CubicSpline/__pycache__/cubic_spline_planner.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/CubicSpline/__pycache__/cubic_spline_planner.cpython-36.pyc
--------------------------------------------------------------------------------
/CubicSpline/a_star.py:
--------------------------------------------------------------------------------
1 | """
2 | A* grid planning
3 | author: Atsushi Sakai(@Atsushi_twi)
4 | Nikos Kanargias (nkana@tee.gr)
5 | See Wikipedia article (https://en.wikipedia.org/wiki/A*_search_algorithm)
6 | """
7 |
8 | import math
9 | import pandas as pd
10 | import matplotlib.pyplot as plt
11 |
12 | show_animation = True
13 |
14 |
15 | class AStarPlanner:
16 |
17 | def __init__(self, ox, oy, reso, rr):
18 | """
19 | Initialize grid map for a star planning
20 | ox: x position list of Obstacles [m]
21 | oy: y position list of Obstacles [m]
22 | reso: grid resolution [m]
23 | rr: robot radius[m]
24 | """
25 |
26 | self.reso = reso
27 | self.rr = rr
28 | self.calc_obstacle_map(ox, oy)
29 | self.motion = self.get_motion_model()
30 |
31 | class Node:
32 | def __init__(self, x, y, cost, pind):
33 | self.x = x # index of grid
34 | self.y = y # index of grid
35 | self.cost = cost
36 | self.pind = pind
37 |
38 | def __str__(self):
39 | return str(self.x) + "," + str(self.y) + "," + str(self.cost) + "," + str(self.pind)
40 |
41 | def planning(self, sx, sy, gx, gy):
42 | """
43 | A star path search
44 | input:
45 | sx: start x position [m]
46 | sy: start y position [m]
47 | gx: goal x position [m]
48 | gx: goal x position [m]
49 | output:
50 | rx: x position list of the final path
51 | ry: y position list of the final path
52 | """
53 |
54 | nstart = self.Node(self.calc_xyindex(sx, self.minx),
55 | self.calc_xyindex(sy, self.miny), 0.0, -1)
56 | ngoal = self.Node(self.calc_xyindex(gx, self.minx),
57 | self.calc_xyindex(gy, self.miny), 0.0, -1)
58 |
59 | open_set, closed_set = dict(), dict()
60 | open_set[self.calc_grid_index(nstart)] = nstart
61 |
62 | while 1:
63 | if len(open_set) == 0:
64 | print("Open set is empty..")
65 | break
66 |
67 | c_id = min(
68 | open_set, key=lambda o: open_set[o].cost + self.calc_heuristic(ngoal, open_set[o]))
69 | current = open_set[c_id]
70 |
71 | # show graph
72 | if show_animation: # pragma: no cover
73 | plt.plot(self.calc_grid_position(current.x, self.minx),
74 | self.calc_grid_position(current.y, self.miny), "xc")
75 | if len(closed_set.keys()) % 10 == 0:
76 | plt.pause(0.001)
77 |
78 | if current.x == ngoal.x and current.y == ngoal.y:
79 | print("Find goal")
80 | ngoal.pind = current.pind
81 | ngoal.cost = current.cost
82 | break
83 |
84 | # Remove the item from the open set
85 | del open_set[c_id]
86 |
87 | # Add it to the closed set
88 | closed_set[c_id] = current
89 |
90 | # expand_grid search grid based on motion model
91 | for i, _ in enumerate(self.motion):
92 | node = self.Node(current.x + self.motion[i][0],
93 | current.y + self.motion[i][1],
94 | current.cost + self.motion[i][2], c_id)
95 | n_id = self.calc_grid_index(node)
96 |
97 |
98 | # If the node is not safe, do nothing
99 | if not self.verify_node(node):
100 | continue
101 |
102 | if n_id in closed_set:
103 | continue
104 |
105 | if n_id not in open_set:
106 | open_set[n_id] = node # discovered a new node
107 | else:
108 | if open_set[n_id].cost > node.cost:
109 | # This path is the best until now. record it
110 | open_set[n_id] = node
111 |
112 | rx, ry = self.calc_final_path(ngoal, closed_set)
113 |
114 | return rx, ry
115 |
116 | def calc_final_path(self, ngoal, closedset):
117 | # generate final course
118 | rx, ry = [self.calc_grid_position(ngoal.x, self.minx)], [
119 | self.calc_grid_position(ngoal.y, self.miny)]
120 | pind = ngoal.pind
121 | while pind != -1:
122 | n = closedset[pind]
123 | rx.append(self.calc_grid_position(n.x, self.minx))
124 | ry.append(self.calc_grid_position(n.y, self.miny))
125 | pind = n.pind
126 |
127 | return rx, ry
128 |
129 | @staticmethod
130 | def calc_heuristic(n1, n2):
131 | w = 1.0 # weight of heuristic
132 | d = w * math.sqrt((n1.x - n2.x) ** 2 + (n1.y - n2.y) ** 2)
133 | return d
134 |
135 | def calc_grid_position(self, index, minp):
136 | """
137 | calc grid position
138 | :param index:
139 | :param minp:
140 | :return:
141 | """
142 | pos = index * self.reso + minp
143 | return pos
144 |
145 | def calc_xyindex(self, position, min_pos):
146 | return round((position - min_pos) / self.reso)
147 |
148 | def calc_grid_index(self, node):
149 | return (node.y - self.miny) * self.xwidth + (node.x - self.minx)
150 |
151 | def verify_node(self, node):
152 | px = self.calc_grid_position(node.x, self.minx)
153 | py = self.calc_grid_position(node.y, self.miny)
154 |
155 | if px < self.minx:
156 | return False
157 | elif py < self.miny:
158 | return False
159 | elif px >= self.maxx:
160 | return False
161 | elif py >= self.maxy:
162 | return False
163 |
164 | # collision check
165 | try:
166 | if self.obmap[node.x][node.y]:
167 | return False
168 | except:
169 | print("out")
170 |
171 | return True
172 |
173 | def calc_obstacle_map(self, ox, oy):
174 |
175 | self.minx = round(min(ox))
176 | self.miny = round(min(oy))
177 | self.maxx = round(max(ox))
178 | self.maxy = round(max(oy))
179 | print("minx:", self.minx)
180 | print("miny:", self.miny)
181 | print("maxx:", self.maxx)
182 | print("maxy:", self.maxy)
183 |
184 | self.xwidth = round((self.maxx - self.minx) / self.reso)
185 | self.ywidth = round((self.maxy - self.miny) / self.reso)
186 | print("xwidth:", self.xwidth)
187 | print("ywidth:", self.ywidth)
188 |
189 | # obstacle map generation
190 | self.obmap = [[False for i in range(self.ywidth)]
191 | for i in range(self.xwidth)]
192 | for ix in range(self.xwidth):
193 | x = self.calc_grid_position(ix, self.minx)
194 | for iy in range(self.ywidth):
195 | y = self.calc_grid_position(iy, self.miny)
196 | for iox, ioy in zip(ox, oy):
197 | d = math.sqrt((iox - x) ** 2 + (ioy - y) ** 2)
198 | if d <= self.rr:
199 | self.obmap[ix][iy] = True
200 | break
201 |
202 | @staticmethod
203 | def get_motion_model():
204 | # dx, dy, cost
205 | motion = [[1, 0, 1],
206 | [0, 1, 1],
207 | [-1, 0, 1],
208 | [0, -1, 1],
209 | [-1, -1, math.sqrt(2)],
210 | [-1, 1, math.sqrt(2)],
211 | [1, -1, math.sqrt(2)],
212 | [1, 1, math.sqrt(2)]]
213 |
214 | return motion
215 |
216 |
217 | def main():
218 | print(__file__ + " start!!")
219 |
220 | all_coordinates = pd.read_csv('all_coordinates_scaled.csv')
221 |
222 |
223 | # start and goal position
224 | sx = int(all_coordinates.X_central.iloc[100]) # [m]
225 | sy = int(all_coordinates.Y_central.iloc[100]) # [m]
226 | gx = int(all_coordinates.X_central.iloc[len(all_coordinates)-100]) # [m]
227 | gy = int(all_coordinates.Y_central.iloc[len(all_coordinates)-100]) # [m]
228 | grid_size = 2.0 # [m]
229 | robot_radius = 1.0 # [m]
230 |
231 |
232 |
233 | # set obstable positions
234 |
235 | ox = [int(round(x)) for x in all_coordinates.X_ext[1:]]+[int(round(x)) for x in all_coordinates.X_int[:-1]]+[int(all_coordinates.X_central.iloc[0])]*10
236 | oy = [int(round(x)) for x in all_coordinates.Y_ext[1:]]+[int(round(x)) for x in all_coordinates.Y_int[:-1]]+[x for x in range(0,10)]
237 |
238 | if show_animation: # pragma: no cover
239 | plt.plot(ox, oy, ".k")
240 | plt.plot(sx, sy, "og")
241 | plt.plot(gx, gy, "xb")
242 | plt.grid(True)
243 | plt.axis("equal")
244 |
245 | a_star = AStarPlanner(ox, oy, grid_size, robot_radius)
246 | rx, ry = a_star.planning(sx, sy, gx, gy)
247 |
248 | if show_animation: # pragma: no cover
249 | plt.plot(rx, ry, "-r")
250 | plt.show()
251 |
252 |
253 | if __name__ == '__main__':
254 | main()
255 |
--------------------------------------------------------------------------------
/CubicSpline/cubic_spline_planner.py:
--------------------------------------------------------------------------------
1 | """
2 | Cubic spline planner
3 |
4 | Author: Atsushi Sakai(@Atsushi_twi)
5 |
6 | """
7 | import math
8 | import numpy as np
9 | import bisect
10 |
11 |
12 | class Spline:
13 | """
14 | Cubic Spline class
15 | """
16 |
17 | def __init__(self, x, y):
18 | self.b, self.c, self.d, self.w = [], [], [], []
19 |
20 | self.x = x
21 | self.y = y
22 |
23 | self.nx = len(x) # dimension of x
24 | h = np.diff(x)
25 |
26 | # calc coefficient c
27 | self.a = [iy for iy in y]
28 |
29 | # calc coefficient c
30 | A = self.__calc_A(h)
31 | B = self.__calc_B(h)
32 | self.c = np.linalg.solve(A, B)
33 | # print(self.c1)
34 |
35 | # calc spline coefficient b and d
36 | for i in range(self.nx - 1):
37 | self.d.append((self.c[i + 1] - self.c[i]) / (3.0 * h[i]))
38 | tb = (self.a[i + 1] - self.a[i]) / h[i] - h[i] * \
39 | (self.c[i + 1] + 2.0 * self.c[i]) / 3.0
40 | self.b.append(tb)
41 |
42 | def calc(self, t):
43 | """
44 | Calc position
45 |
46 | if t is outside of the input x, return None
47 |
48 | """
49 |
50 | if t < self.x[0]:
51 | return None
52 | elif t > self.x[-1]:
53 | return None
54 |
55 | i = self.__search_index(t)
56 | dx = t - self.x[i]
57 | result = self.a[i] + self.b[i] * dx + \
58 | self.c[i] * dx ** 2.0 + self.d[i] * dx ** 3.0
59 |
60 | return result
61 |
62 | def calcd(self, t):
63 | """
64 | Calc first derivative
65 |
66 | if t is outside of the input x, return None
67 | """
68 |
69 | if t < self.x[0]:
70 | return None
71 | elif t > self.x[-1]:
72 | return None
73 |
74 | i = self.__search_index(t)
75 | dx = t - self.x[i]
76 | result = self.b[i] + 2.0 * self.c[i] * dx + 3.0 * self.d[i] * dx ** 2.0
77 | return result
78 |
79 | def calcdd(self, t):
80 | """
81 | Calc second derivative
82 | """
83 |
84 | if t < self.x[0]:
85 | return None
86 | elif t > self.x[-1]:
87 | return None
88 |
89 | i = self.__search_index(t)
90 | dx = t - self.x[i]
91 | result = 2.0 * self.c[i] + 6.0 * self.d[i] * dx
92 | return result
93 |
94 | def __search_index(self, x):
95 | """
96 | search data segment index
97 | """
98 | return bisect.bisect(self.x, x) - 1
99 |
100 | def __calc_A(self, h):
101 | """
102 | calc matrix A for spline coefficient c
103 | """
104 | A = np.zeros((self.nx, self.nx))
105 | A[0, 0] = 1.0
106 | for i in range(self.nx - 1):
107 | if i != (self.nx - 2):
108 | A[i + 1, i + 1] = 2.0 * (h[i] + h[i + 1])
109 | A[i + 1, i] = h[i]
110 | A[i, i + 1] = h[i]
111 |
112 | A[0, 1] = 0.0
113 | A[self.nx - 1, self.nx - 2] = 0.0
114 | A[self.nx - 1, self.nx - 1] = 1.0
115 | # print(A)
116 | return A
117 |
118 | def __calc_B(self, h):
119 | """
120 | calc matrix B for spline coefficient c
121 | """
122 | B = np.zeros(self.nx)
123 | for i in range(self.nx - 2):
124 | B[i + 1] = 3.0 * (self.a[i + 2] - self.a[i + 1]) / \
125 | h[i + 1] - 3.0 * (self.a[i + 1] - self.a[i]) / h[i]
126 | return B
127 |
128 |
129 | class Spline2D:
130 | """
131 | 2D Cubic Spline class
132 |
133 | """
134 |
135 | def __init__(self, x, y):
136 | self.s = self.__calc_s(x, y)
137 | self.sx = Spline(self.s, x)
138 | self.sy = Spline(self.s, y)
139 |
140 | def __calc_s(self, x, y):
141 | dx = np.diff(x)
142 | dy = np.diff(y)
143 | self.ds = [math.sqrt(idx ** 2 + idy ** 2)
144 | for (idx, idy) in zip(dx, dy)]
145 | s = [0]
146 | s.extend(np.cumsum(self.ds))
147 | return s
148 |
149 | def calc_position(self, s):
150 | """
151 | calc position
152 | """
153 | x = self.sx.calc(s)
154 | y = self.sy.calc(s)
155 |
156 | return x, y
157 |
158 | def calc_curvature(self, s):
159 | """
160 | calc curvature
161 | """
162 | dx = self.sx.calcd(s)
163 | ddx = self.sx.calcdd(s)
164 | dy = self.sy.calcd(s)
165 | ddy = self.sy.calcdd(s)
166 | k = (ddy * dx - ddx * dy) / ((dx ** 2 + dy ** 2)**(3 / 2))
167 | return k
168 |
169 | def calc_yaw(self, s):
170 | """
171 | calc yaw
172 | """
173 | dx = self.sx.calcd(s)
174 | dy = self.sy.calcd(s)
175 | yaw = math.atan2(dy, dx)
176 | return yaw
177 |
178 |
179 | def calc_spline_course(x, y, ds=0.1):
180 | sp = Spline2D(x, y)
181 | s = list(np.arange(0, sp.s[-1], ds))
182 |
183 | rx, ry, ryaw, rk = [], [], [], []
184 | for i_s in s:
185 | ix, iy = sp.calc_position(i_s)
186 | rx.append(ix)
187 | ry.append(iy)
188 | ryaw.append(sp.calc_yaw(i_s))
189 | rk.append(sp.calc_curvature(i_s))
190 |
191 | return rx, ry, ryaw, rk, s
192 |
193 |
194 | def main():
195 | print("Spline 2D test")
196 | import matplotlib.pyplot as plt
197 | x = [-2.5, 0.0, 2.5, 5.0, 7.5, 3.0, -1.0]
198 | y = [0.7, -6, 5, 6.5, 0.0, 5.0, -2.0]
199 | ds = 0.1 # [m] distance of each intepolated points
200 |
201 | sp = Spline2D(x, y)
202 | s = np.arange(0, sp.s[-1], ds)
203 |
204 | rx, ry, ryaw, rk = [], [], [], []
205 | for i_s in s:
206 | ix, iy = sp.calc_position(i_s)
207 | rx.append(ix)
208 | ry.append(iy)
209 | ryaw.append(sp.calc_yaw(i_s))
210 | rk.append(sp.calc_curvature(i_s))
211 |
212 | plt.subplots(1)
213 | plt.plot(x, y, "xb", label="input")
214 | plt.plot(rx, ry, "-r", label="spline")
215 | plt.grid(True)
216 | plt.axis("equal")
217 | plt.xlabel("x[m]")
218 | plt.ylabel("y[m]")
219 | plt.legend()
220 |
221 | plt.subplots(1)
222 | plt.plot(s, [np.rad2deg(iyaw) for iyaw in ryaw], "-r", label="yaw")
223 | plt.grid(True)
224 | plt.legend()
225 | plt.xlabel("line length[m]")
226 | plt.ylabel("yaw angle[deg]")
227 |
228 | plt.subplots(1)
229 | plt.plot(s, rk, "-r", label="curvature")
230 | plt.grid(True)
231 | plt.legend()
232 | plt.xlabel("line length[m]")
233 | plt.ylabel("curvature [1/m]")
234 |
235 | plt.show()
236 |
237 |
238 | if __name__ == '__main__':
239 | main()
240 |
--------------------------------------------------------------------------------
/CubicSpline/rear_wheel_feedback.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | Path tracking simulation with rear wheel feedback steering control and PID speed control.
4 |
5 | author: Atsushi Sakai(@Atsushi_twi)
6 |
7 | """
8 | import pandas as pd
9 | import matplotlib.pyplot as plt
10 | import math
11 | import numpy as np
12 | import sys
13 | sys.path.append("CubicSpline/")
14 |
15 | from CubicSpline import cubic_spline_planner
16 |
17 |
18 | Kp = 0.1 # speed propotional gain
19 | # steering control parameter
20 | KTH = 1.0
21 | KE = 0.5
22 |
23 | dt = 0.1 # [s]
24 | L = 1 # [m]
25 |
26 | show_animation = True
27 | # show_animation = False
28 |
29 |
30 | class State:
31 |
32 | def __init__(self, x=0.0, y=0.0, yaw=0.0, v=0.0):
33 | self.x = x
34 | self.y = y
35 | self.yaw = yaw
36 | self.v = v
37 | print("HERE")
38 |
39 |
40 | def update(state, a, delta):
41 |
42 | state.x = state.x + state.v * math.cos(state.yaw) * dt
43 | state.y = state.y + state.v * math.sin(state.yaw) * dt
44 | state.yaw = state.yaw + state.v / L * math.tan(delta) * dt
45 | state.v = state.v + a * dt
46 |
47 | return state
48 |
49 |
50 | def PIDControl(target, current):
51 | a = Kp * (target - current)
52 |
53 | return a
54 |
55 |
56 | def pi_2_pi(angle):
57 | while(angle > math.pi):
58 | angle = angle - 2.0 * math.pi
59 |
60 | while(angle < -math.pi):
61 | angle = angle + 2.0 * math.pi
62 |
63 | return angle
64 |
65 |
66 | def rear_wheel_feedback_control(state, cx, cy, cyaw, ck, preind):
67 | ind, e = calc_nearest_index(state, cx, cy, cyaw)
68 |
69 | k = ck[ind]
70 | v = state.v
71 | th_e = pi_2_pi(state.yaw - cyaw[ind])
72 |
73 | omega = v * k * math.cos(th_e) / (1.0 - k * e) - \
74 | KTH * abs(v) * th_e - KE * v * math.sin(th_e) * e / th_e
75 |
76 | if th_e == 0.0 or omega == 0.0:
77 | return 0.0, ind
78 |
79 | delta = math.atan2(L * omega / v, 1.0)
80 | # print(k, v, e, th_e, omega, delta)
81 |
82 | return delta, ind
83 |
84 |
85 | def calc_nearest_index(state, cx, cy, cyaw):
86 | dx = [state.x - icx for icx in cx]
87 | dy = [state.y - icy for icy in cy]
88 |
89 | d = [idx ** 2 + idy ** 2 for (idx, idy) in zip(dx, dy)]
90 |
91 | mind = min(d)
92 |
93 | ind = d.index(mind)
94 |
95 | mind = math.sqrt(mind)
96 |
97 | dxl = cx[ind] - state.x
98 | dyl = cy[ind] - state.y
99 |
100 | angle = pi_2_pi(cyaw[ind] - math.atan2(dyl, dxl))
101 | if angle < 0:
102 | mind *= -1
103 |
104 | return ind, mind
105 |
106 |
107 | def closed_loop_prediction(cx, cy, cyaw, ck, speed_profile, goal,ax,ay):
108 |
109 | T = 500.0 # max simulation time
110 | goal_dis = 0.3
111 | stop_speed = 0.05
112 |
113 | state = State(x=ax[0], y=ay[0], yaw=0.0, v=0.0)
114 |
115 | time = 0.0
116 | x = [state.x]
117 | y = [state.y]
118 | yaw = [state.yaw]
119 | v = [state.v]
120 | t = [0.0]
121 | goal_flag = False
122 | target_ind = calc_nearest_index(state, cx, cy, cyaw)
123 |
124 | while T >= time:
125 | di, target_ind = rear_wheel_feedback_control(
126 | state, cx, cy, cyaw, ck, target_ind)
127 | ai = PIDControl(speed_profile[target_ind], state.v)
128 | state = update(state, ai, di)
129 |
130 | if abs(state.v) <= stop_speed:
131 | target_ind += 1
132 |
133 | time = time + dt
134 |
135 | # check goal
136 | dx = state.x - goal[0]
137 | dy = state.y - goal[1]
138 | if math.sqrt(dx ** 2 + dy ** 2) <= goal_dis:
139 | print("Goal")
140 | goal_flag = True
141 | break
142 |
143 | x.append(state.x)
144 | y.append(state.y)
145 | yaw.append(state.yaw)
146 | v.append(state.v)
147 | t.append(time)
148 |
149 | if target_ind % 1 == 0 and show_animation:
150 | plt.cla()
151 | plt.plot(cx, cy, "-r", label="course")
152 | plt.plot(x, y, "ob", label="trajectory")
153 | plt.plot(cx[target_ind], cy[target_ind], "xg", label="target")
154 | plt.axis("equal")
155 | plt.grid(True)
156 | plt.title("speed[km/h]:" + str(round(state.v * 3.6, 2)) +
157 | ",target index:" + str(target_ind))
158 | plt.pause(0.0001)
159 |
160 | return t, x, y, yaw, v, goal_flag
161 |
162 |
163 | def calc_speed_profile(cx, cy, cyaw, target_speed):
164 |
165 | speed_profile = [target_speed] * len(cx)
166 |
167 | direction = 1.0
168 |
169 | # Set stop point
170 | for i in range(len(cx) - 1):
171 | dyaw = cyaw[i + 1] - cyaw[i]
172 | switch = math.pi / 4.0 <= dyaw < math.pi / 2.0
173 |
174 | if switch:
175 | direction *= -1
176 |
177 | if direction != 1.0:
178 | speed_profile[i] = - target_speed
179 | else:
180 | speed_profile[i] = target_speed
181 |
182 | if switch:
183 | speed_profile[i] = 0.0
184 |
185 | speed_profile[-1] = 0.0
186 | return speed_profile
187 |
188 |
189 | def main():
190 | print("rear wheel feedback tracking start!!")
191 | data = pd.read_csv('shortest_path_points.csv')
192 | data = data.loc[data.groupby(data.index//2).xr.idxmax(), :]
193 | ax = np.flip(np.array(data.xr))
194 | ay = np.flip(np.array(data.yr))
195 | goal = [ax[-1], ay[-1]]
196 |
197 | cx, cy, cyaw, ck, s = cubic_spline_planner.calc_spline_course(
198 | ax, ay, ds=0.1)
199 | target_speed = 4
200 |
201 | sp = calc_speed_profile(cx, cy, cyaw, target_speed)
202 |
203 | t, x, y, yaw, v, goal_flag = closed_loop_prediction(
204 | cx, cy, cyaw, ck, sp, goal,ax,ay)
205 |
206 | # Test
207 | assert goal_flag, "Cannot goal"
208 |
209 | if show_animation: # pragma: no cover
210 | plt.close()
211 | plt.subplots(1)
212 | plt.plot(ax, ay, "xb", label="input")
213 | plt.plot(cx, cy, "-r", label="spline")
214 | plt.plot(x, y, "-g", label="tracking")
215 | plt.grid(True)
216 | plt.axis("equal")
217 | plt.xlabel("x[m]")
218 | plt.ylabel("y[m]")
219 | plt.legend()
220 |
221 | plt.subplots(1)
222 | plt.plot(s, [np.rad2deg(iyaw) for iyaw in cyaw], "-r", label="yaw")
223 | plt.grid(True)
224 | plt.legend()
225 | plt.xlabel("line length[m]")
226 | plt.ylabel("yaw angle[deg]")
227 |
228 | plt.subplots(1)
229 | plt.plot(s, ck, "-r", label="curvature")
230 | plt.grid(True)
231 | plt.legend()
232 | plt.xlabel("line length[m]")
233 | plt.ylabel("curvature [1/m]")
234 |
235 | plt.show()
236 |
237 | return cx,cy
238 |
--------------------------------------------------------------------------------
/CubicSpline/track_planner.py:
--------------------------------------------------------------------------------
1 | """
2 | Cubic spline planner
3 |
4 | Author: Atsushi Sakai(@Atsushi_twi)
5 |
6 | """
7 | import math
8 | import numpy as np
9 | import bisect
10 |
11 |
12 | class Spline:
13 | """
14 | Cubic Spline class
15 | """
16 |
17 | def __init__(self, x, y):
18 | self.b, self.c, self.d, self.w = [], [], [], []
19 |
20 | self.x = x
21 | self.y = y
22 |
23 | self.nx = len(x) # dimension of x
24 | h = np.diff(x)
25 |
26 | # calc coefficient c
27 | self.a = [iy for iy in y]
28 |
29 | # calc coefficient c
30 | A = self.__calc_A(h)
31 | B = self.__calc_B(h)
32 | self.c = np.linalg.solve(A, B)
33 | # print(self.c1)
34 |
35 | # calc spline coefficient b and d
36 | for i in range(self.nx - 1):
37 | self.d.append((self.c[i + 1] - self.c[i]) / (3.0 * h[i]))
38 | tb = (self.a[i + 1] - self.a[i]) / h[i] - h[i] * \
39 | (self.c[i + 1] + 2.0 * self.c[i]) / 3.0
40 | self.b.append(tb)
41 |
42 | def calc(self, t):
43 | """
44 | Calc position
45 |
46 | if t is outside of the input x, return None
47 |
48 | """
49 |
50 | if t < self.x[0]:
51 | return None
52 | elif t > self.x[-1]:
53 | return None
54 |
55 | i = self.__search_index(t)
56 | dx = t - self.x[i]
57 | result = self.a[i] + self.b[i] * dx + \
58 | self.c[i] * dx ** 2.0 + self.d[i] * dx ** 3.0
59 |
60 | return result
61 |
62 | def calcd(self, t):
63 | """
64 | Calc first derivative
65 |
66 | if t is outside of the input x, return None
67 | """
68 |
69 | if t < self.x[0]:
70 | return None
71 | elif t > self.x[-1]:
72 | return None
73 |
74 | i = self.__search_index(t)
75 | dx = t - self.x[i]
76 | result = self.b[i] + 2.0 * self.c[i] * dx + 3.0 * self.d[i] * dx ** 2.0
77 | return result
78 |
79 | def calcdd(self, t):
80 | """
81 | Calc second derivative
82 | """
83 |
84 | if t < self.x[0]:
85 | return None
86 | elif t > self.x[-1]:
87 | return None
88 |
89 | i = self.__search_index(t)
90 | dx = t - self.x[i]
91 | result = 2.0 * self.c[i] + 6.0 * self.d[i] * dx
92 | return result
93 |
94 | def __search_index(self, x):
95 | """
96 | search data segment index
97 | """
98 | return bisect.bisect(self.x, x) - 1
99 |
100 | def __calc_A(self, h):
101 | """
102 | calc matrix A for spline coefficient c
103 | """
104 | A = np.zeros((self.nx, self.nx))
105 | A[0, 0] = 1.0
106 | for i in range(self.nx - 1):
107 | if i != (self.nx - 2):
108 | A[i + 1, i + 1] = 2.0 * (h[i] + h[i + 1])
109 | A[i + 1, i] = h[i]
110 | A[i, i + 1] = h[i]
111 |
112 | A[0, 1] = 0.0
113 | A[self.nx - 1, self.nx - 2] = 0.0
114 | A[self.nx - 1, self.nx - 1] = 1.0
115 | # print(A)
116 | return A
117 |
118 | def __calc_B(self, h):
119 | """
120 | calc matrix B for spline coefficient c
121 | """
122 | B = np.zeros(self.nx)
123 | for i in range(self.nx - 2):
124 | B[i + 1] = 3.0 * (self.a[i + 2] - self.a[i + 1]) / \
125 | h[i + 1] - 3.0 * (self.a[i + 1] - self.a[i]) / h[i]
126 | return B
127 |
128 |
129 | class Spline2D:
130 | """
131 | 2D Cubic Spline class
132 |
133 | """
134 |
135 | def __init__(self, x, y):
136 | self.s = self.__calc_s(x, y)
137 | self.sx = Spline(self.s, x)
138 | self.sy = Spline(self.s, y)
139 |
140 | def __calc_s(self, x, y):
141 | dx = np.diff(x)
142 | dy = np.diff(y)
143 | self.ds = [math.sqrt(idx ** 2 + idy ** 2)
144 | for (idx, idy) in zip(dx, dy)]
145 | s = [0]
146 | s.extend(np.cumsum(self.ds))
147 | return s
148 |
149 | def calc_position(self, s):
150 | """
151 | calc position
152 | """
153 | x = self.sx.calc(s)
154 | y = self.sy.calc(s)
155 |
156 | return x, y
157 |
158 | def calc_curvature(self, s):
159 | """
160 | calc curvature
161 | """
162 | dx = self.sx.calcd(s)
163 | ddx = self.sx.calcdd(s)
164 | dy = self.sy.calcd(s)
165 | ddy = self.sy.calcdd(s)
166 | k = (ddy * dx - ddx * dy) / ((dx ** 2 + dy ** 2)**(3 / 2))
167 | return k
168 |
169 | def calc_yaw(self, s):
170 | """
171 | calc yaw
172 | """
173 | dx = self.sx.calcd(s)
174 | dy = self.sy.calcd(s)
175 | yaw = math.atan2(dy, dx)
176 | return yaw
177 |
178 |
179 | def calc_spline_course(x, y, ds=0.1):
180 | sp = Spline2D(x, y)
181 | s = list(np.arange(0, sp.s[-1], ds))
182 |
183 | rx, ry, ryaw, rk = [], [], [], []
184 | for i_s in s:
185 | ix, iy = sp.calc_position(i_s)
186 | rx.append(ix)
187 | ry.append(iy)
188 | ryaw.append(sp.calc_yaw(i_s))
189 | rk.append(sp.calc_curvature(i_s))
190 |
191 | return rx, ry, ryaw, rk, s
192 |
193 |
194 | def main():
195 | print("Spline 2D test")
196 | import matplotlib.pyplot as plt
197 | import pandas as pd
198 | import numpy as np
199 |
200 | shortest_path_points = pd.read_csv('shortest_path_points.csv')
201 |
202 | x = np.array(shortest_path_points.xr)
203 | y = np.array(shortest_path_points.yr)
204 | ds = 0.1 # [m] distance of each intepolated points
205 |
206 | sp = Spline2D(x, y)
207 | s = np.arange(0, sp.s[-1], ds)
208 |
209 | rx, ry, ryaw, rk = [], [], [], []
210 | for i_s in s:
211 | ix, iy = sp.calc_position(i_s)
212 | rx.append(ix)
213 | ry.append(iy)
214 | ryaw.append(sp.calc_yaw(i_s))
215 | rk.append(sp.calc_curvature(i_s))
216 |
217 | plt.subplots(1)
218 | plt.plot(x, y, "xb", label="input")
219 | plt.plot(rx, ry, "-r", label="spline")
220 | plt.grid(True)
221 | plt.axis("equal")
222 | plt.xlabel("x[m]")
223 | plt.ylabel("y[m]")
224 | plt.legend()
225 |
226 | plt.subplots(1)
227 | plt.plot(s, [np.rad2deg(iyaw) for iyaw in ryaw], "-r", label="yaw")
228 | plt.grid(True)
229 | plt.legend()
230 | plt.xlabel("line length[m]")
231 | plt.ylabel("yaw angle[deg]")
232 |
233 | plt.subplots(1)
234 | plt.plot(s, rk, "-r", label="curvature")
235 | plt.grid(True)
236 | plt.legend()
237 | plt.xlabel("line length[m]")
238 | plt.ylabel("curvature [1/m]")
239 |
240 | plt.show()
241 |
242 |
243 | if __name__ == '__main__':
244 | main()
245 |
--------------------------------------------------------------------------------
/Pipfile:
--------------------------------------------------------------------------------
1 | [[source]]
2 | name = "pypi"
3 | url = "https://pypi.org/simple"
4 | verify_ssl = true
5 |
6 | [dev-packages]
7 |
8 | [packages]
9 | appnope = "==0.1.0"
10 | attrs = "==19.1.0"
11 | backcall = "==0.1.0"
12 | bleach = "==3.3.0"
13 | certifi = "==2019.9.11"
14 | chardet = "==3.0.4"
15 | cvxpy = "==1.0.25"
16 | decorator = "==4.4.0"
17 | defusedxml = "==0.6.0"
18 | dill = "==0.3.1.1"
19 | ecos = "==2.0.7.post1"
20 | entrypoints = "==0.3"
21 | future = "==0.17.1"
22 | idna = "==2.8"
23 | ipykernel = "==5.1.2"
24 | ipython = "==7.8.0"
25 | ipywidgets = "==7.5.1"
26 | jedi = "==0.15.1"
27 | json5 = "==0.8.5"
28 | jsonschema = "==3.0.2"
29 | jupyter = "==1.0.0"
30 | jupyter-client = "==5.3.3"
31 | jupyter-core = "==4.5.0"
32 | jupyterlab = "==1.2.21"
33 | jupyterlab-server = "==1.0.6"
34 | kiwisolver = "==1.1.0"
35 | lab = "==4.2"
36 | matplotlib = "==3.1.1"
37 | mistune = "==0.8.4"
38 | multiprocess = "==0.70.9"
39 | nbconvert = "==5.6.0"
40 | nbformat = "==4.4.0"
41 | notebook = "==6.0.1"
42 | numpy = "==1.17.2"
43 | osqp = "==0.6.1"
44 | panda = "==0.3.1"
45 | pandas = "==0.25.1"
46 | pandocfilters = "==1.4.2"
47 | parso = "==0.5.1"
48 | pexpect = "==4.7.0"
49 | pickleshare = "==0.7.5"
50 | prompt-toolkit = "==2.0.9"
51 | ptyprocess = "==0.6.0"
52 | pyparsing = "==2.4.2"
53 | pyrsistent = "==0.15.4"
54 | python-dateutil = "==2.8.0"
55 | pytz = "==2019.2"
56 | pyzmq = "==18.1.0"
57 | qtconsole = "==4.5.5"
58 | requests = "==2.22.0"
59 | scipy = "==1.3.1"
60 | scs = "==2.1.1.post2"
61 | seaborn = "==0.9.0"
62 | simplejson = "==3.16.0"
63 | six = "==1.12.0"
64 | terminado = "==0.8.2"
65 | testpath = "==0.4.2"
66 | tornado = "==6.0.3"
67 | traitlets = "==4.3.2"
68 | urllib3 = "==1.25.6"
69 | wcwidth = "==0.1.7"
70 | webencodings = "==0.5.1"
71 | widgetsnbextension = "==3.5.1"
72 | Cycler = "==0.10.0"
73 | ipython_genutils = "==0.2.0"
74 | Jinja2 = "==2.10.1"
75 | jupyter_console = "==6.0.0"
76 | MarkupSafe = "==1.1.1"
77 | prometheus_client = "==0.7.1"
78 | Pygments = "==2.4.2"
79 | Send2Trash = "==1.5.0"
80 | Shapely = "==1.6.4.post2"
81 |
82 | [requires]
83 | python_version = "3.7"
84 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AWS Deepracer Optimal Path Generator
2 |
3 | This repository presents the method used by the French Deepracer team for the world final at the Reinvent in Las Vegas.
4 | Our approach was to generate the optimal path of an AWS Deepracer track given a certain set of waypoints.
5 |
6 |
7 |
8 | ## STEP 1 : Generate a first set of custom waypoints
9 |
10 | Run the generate_track.py file to generate the track, and select your track using inquierer (for Windows users, you have to modify the code to select the the track you want. Cf init function in the generate_track.py class).
11 |
12 | As the A* and the rear wheel feedback only accept integers, we have to multiply all coordinates by a coefficient that you must enter, then, you need to interpolate all waypoints to build the barriers. 14 and 5 should works pretty well for most of the track.
13 | Once you have enter these two values, a plot should open and a* start and reer wheel will be running once you have closed the plot window.
14 |
15 | #### Plot of the track
16 | 
17 |
18 | #### A start & Rear wheel
19 | 
20 |
21 | 
22 |
23 | ## STEP 2 : Improve the waypoints quality
24 |
25 | Open the jupyter notebook and load the waypoints generated in the data folder.
26 |
27 | #### Result
28 | 
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/all_waypoints.py:
--------------------------------------------------------------------------------
1 |
2 | kumo_torraku = [(3.9968843292236325, -2.398085115814209), (4.108486819458006, -2.398085115814209), (4.220117408752442, -2.398085115814209), (4.331728619384766, -2.3980848251342772), (4.443350294494627, -2.398085115814209), (4.554988441467286, -2.398085115814209), (4.666571746826172, -2.398085115814209), (4.7781641601562495, -2.398085115814209), (4.8896753768920895, -2.398085115814209), (5.001236978149414, -2.398085115814209), (5.112820671081545, -2.398085115814209), (5.22445222930908, -2.398085115814209), (5.336061114501954, -2.398085115814209), (5.4476612792968755, -2.3980848251342772), (5.559263769531249, -2.398085115814209), (5.670884088134765, -2.398085115814209), (5.782510801696777, -2.398085115814209), (5.894127050781252, -2.398085115814209), (6.00181679534912, -2.398085115814209), (6.173943692016602, -2.398085115814209), (6.345643870544436, -2.398085115814209), (6.537344378662107, -2.398085115814209), (6.768550421142578, -2.398085115814209), (6.98473063659668, -2.398085115814209), (7.162758142089844, -2.398085115814209), (7.274807891845702, -2.398085115814209), (7.3869537597656265, -2.398085115814209), (7.499844155883789, -2.398085115814209), (7.61068235168457, -2.384343028259277), (7.715040710449218, -2.3489811363220214), (7.806151428222655, -2.289116379547119), (7.879453155517577, -2.2083449531555175), (7.931933673095703, -2.1111327667236326), (7.969687957763672, -2.0054785568237286), (8.009337475585937, -1.9026145835876465), (8.063614782714842, -1.8110042839050309), (8.13654327697754, -1.734422282028198), (8.224194903564452, -1.670004508590698), (8.315116873168945, -1.6062793285369872), (8.397656408691406, -1.5321647148132325), (8.462792355346679, -1.44245458984375), (8.509496481323243, -1.3409916938781739), (8.540622875976563, -1.2328676250457764), (8.560585998535156, -1.12199483833313), (8.572986404418945, -1.010168572998047), (8.580685159301758, -0.8628370136260985), (8.583536148071289, -0.7021988536834717), (8.58443454284668, -0.5753229497909546), (8.584472137451172, -0.3747735631942749), (8.584492291259764, -0.19896346716880797), (8.584528335571289, -0.00428482018969953), (8.584556240844726, 0.2119464259147644), (8.58433532409668, 0.3881836337089538), (8.584120608520507, 0.5002564319610595), (8.580803369140625, 0.6122315738677978), (8.571400067138672, 0.7239659116744994), (8.555663430786133, 0.8350995351791382), (8.531425762939453, 0.9447460159301757), (8.500583847045899, 1.0525313941955565), (8.46601541442871, 1.1590160766601563), (8.431132659912109, 1.2648468261718748), (8.40480791015625, 1.3722508808135987), (8.388611611938476, 1.4806030849456786), (8.405742349243162, 1.6502103195190427), (8.463046215820313, 1.8476967147827148), (8.53134553527832, 2.0626024925231934), (8.55994340209961, 2.291900899505615), (8.514377191162108, 2.4563697364807124), (8.426188388061522, 2.610280400085449), (8.300192977905272, 2.7344502433776854), (8.126715969848632, 2.814492935180664), (7.936248913574218, 2.8448311027526856), (7.69728442993164, 2.842157622528076), (7.414035440063476, 2.8335633796691893), (7.165993991088866, 2.8013261032104495), (6.971922503662109, 2.736647105407715), (6.792461752319335, 2.6331662124633786), (6.649091239929199, 2.4822172866821286), (6.649091239929199, 2.4822172866821286), (6.544510801696777, 2.30300177230835), (6.491997534179687, 2.1105175910949705), (6.481333262634276, 1.915810774230957), (6.498144058227538, 1.7427884864807128), (6.531408113098145, 1.5830480915069578), (6.566860212707519, 1.4499332515716552), (6.603410694885254, 1.3282434410095214), (6.641890516662597, 1.2071183731079103), (6.678002847290038, 1.0942358253479), (6.713907051086426, 0.9754661369323733), (6.748999676513671, 0.8351240734100341), (6.771528340148926, 0.6824846742630002), (6.770214854431152, 0.5170887620925904), (6.739964762878418, 0.35214239854812623), (6.678730709838867, 0.20278325449079276), (6.584536071777343, 0.073577370595932), (6.465435395812988, -0.022756241798400884), (6.332671018981934, -0.08443354539871215), (6.192271061706543, -0.11442267904281617), (6.048808113098144, -0.11327295513153077), (5.9084566024780285, -0.0796875414848329), (5.777142330932618, -0.017066400146484362), (5.654321920776367, 0.04993410081863381), (5.543534690856934, 0.08980346956253056), (5.431823098754883, 0.10004641265869134), (5.321303681945801, 0.08101749906539898), (5.223240675354005, 0.0331226148605349), (5.136034951782227, -0.03443096523284911), (5.057559121704101, -0.11292725191116332), (4.981652514648437, -0.19307756190299985), (4.901582789611815, -0.265934788107872), (4.813124816894531, -0.3229467545032501), (4.716816741943359, -0.3564500641271472), (4.6162901260375975, -0.3593997144155204), (4.51511413116455, -0.3368315144300461), (4.416144396972657, -0.29576415982246396), (4.317549252319336, -0.247266593170166), (4.215311694335938, -0.20396510591506956), (4.107997895812988, -0.18035982437133785), (3.999729116821289, -0.184920810508728), (3.8959674270629883, -0.2160716101646423), (3.800001385498047, -0.27164925882816315), (3.709108677673339, -0.33655119952783036), (3.616933296203613, -0.3951910578489304), (3.518029643249511, -0.4385550443172457), (3.4129790786743164, -0.46291566977500914), (3.3047851013183593, -0.4704929507255554), (3.1941414672851565, -0.4655450453758239), (3.0825288032531737, -0.45816466374397274), (2.9700563079833975, -0.4528322554588317), (2.8574543632507323, -0.4456599219322205), (2.7442044929504394, -0.4349176088809967), (2.6292975532531737, -0.4197862710952759), (2.5105101333618163, -0.40448946981430056), (2.3889220123291004, -0.39316141550540923), (2.26488229675293, -0.38975981838703155), (2.1411589378356934, -0.4009938316822052), (2.020786827850342, -0.4341942760944366), (1.8794536911010733, -0.5233404517173774), (1.7949362239837645, -0.6104808813095093), (1.7206921123504637, -0.7506510318756103), (1.6887726943969725, -0.8770849569320678), (1.6724089160919189, -1.0758010009765624), (1.6601904273986814, -1.2993672481536864), (1.6567321598052978, -1.5105078002929688), (1.6593520095825194, -1.6933875289916993), (1.6648058433532715, -1.8153231094360351), (1.6874392971038819, -1.9510643394470213), (1.7280409854888914, -2.050013919830322), (1.7906410888671873, -2.1427592277526855), (1.870859399795532, -2.223833251953125), (1.9645064453124998, -2.2893214057922364), (2.0718011558532714, -2.3412403297424316), (2.18892162322998, -2.375639586639404), (2.3153282485961912, -2.3939165718078614), (2.429082545471191, -2.398216987609863), (2.542245696258545, -2.3981534255981445), (2.6547331130981444, -2.398104203796387), (2.766569309997559, -2.398085115814209), (2.878082949066162, -2.398085115814209), (2.990368634033203, -2.398085115814209), (3.102650637054443, -2.398085115814209), (3.214940197753906, -2.398085115814209), (3.3272259796142576, -2.398085115814209), (3.438768783569336, -2.398085115814209), (3.5503902648925783, -2.398085115814209), (3.6620016693115236, -2.398085115814209), (3.7736411727905272, -2.3980848251342772), (3.8852564529418943, -2.398085115814209), (3.9968843292236325, -2.398085115814209)]
3 |
4 | AWS_track = [(5.0722947888590255, 1.1759856661360077), (5.303676205435295, 1.1785574568001176), (5.534803373967762, 1.1786600668147467), (5.765770862326377, 1.1771811842337423), (5.9967431953504615, 1.1757910074774716), (6.22785776775271, 1.1757222616744694), (6.459056249760877, 1.176512087485847), (6.690249693316957, 1.1772585050946243), (6.921371629610718, 1.1772961965919715), (7.152448219835691, 1.1768728212766535), (7.383527135500088, 1.1764722158890388), (7.614640545182624, 1.176452643440545), (7.845785735870632, 1.1766772421316782), (8.076924337813608, 1.1768933626582412), (8.308043948667944, 1.1769040209222725), (8.53915115717868, 1.1767852781716324), (8.77025759054294, 1.176669975133475), (9.0013764262508, 1.176660964055703), (9.232501075557224, 1.1767230242203583), (9.463625724863647, 1.1767846483651214), (9.694743010278557, 1.1767930296363824), (9.925858745400518, 1.1767644945567712), (10.156973317802766, 1.1767304365585256), (10.38809331623034, 1.1767186155747817), (10.619212927084675, 1.1767264639328412), (10.85033253793901, 1.1767454065748242), (11.081452536366584, 1.176765608829829), (11.312573309940632, 1.1767736025278526), (11.54368788234288, 1.1767637194102962), (11.774804780184553, 1.1767274813125896), (12.005917027147376, 1.1766971052601003), (12.23704012616085, 1.17670568031798), (12.46816361274756, 1.1767700174754057), (12.699286324187796, 1.176835953372436), (12.930403222029469, 1.1768256826816421), (13.16151430627258, 1.1767064070178004), (13.392622677503027, 1.1765799612490648), (13.623745001370025, 1.1765926058259384), (13.85487817728768, 1.176817010730453), (14.086014453791222, 1.177052849045474), (14.31712902619347, 1.1770313871774472), (14.548218793908518, 1.1766110640013745), (14.779307011330616, 1.1761699572104407), (15.010427784904664, 1.1762096350206301), (15.241602818731963, 1.1769972322858921), (15.472780177998686, 1.1778232477483217), (15.703896300693884, 1.1777439890212522), (15.934908553761431, 1.1762682554728026), (16.16591615595013, 1.1747281363202726), (16.397102816974552, 1.1754373468982495), (16.628322034150926, 1.177695736153183), (16.8595257483978, 1.1791019003055008), (17.09063101904235, 1.1768545084411814), (17.32172001161092, 1.1714123019334652), (17.552940779080245, 1.1669530780493675), (17.784233635171745, 1.1698715045277697), (18.014752895081187, 1.1868237641495585), (18.24256999437875, 1.2237810039983326), (18.46467426415552, 1.2853885800055027), (18.67751165782358, 1.373690020512463), (18.87754285657803, 1.4882597701044242), (19.061506044052063, 1.6272903325416421), (19.226419231756324, 1.7884745327879161), (19.370492606480013, 1.968393199741982), (19.492574300561273, 2.164171751147933), (19.589540473705824, 2.37339734981569), (19.658698267059492, 2.5934501944463477), (19.701101879828286, 2.82009595052687), (19.715221948017017, 3.0503062176727127), (19.70088096308291, 3.280525592789637), (19.65856494186579, 3.507121351922521), (19.588873072590843, 3.7265887671779296), (19.49270840090145, 3.9356982876610545), (19.371416581078222, 4.131612295913513), (19.22664479938055, 4.311502670021241), (19.060582844600333, 4.472324053270555), (18.87611503677107, 4.6106471976560215), (18.676121820193885, 4.723222689154412), (18.463086764174705, 4.808279511856952), (18.239924419459555, 4.867578410981622), (18.012365443938165, 4.913753111351326), (17.786471483045084, 4.9661088297127405), (17.57299536868163, 5.050292256124564), (17.38507118272031, 5.1793417418696635), (17.235843859084298, 5.352049221166737), (17.135684082462717, 5.558237408372179), (17.091032544916402, 5.783808520758413), (17.10490146564723, 6.0134220220118095), (17.17642655633557, 6.231800937829684), (17.300832914695377, 6.424335695024354), (17.47070548954673, 6.578837502849552), (17.672152880911028, 6.684299475146801), (17.893371933413334, 6.748585472905049), (18.121621564443956, 6.792572128562426), (18.348365085873628, 6.8411455196990385), (18.56811756124523, 6.911117604424703), (18.77677303968062, 7.008396161598682), (18.971281319800653, 7.1319874534400185), (19.148175171422622, 7.280027640249557), (19.30731429303455, 7.447432536297725), (19.44454622496983, 7.633185149409321), (19.55643319261179, 7.835210024897492), (19.64301627872362, 8.049759329555599), (19.703459100258783, 8.27293989021291), (19.736954729736794, 8.501369742798971), (19.742726470389698, 8.731943262961664), (19.720068163778762, 8.961526145929298), (19.669045697354363, 9.186698445454141), (19.590403211732504, 9.403845653523241), (19.48514142101243, 9.609273034463456), (19.354849375467893, 9.799640869687238), (19.20157036120702, 9.971897795095714), (19.0275716816692, 10.123127709649907), (18.835617509184317, 10.250914094213982), (18.628850287562045, 10.353252032430333), (18.410601596351967, 10.428325356108019), (18.184712286337742, 10.476530940242242), (17.954600753474153, 10.493487656956262), (17.724042736240953, 10.479035438502988), (17.497605397668906, 10.43760928543918), (17.278011827324683, 10.367964700099204), (17.068626160909844, 10.270846598245555), (16.8730078710376, 10.1479413110346), (16.694561401026192, 10.002156800467333), (16.53785236361341, 9.833421753068052), (16.4050410920251, 9.64523828061084), (16.29603534383074, 9.44204370909188), (16.207754686938642, 9.228691230591181), (16.135389337471395, 9.008978675263052), (16.07235907700266, 8.786192664161518), (16.012431727873377, 8.562581122064103), (15.951293599950137, 8.33942420337429), (15.887716086070043, 8.117043593879174), (15.822620060245413, 7.895170705325199), (15.757938737784912, 7.673206737060411), (15.69431936599517, 7.450970692382896), (15.631241821591459, 7.228624189332692), (15.567987543791446, 7.006331946535738), (15.50387052796475, 6.784331933959862), (15.438798531680847, 6.562534234613972), (15.373216489016386, 6.34078226891009), (15.308159220515506, 6.118866359726752), (15.244532097261015, 5.896631477768949), (15.181985528192683, 5.674152812244756), (15.118380884185967, 5.45188266112234), (15.053164710657711, 5.229925862962446), (14.988006673115082, 5.0078233372652585), (14.925239187301372, 4.784862143060366), (14.866436575707326, 4.560553356708681), (14.810457047575253, 4.335132235165354), (14.75231718621734, 4.1099423010582115), (14.683640758824652, 3.8878674868474974), (14.594487287001698, 3.6740514707547476), (14.476065834575422, 3.4764687659282174), (14.323633280265256, 3.3054607952775967), (14.138370947299109, 3.1717004537239504), (13.927067568505095, 3.0838253922249024), (13.700134136189035, 3.0457393453218984), (13.46875988971766, 3.0562828876749464), (13.246495164620569, 3.1183719265364047), (13.045234195983511, 3.231018343937258), (12.877462268079427, 3.3847238825460053), (12.74355300150927, 3.5719499522132736), (12.642496767989343, 3.7808089065983523), (12.57114453496493, 4.000661182078602), (12.517719114468008, 4.2258524726920825), (12.468331431959399, 4.451925298634265), (12.4120085139389, 4.675469402988355), (12.349562326339083, 4.897287643715842), (12.284753104710205, 5.119237853130699), (12.218900923499206, 5.341877555335074), (12.143529168428643, 5.5604917281081185), (12.047748194244377, 5.769001672792825), (11.923791033266838, 5.963310352695544), (11.773391300587377, 6.138089023373837), (11.600822378722711, 6.292222442836788), (11.41051035404513, 6.423863243247837), (11.20585734443344, 6.530585022353591), (10.989740306029631, 6.6098534387540155), (10.765270289211145, 6.659856006203924), (10.535845148551175, 6.680123761085937), (10.305042572605117, 6.671448127951038), (10.07649877348723, 6.63428179234063), (9.854723553389107, 6.569068719398274), (9.645882039799716, 6.473548194429611), (9.453854615972944, 6.348333552082991), (9.275504651697673, 6.202287429580409), (9.275504651697673, 6.202287429580409), (9.116978283374237, 6.03550982081714), (8.981847385959469, 5.850168616697161), (8.86767567408242, 5.651305563680538), (8.776009952533968, 5.440973249633089), (8.704624000637892, 5.220948310275531), (8.647611589827875, 4.994285016506012), (8.594817526134847, 4.767440338461341), (8.538167883875133, 4.545126779136325), (8.477873502889935, 4.325052230404367), (8.4162187398411, 4.10315647502938), (8.352330004651293, 3.8781240894432756), (8.27270114513999, 3.6597779235639645), (8.16076999414895, 3.460893554019279), (8.00484928070125, 3.293094689775188), (7.8126641145668145, 3.1637910528795956), (7.596837368517896, 3.07951751569005), (7.369572561083771, 3.045607279741219), (7.141216347412836, 3.0625313434099795), (6.921691765104896, 3.1295531237584555), (6.721092771557493, 3.2446898929968886), (6.5503727678223385, 3.4009024490924276), (6.420769246134228, 3.589775608125777), (6.338615540767208, 3.8027471021340062), (6.291051584127672, 4.030337277301015), (6.260565267052257, 4.262651970233193), (6.232437139340433, 4.491840109858431), (6.203227294722737, 4.718443523562755), (6.172330731375425, 4.9450992596541425), (6.139473435019582, 5.173789561455805), (6.105720456911868, 5.403828230550745), (6.072487214515647, 5.633872325671007), (6.040737214899352, 5.8629002037625355), (6.009647446293144, 6.091210877578064), (5.977947056051249, 6.319429696536304), (5.944827953973473, 6.548049847581979), (5.911302675142792, 6.7770463322412695), (5.8788529120461845, 7.0062645087924125), (5.848314466370326, 7.235533845010906), (5.8173328306973815, 7.464497385945009), (5.7848410159045045, 7.693243110719637), (5.751362439648943, 7.9219182971650355), (5.7198246363801815, 8.150972917809952), (5.691311842230135, 8.38053332152981), (5.664268532010084, 8.610419286769172), (5.63242202665765, 8.83964288934564), (5.586510100942974, 9.066038370008044), (5.518757066788638, 9.286364453771142), (5.42476183629617, 9.496503562559695), (5.303744805898333, 9.692340056164653), (5.156952992486794, 9.869833871158278), (4.988806475048662, 10.02763431480787), (4.802178527780171, 10.163063256042278), (4.599853476819547, 10.273360010690766), (4.385159994917089, 10.356918475257118), (4.16149923101851, 10.412311992654082), (3.9322957822503923, 10.439656447279674), (3.7015532801561477, 10.436941109177724), (3.4731400932192997, 10.404165978348232), (3.2508976535833654, 10.342092248629655), (3.03829968328278, 10.252175257528819), (2.8385312591833483, 10.136267605120992), (2.6553826537612366, 9.995669599617997), (2.493087620169625, 9.831413736124546), (2.353282589510563, 9.648060201353104), (2.238852947643955, 9.448010011510005), (2.150373271894402, 9.235126109053454), (2.085984470334907, 9.01360242398647), (2.040878793847547, 8.7869189764086), (2.0069854173345476, 8.55798760405321), (1.975739747393554, 8.328704315198166), (1.9417548067031944, 8.099952001678503), (1.9041570536327903, 7.8718310449627324), (1.8658437434726451, 7.643877132312326), (1.8292803264798287, 7.415636803039405), (1.7941794170987322, 7.187139512710019), (1.75846759540202, 6.958742603849142), (1.721170163144027, 6.7306216471333755), (1.6829858179786612, 6.502680524399807), (1.6455359240983647, 6.274662274591975), (1.609357125097116, 6.046450819525248), (1.5736006840314367, 5.818128906085832), (1.5370730691164347, 5.589931597442273), (1.498530509386307, 5.361881566628972), (1.4599266646379974, 5.13392920427151), (1.4233874225258702, 4.905767358579183), (1.3885265663187525, 4.677365411266223), (1.3528851376113025, 4.449023344018457), (1.3140176946148365, 4.221077376619419), (1.273015304439582, 3.99333972983554), (1.2352100059004947, 3.7650230486348306), (1.2080755190763206, 3.535484349016272), (1.1986911598299912, 3.3047862240577217), (1.211643954320671, 3.0744603631937935), (1.249573954548925, 2.8469869444645823), (1.3124083451927575, 2.6247891726442703), (1.3991961668672985, 2.410659803588999), (1.5085473881562415, 2.207281425462149), (1.6381871963887136, 2.0160958107072346), (1.7877813580940227, 1.8401116419203412), (1.9557086059730366, 1.681359609079369), (2.139876625903092, 1.5416542331890002), (2.338044372531634, 1.42274133789757), (2.547852978241906, 1.3262361346723746), (2.767012466560118, 1.2539872994096515), (2.9930838391026597, 1.2067647947923563), (3.2231342322880323, 1.1818476144599404), (3.4543352335222437, 1.1735013216836097), (3.6857278897224006, 1.1759530615374028), (3.916965710414175, 1.1799093606991848), (4.148126016458448, 1.1812030801659719), (4.379134006220383, 1.1782782102824962), (4.610082115917123, 1.1747784239478387), (4.8411090967676955, 1.1738637511073302), (5.0722947888590255, 1.1759856661360077)]
5 |
6 | Shanghai = [(3.0735310316085815, 1.000146746635437), (3.0645214319229126, 0.8656417727470398), (3.053981065750122, 0.7312474548816681), (3.042039394378662, 0.5969730019569397), (3.028343081474304, 0.4628675580024719), (3.012254476547241, 0.32902875542640686), (2.9928380250930786, 0.19562580436468124), (2.968708038330078, 0.06301657622680068), (2.938753604888916, -0.06854412611573935), (2.9008500576019287, -0.1979232020676136), (2.853961944580078, -0.32427745312452316), (2.7966175079345703, -0.446168452501297), (2.7278809547424316, -0.5620329976081848), (2.647803544998169, -0.6704090535640717), (2.5578975677490234, -0.7711037397384644), (2.46045458316803, -0.8650645911693573), (2.358309030532837, -0.9546030461788177), (2.2552585005760193, -1.0436342656612396), (2.155789017677307, -1.1369854807853699), (2.0657354593276978, -1.2390314936637878), (1.9909070134162903, -1.3522084951400757), (1.9363250136375427, -1.4761214852333069), (1.9051944613456726, -1.6079650521278381), (1.8991720080375671, -1.7434249520301819), (1.9196515679359436, -1.876925528049469), (1.9673665165901184, -2.002789080142975), (2.0401565432548523, -2.1149550080299377), (2.1349644660949707, -2.208242952823639), (2.2469455003738403, -2.2800469994544983), (2.3702415227890015, -2.3307775259017944), (2.499998450279236, -2.3636549711227417), (2.632860541343689, -2.38342547416687), (2.767011523246765, -2.3946635723114014), (2.901630997657776, -2.400668501853943), (3.03643000125885, -2.403024435043335), (3.17127001285553, -2.4038679599761963), (3.306046485900879, -2.404312491416931), (3.4408589601516724, -2.4038649797439575), (3.5756750106811523, -2.4028735160827637), (3.7104674577713013, -2.401772975921631), (3.8452670574188232, -2.4009286165237427), (3.8452670574188232, -2.4009286165237427), (3.9800745248794556, -2.400294065475464), (4.114880561828613, -2.3996315002441406), (4.249683380126953, -2.398922085762024), (4.384488582611084, -2.3985949754714966), (4.519287586212158, -2.399658441543579), (4.654079437255859, -2.401755928993225), (4.788872480392456, -2.403656005859375), (4.923666000366211, -2.4053460359573364), (5.0584633350372314, -2.407061457633972), (5.1932594776153564, -2.4086660146713257), (5.328055381774902, -2.410014033317566), (5.462860107421875, -2.411013960838318), (5.597663879394531, -2.4116369485855103), (5.732469320297241, -2.4118374586105347), (5.86727499961853, -2.4114489555358887), (6.002075910568237, -2.4102895259857178), (6.1368653774261475, -2.4081934690475464), (6.271634101867676, -2.4050780534744263), (6.406371593475342, -2.400741457939148), (6.541025876998901, -2.394344449043274), (6.675467491149902, -2.384572982788086), (6.8095009326934814, -2.369807481765747), (6.942757606506348, -2.349280595779419), (7.075047492980957, -2.323027491569519), (7.206153869628906, -2.291256010532379), (7.335780620574951, -2.2536450028419495), (7.463391542434692, -2.2093089818954468), (7.588238000869751, -2.157045006752014), (7.709635972976685, -2.096128523349762), (7.826013803482056, -2.0256964564323425), (7.935011148452759, -1.944078505039215), (8.032845973968506, -1.8494969606399536), (8.114629983901978, -1.7420405149459839), (8.176169872283936, -1.622237503528595), (8.214849948883057, -1.4937424659729004), (8.230096817016602, -1.3605679869651794), (8.223047494888306, -1.2266045212745667), (8.19502592086792, -1.0952306389808655), (8.1484055519104, -0.9690369367599487), (8.085589170455933, -0.8498030602931976), (8.008869647979736, -0.7386083900928497), (7.920694351196289, -0.6361443996429443), (7.82130241394043, -0.5442077368497849), (7.711000442504884, -0.4657583385705952), (7.590218544006348, -0.40542183816432953), (7.461702108383179, -0.3654540814459324), (7.328711986541748, -0.34727288596332073), (7.1949357986450195, -0.3503032559528947), (7.062901496887208, -0.37376771308481677), (6.935213565826416, -0.41420959308743477), (6.811918497085572, -0.4679880067706105), (6.691490650177002, -0.5291145890951157), (6.571125030517578, -0.591113343834877), (6.447940349578858, -0.6475183367729184), (6.320262908935547, -0.6925990730524063), (6.188196897506714, -0.7219772934913635), (6.053462505340576, -0.7327916920185089), (5.918161153793335, -0.7246963381767273), (5.78569483757019, -0.6963475942611694), (5.659789800643921, -0.6466781198978424), (5.544190406799316, -0.5773626565933228), (5.443355083465576, -0.48832499980926514), (5.360814332962036, -0.3824281096458435), (5.2980804443359375, -0.2638728991150856), (5.255225419998169, -0.13667107000946999), (5.231439113616943, -0.004254929721355438), (5.2254719734191895, 0.1304013468325138), (5.238023042678833, 0.26473885774612427), (5.26922345161438, 0.395883247256279), (5.319676876068115, 0.5208692103624344), (5.387079954147339, 0.6369103491306305), (5.47014045715332, 0.7419008314609528), (5.566038131713867, 0.8353092968463898), (5.671626329421997, 0.9177578389644623), (5.7840845584869385, 0.9906012713909149), (5.901401519775391, 1.0571751296520233), (6.021354913711548, 1.1191320717334747), (6.142263174057007, 1.1794240176677704), (6.263301372528076, 1.24005326628685), (6.3832690715789795, 1.3030664920806885), (6.500617980957031, 1.3709569573402405), (6.613959312438965, 1.4466614723205566), (6.718842029571533, 1.5330204963684082), (6.812015771865845, 1.6316485404968262), (6.889348030090331, 1.7428010106086715), (6.94684338569641, 1.8650454878807052), (6.981334447860718, 1.9953965544700623), (6.990978002548218, 2.129757046699524), (6.975160598754883, 2.263309955596924), (6.935124397277832, 2.3914469480514526), (6.873451471328735, 2.510735511779785), (6.794079542160035, 2.6192245483398424), (6.700836420059202, 2.716556549072267), (6.596850872039795, 2.802875518798828), (6.483934879302977, 2.877249002456666), (6.3630735874176025, 2.937337040901184), (6.235411882400513, 2.980261445045471), (6.103086471557617, 3.0043410062789917), (5.969022989273071, 3.0096925497055054), (5.83551812171936, 2.9973044395446777), (5.704394102096558, 2.969919443130493), (5.575834035873413, 2.931077480316162), (5.448855638504028, 2.886167526245117), (5.321792364120486, 2.8412715196609506), (5.193359613418582, 2.8006954193115243), (5.06295108795166, 2.766679048538208), (4.931171417236328, 2.7380969524383545), (4.798591375350952, 2.7133220434188843), (4.66555333137512, 2.691210508346557), (4.532058954238892, 2.6715195178985596), (4.398158550262451, 2.653871536254883), (4.2638473510742205, 2.6384880542755127), (4.129091024398804, 2.6252639293670654), (3.993950605392456, 2.6133079528808594), (3.8577510118484497, 2.5998975038528442), (3.7231489419937134, 2.578099012374878), (3.5923640727996826, 2.5420939922332764), (3.4696924686431885, 2.486764907836914), (3.3603174686431885, 2.4095875024795532), (3.2698700428009033, 2.3117449283599854), (3.2012869119644165, 2.197103977203369), (3.155463457107544, 2.072068512439728), (3.127715587615967, 1.9411699771881104), (3.1126420497894287, 1.807692050933838), (3.1046115159988403, 1.6733009815216064), (3.098413109779358, 1.5387185215950012), (3.092742919921875, 1.4040665030479431), (3.0871164798736572, 1.2693960070610046), (3.080922484397888, 1.134746015071869), (3.0735310316085815, 1.000146746635437)]
7 |
8 | Toronto = [(4.609185457229614, 1.643046498298645), (4.504319190979004, 1.67146497964859), (4.399074554443359, 1.6984639763832092), (4.293483018875122, 1.724132478237152), (4.187655448913574, 1.7487720251083374), (4.081698417663574, 1.7727230191230774), (3.97563099861145, 1.7962635159492493), (3.869505524635315, 1.8197744488716125), (3.763600468635559, 1.8441064953804016), (3.6581575870513916, 1.8700284957885742), (3.553057551383972, 1.8975245356559753), (3.4481170177459717, 1.926171064376831), (3.3432644605636597, 1.9547145366668701), (3.2383874654769897, 1.982143521308899), (3.1319295167922974, 2.0092655420303345), (3.02654492855072, 2.0406585335731506), (2.9239845275878906, 2.07964950799942), (2.8259520530700684, 2.12832248210907), (2.732545971870422, 2.185194075107575), (2.6429165601730347, 2.2447015047073364), (2.5543090105056763, 2.3058074712753296), (2.4664459228515625, 2.365598440170288), (2.3773385286331177, 2.4274550676345825), (2.2884784936904907, 2.4898605346679688), (2.197836995124817, 2.5495954751968384), (2.102916955947876, 2.6027674674987793), (2.002554476261139, 2.645362973213196), (1.897580981254578, 2.6736689805984497), (1.789713978767395, 2.686097025871277), (1.6813725233078003, 2.6819549798965454), (1.5749970078468323, 2.660743474960327), (1.4726009964942932, 2.6243544816970825), (1.3748530149459839, 2.5758700370788574), (1.281750500202179, 2.518436908721924), (1.1937781870365143, 2.453410029411316), (1.1129567921161652, 2.3800384998321533), (1.0421969592571259, 2.297893524169922), (0.9861142337322235, 2.205552577972412), (0.947014570236206, 2.104879081249237), (0.9247994124889374, 1.9987910389900208), (0.9167823195457458, 1.8902974724769592), (0.9209622740745544, 1.7814240455627441), (0.936503678560257, 1.6736440062522888), (0.9632556438446045, 1.568269968032837), (1.0001376271247864, 1.465837001800537), (1.0447850227355957, 1.3665714859962463), (1.093875676393509, 1.2697779536247253), (1.1451406478881836, 1.1739444732666016), (1.1981981694698334, 1.0790521800518036), (1.253183275461197, 0.985353022813797), (1.3102859854698181, 0.8929578363895416), (1.3698010444641118, 0.8020434081554405), (1.4323539733886719, 0.7131966054439545), (1.4986765384674072, 0.6271558403968811), (1.569568514823913, 0.5448682457208642), (1.6453405022621155, 0.4669097065925598), (1.7242580056190497, 0.39215361326932846), (1.804488003253936, 0.3192039653658873), (1.8858450651168823, 0.24728101963410154), (1.9680349230766296, 0.17558056116104126), (2.0486620664596558, 0.10257739573717117), (2.1293065547943115, 0.02980794757604599), (2.2090935111045837, -0.04387355595827103), (2.2870789766311646, -0.11935244500637054), (2.3589104413986206, -0.19992218585684896), (2.416489601135254, -0.29014210030436516), (2.457169532775879, -0.3888736441731453), (2.4800769090652466, -0.49412575364112854), (2.4912240505218506, -0.602191299200058), (2.4985815286636353, -0.710907906293869), (2.509809970855713, -0.8190776705741882), (2.5317574739456177, -0.9251802265644073), (2.5677324533462524, -1.0271103382110596), (2.6162115335464478, -1.1239750683307648), (2.674426555633545, -1.2161155343055725), (2.735548973083496, -1.3058364987373352), (2.7990576028823853, -1.3936030268669128), (2.8660950660705566, -1.4792065024375916), (2.9362080097198486, -1.5624719858169556), (3.008868455886841, -1.6431390047073364), (3.084826946258545, -1.7206114530563354), (3.164761543273926, -1.7943825125694275), (3.2477575540542603, -1.8646840453147888), (3.332667589187622, -1.9321004748344421), (3.4189904928207397, -1.997926950454712), (3.506491541862488, -2.0630074739456177), (3.5949885845184326, -2.1266459822654724), (3.684191584587097, -2.18951553106308), (3.775633454322815, -2.248464524745941), (3.8714624643325806, -2.2978655099868774), (3.972942352294922, -2.3312435150146484), (4.078174591064453, -2.34393048286438), (4.1832311153411865, -2.332993984222412), (4.284292936325073, -2.300551950931549), (4.379820346832275, -2.2515174746513367), (4.47145414352417, -2.193326473236084), (4.56273341178894, -2.1337549686431885), (4.657216787338257, -2.080012023448944), (4.756945610046387, -2.0384190678596497), (4.862459659576418, -2.013380467891693), (4.970647573471069, -2.0032860040664673), (5.0793156623840305, -2.0059640407562256), (5.186042070388794, -2.022897481918335), (5.289485216140747, -2.054390013217926), (5.388495683670044, -2.098896026611328), (5.484181880950926, -2.1510540246963488), (5.57831859588623, -2.2052585482597347), (5.672954559326174, -2.2585664987564096), (5.769561052322388, -2.308664560317993), (5.86968994140625, -2.350277543067932), (5.973845958709717, -2.3786829710006714), (6.080930948257446, -2.39066743850708), (6.1891584396362305, -2.3882399797439575), (6.2973949909210205, -2.376492500305176), (6.405588388442993, -2.362933039665222), (6.514252901077269, -2.3558554649353027), (6.6224071979522705, -2.3618520498275757), (6.72736668586731, -2.385164499282837), (6.8269994258880615, -2.4255974292755127), (6.919412136077883, -2.4812730550766), (7.0064451694488525, -2.5462489128112793), (7.092819452285767, -2.6122244596481323), (7.183058977127073, -2.672051072120665), (7.280209541320801, -2.7190674543380737), (7.3827290534973145, -2.7531665563583374), (7.488784551620483, -2.7765880823135376), (7.596723556518555, -2.7887380123138428), (7.705402851104736, -2.790287494659424), (7.813960552215576, -2.7823420763015747), (7.921756505966188, -2.7679904699325557), (8.02846646308899, -2.746973991394043), (8.133998394012451, -2.7196990251541138), (8.23613452911377, -2.6825735569000244), (8.332922458648682, -2.633623957633972), (8.422791957855225, -2.5729780197143555), (8.505171775817871, -2.504824995994568), (8.580915927886963, -2.4276044368743896), (8.651664733886719, -2.344859480857849), (8.719083309173584, -2.2570735216140756), (8.784222602844238, -2.1693264842033386), (8.844747543334961, -2.079285979270935), (8.89870309829712, -1.9854525327682495), (8.941900730133057, -1.886442482471466), (8.973433494567871, -1.7830125093460083), (8.99543809890747, -1.67678302526474), (9.011030197143555, -1.5691459774971008), (9.019242286682129, -1.460712492465973), (9.020208358764648, -1.3520789742469788), (9.011768817901611, -1.2437620162963867), (8.993597030639648, -1.1366320252418518), (8.963536739349365, -1.0319579541683197), (8.92065954208374, -0.9316902160644531), (8.865981578826904, -0.8372134864330292), (8.798622131347656, -0.7516090571880341), (8.719659805297852, -0.6770026534795761), (8.630758285522461, -0.6159686893224716), (8.532961368560791, -0.5721200853586197), (8.429037094116211, -0.547596201300621), (8.322094917297363, -0.5419068858027458), (8.214502334594727, -0.5509504973888397), (8.107054710388184, -0.5676377415657043), (7.99943470954895, -0.5833219960331917), (7.891502141952515, -0.5876642614603043), (7.784543991088867, -0.5754548460245132), (7.680687427520752, -0.5468097031116486), (7.580629825592041, -0.5049368590116501), (7.485086441040039, -0.4528762549161911), (7.393003940582275, -0.3945930488407612), (7.302894353866577, -0.3335093390196562), (7.215418338775635, -0.2687771514974884), (7.131267786026001, -0.19994257017970085), (7.048273086547852, -0.12489104643464088), (6.968200922012329, -0.053852058947086334), (6.89148736000061, 0.024007253348827362), (6.82938289642334, 0.10758724808692932), (6.775941610336304, 0.199321030639112), (6.737826824188232, 0.29889320209622383), (6.709502935409546, 0.40252915769815445), (6.681049823760986, 0.5060942023992538), (6.644915580749512, 0.6065077483654022), (6.594740629196167, 0.6999478936195374), (6.529064416885376, 0.7834510207176208), (6.450721025466919, 0.8565658330917358), (6.365326881408691, 0.9224684834480286), (6.278306007385254, 0.9864456653594971), (6.18789529800415, 1.0452293157577515), (6.092773914337158, 1.097053974866867), (5.9950110912323, 1.143466979265213), (5.8969035148620605, 1.1911115050315857), (5.805736064910889, 1.2341663241386414), (5.71117639541626, 1.277884155511856), (5.619248390197754, 1.3166009783744812), (5.526684045791626, 1.3507930040359497), (5.526684045791626, 1.3507930040359497), (5.429593563079834, 1.3841480016708374), (5.332087993621826, 1.416323959827423), (5.230463981628418, 1.4498534798622131), (5.127819061279297, 1.4835450053215027), (5.025057554244995, 1.5168744921684265), (4.921543598175049, 1.549900472164154), (4.817766904830933, 1.5820860266685486), (4.713661432266235, 1.6132075190544128), (4.609185457229614, 1.643046498298645)]
9 |
10 | reinvent_waypoints = [(2.909995283569139, 0.6831924746239328), (3.3199952311658905, 0.6833390533713652), (3.41999521838461, 0.6833748042853732), (3.6300023417267235, 0.6834498837610459), (4.189995119968753, 0.6836500863232341), (4.500002230529587, 0.6837609167129147), (4.549995073956144, 0.6837787896136626), (5.320002125723089, 0.6840540742077795), (5.420002112941809, 0.6840898251217875), (5.7800020669292005, 0.684218528412216), (6.289747858140073, 0.6921400142174), (6.460906484698166, 0.7123063542781353), (6.5136980596947165, 0.7210294115664316), (6.704287871536597, 0.799598672280553), (6.836281775656231, 0.8817004790362547), (6.991663362669656, 1.0062653214908401), (7.1142074641408275, 1.1693225137564909), (7.165830682349035, 1.263426756737598), (7.280019741788613, 1.7628308313393968), (7.272892208655982, 1.8132370038722583), (7.265960701310593, 1.8622568749360433), (7.1045747673751585, 2.3014874894475916), (7.011749008840918, 2.419260292916218), (6.727273712845888, 2.6474924751765463), (6.536921216759571, 2.7266447610626687), (6.079802178702642, 2.773360773339069), (5.919813651266964, 2.772005974951175), (5.719827991972368, 2.7703124769663074), (5.670000926947205, 2.7698905365406308), (5.200034627604903, 2.765910816276192), (5.049876033335467, 2.7646392587170006), (5.002030872389276, 2.768980714618128), (4.942709994269048, 2.775327848322301), (4.561340171137485, 2.898322513024676), (4.258533108743229, 3.166955220685885), (4.092728535429521, 3.3703748558215287), (4.001121969780925, 3.482763638518189), (3.774000078716213, 3.761411273431655), (3.6823935130676184, 3.8738000561283137), (3.5490587458571623, 4.037383660336441), (3.2758532950668884, 4.333295323360169), (3.1911463583891155, 4.385684825652305), (3.0954945192403103, 4.435922305057415), (2.9549738926202442, 4.484413606024224), (2.8089822299540046, 4.500038654567632), (2.8110045575773057, 4.499832029419236), (2.5003276964136627, 4.498718163592657), (2.249377566090162, 4.491428972830993), (1.990177178741659, 4.483900142037221), (1.7395172672798365, 4.476619381080485), (1.1871156114665855, 4.391792930201858), (1.1054389398706574, 4.3402307341807065), (0.7316196323127645, 3.819658838269335), (0.7080468873794841, 3.5295953182618844), (0.8747319412102282, 2.7251244177375193), (0.8863119620897287, 2.6692358445815714), (0.9180990438541362, 2.5158220758940644), (0.9380374746317692, 2.4195933679559642), (1.0212099341560652, 2.0181787127447155), (1.043063552869095, 1.912706746772055), (1.0936256517149223, 1.6686792454688633), (1.219724413480236, 1.169889412099395), (1.2404620134668318, 1.1182110370035536), (1.286611404297767, 1.0270193376917442), (1.3195344250237366, 0.9895904728963364), (1.3897426105955222, 0.9097735962139227), (1.4563853812178036, 0.8435308547287804), (1.4996428710531535, 0.8193608401945228), (2.0400025449490777, 0.6828814442283201), (2.7500024542019887, 0.6831352757177762)]
11 |
12 | reinvent_waypoints2019 = [(0.3078780025243759, 2.830607533454895), (0.3236568570137024, 2.6803284883499146), (0.3449653461575508, 2.5307400226593018), (0.3729203939437866, 2.3822485208511353), (0.40683891251683235, 2.2350025177001953), (0.4460252486169338, 2.0890684723854065), (0.49285656260326505, 1.9454265236854553), (0.550458125770092, 1.805765986442566), (0.6199908927083015, 1.6716570258140564), (0.7020252197980881, 1.5448175072669983), (0.7991533726453781, 1.4292609691619873), (0.9147003889083862, 1.33219575881958), (1.0465626120567322, 1.258876621723175), (1.1902250051498413, 1.2127535939216614), (1.339946985244751, 1.1937379837036133), (1.4910080432891846, 1.1949818432331085), (1.641608476638794, 1.2070926427841187), (1.7913410067558289, 1.2273582220077515), (1.9404860138893127, 1.251646637916565), (2.089533567428589, 1.2765108942985535), (2.238669514656067, 1.3008531033992767), (2.38798451423645, 1.3240716457366943), (2.53842556476593, 1.337261587381363), (2.689424991607666, 1.333412766456604), (2.8389484882354736, 1.3125049769878387), (2.9825469255447388, 1.2660765051841736), (3.1155110597610474, 1.1946403682231903), (3.2352620363235474, 1.1026768684387207), (3.3411115407943726, 0.9949667453765869), (3.436005473136902, 0.8774079084396362), (3.5255489349365234, 0.7556869089603424), (3.622694492340088, 0.6400226801633835), (3.7314956188201904, 0.5352497547864914), (3.8509503602981567, 0.4428102010861039), (3.9796855449676514, 0.3638005927205086), (4.115742087364197, 0.2981748580932617), (4.257688522338867, 0.24650338292121887), (4.404093503952026, 0.2093062549829483), (4.5534889698028564, 0.18695326149463654), (4.5534889698028564, 0.18695326149463654), (4.704370498657227, 0.1796717643737793), (4.855273008346558, 0.18669861555099487), (5.005021572113037, 0.20660366117954254), (5.152501821517944, 0.23931320011615753), (5.295422077178955, 0.28815483301877975), (5.432490110397339, 0.3516535572707653), (5.564228057861328, 0.42563064210116863), (5.6922008991241455, 0.5059686079621315), (5.816339492797852, 0.5921122580766678), (5.936516046524048, 0.6837043017148973), (6.052911996841431, 0.7800580710172651), (6.165846824645996, 0.8804492801427841), (6.2757179737091064, 0.9841870367527007), (6.382829904556274, 1.0907731652259827), (6.487284898757935, 1.199965626001358), (6.589090585708618, 1.3116328120231628), (6.688275098800659, 1.4256349802017212), (6.784881353378296, 1.541829526424408), (6.8789684772491455, 1.6600730419158936), (6.97060751914978, 1.7802234292030334), (7.059880495071411, 1.9021430611610413), (7.146878957748413, 2.0256965160369877), (7.231692314147949, 2.1507595181465144), (7.314452171325684, 2.277191996574402), (7.39509916305542, 2.4049805402755737), (7.473531007766724, 2.5341415405273438), (7.54969048500061, 2.664654493331909), (7.623512506484985, 2.796504020690918), (7.6949238777160645, 2.929674983024597), (7.763846158981323, 3.0641499757766724), (7.830197811126709, 3.199911952018738), (7.893891334533691, 3.336941957473755), (7.954820871353149, 3.475222587585449), (8.013047695159912, 3.614661931991577), (8.068377017974854, 3.7552770376205444), (8.120350360870361, 3.8971649408340454), (8.16848349571228, 4.040401577949524), (8.212241411209106, 4.185032606124878), (8.251099824905396, 4.3310558795928955), (8.284547090530396, 4.478411436080932), (8.312141180038452, 4.626972436904907), (8.333237648010254, 4.776589393615723), (8.345539331436157, 4.927172899246216), (8.346457719802856, 5.07824206352234), (8.333818435668945, 5.228774547576904), (8.303643941879272, 5.376732349395752), (8.25075912475586, 5.5181055068969735), (8.17261004447937, 5.647185564041138), (8.070677995681763, 5.758450508117676), (7.951415300369263, 5.851076126098633), (7.8213183879852295, 5.9277729988098145), (7.683374881744385, 5.989306926727295), (7.540656089782715, 6.0388734340667725), (7.394761562347412, 6.078141927719116), (7.2466254234313965, 6.107878684997559), (7.097042560577393, 6.12921404838562), (6.946609020233154, 6.143393516540527), (6.79572868347168, 6.151581525802612), (6.644643068313599, 6.15369176864624), (6.493581295013428, 6.150143146514893), (6.3427414894104, 6.141233444213867), (6.192314624786377, 6.126964569091797), (6.042650461196899, 6.1062493324279785), (5.8946311473846436, 6.075901031494141), (5.748281002044678, 6.038307189941406), (5.603698492050171, 5.9943931102752686), (5.4612555503845215, 5.94398045539856), (5.321802377700806, 5.885821342468262), (5.187443017959595, 5.816747426986694), (5.063535451889038, 5.73041558265686), (4.9501824378967285, 5.630155086517334), (4.846731901168823, 5.5198845863342285), (4.754265069961548, 5.400370836257935), (4.673691511154175, 5.272421836853027), (4.6044135093688965, 5.138104677200317), (4.544577360153198, 4.999350547790527), (4.491533994674683, 4.8578386306762695), (4.441592097282411, 4.715216636657717), (4.389981150627137, 4.573192596435549), (4.330840349197388, 4.434109210968018), (4.257412075996399, 4.301963806152344), (4.163705587387085, 4.1833449602127075), (4.048325896263123, 4.085645437240601), (3.9156869649887085, 4.013772964477539), (3.773463487625122, 3.961835503578186), (3.6279555559158325, 3.92071795463562), (3.4803909063339233, 3.8877369165420532), (3.3314545154571533, 3.8614039421081543), (3.181254506111145, 3.8450316190719604), (3.0300209522247314, 3.841495990753174), (2.8794320821762085, 3.854126453399658), (2.7314239740371704, 3.884672522544861), (2.5882774591445923, 3.9332735538482666), (2.4507784843444824, 3.9959983825683594), (2.316756010055542, 4.065796494483948), (2.182188034057617, 4.134568452835083), (2.0435360074043274, 4.194759368896484), (1.8996134996414185, 4.240862846374512), (1.7514809966087324, 4.270630478858948), (1.6008480191230774, 4.284300923347473), (1.4496694803237915, 4.284500598907471), (1.2989755272865295, 4.271936655044556), (1.149607002735138, 4.246785402297974), (1.0045660138130188, 4.204668045043945), (0.8659217953681946, 4.1436344385147095), (0.7383454740047455, 4.062453508377075), (0.6252143532037735, 3.962201476097107), (0.5294039137661457, 3.845063090324402), (0.45213192608207464, 3.715085983276367), (0.3926612101495266, 3.5761590003967285), (0.3495015874505043, 3.431317448616028), (0.3208933472633362, 3.2829004526138306), (0.30512550473213196, 3.1325994729995728), (0.3009575456380844, 2.981549024581909), (0.3078780025243759, 2.830607533454895)]
13 |
14 | cumulo = [(6.309836387634277, 2.717386484146118), (6.195788621902466, 2.7166789770126343), (6.081685543060303, 2.715367913246155), (5.967700958251953, 2.7118070125579834), (5.85396146774292, 2.704580545425415), (5.740401983261108, 2.6932029724121094), (5.627721548080444, 2.675312042236328), (5.5175135135650635, 2.6464585065841675), (5.409301042556763, 2.609961986541748), (5.301126956939697, 2.574303984642029), (5.1921679973602295, 2.541111946105957), (5.0821373462677, 2.5100131034851074), (4.970782518386841, 2.4851750135421753), (4.8580474853515625, 2.4710450172424316), (4.744303464889526, 2.4700599908828735), (4.630417108535767, 2.481245994567871), (4.5177764892578125, 2.499838948249817), (4.407072305679321, 2.5253244638442993), (4.298267602920532, 2.559592604637146), (4.190068483352661, 2.5966734886169434), (4.080982565879822, 2.629265546798706), (3.970926523208618, 2.6589781045913696), (3.859932541847229, 2.686348557472229), (3.7475284337997437, 2.7046855688095093), (3.633828043937683, 2.7119990587234497), (3.5197654962539673, 2.7135950326919556), (3.4057350158691406, 2.713532567024231), (3.4057350158691406, 2.713532567024231), (3.291683554649353, 2.7141895294189453), (3.1491129398345947, 2.7152745723724365), (3.0065420866012573, 2.71635901927948), (2.863971471786499, 2.7174439430236816), (2.7214009761810303, 2.7185285091400146), (2.607404947280884, 2.7163679599761963), (2.493346095085144, 2.7110939025878906), (2.3756535053253174, 2.696616053581238), (2.26602041721344, 2.6667665243148804), (2.1631579995155334, 2.6214065551757812), (2.0682084560394287, 2.5637874603271484), (1.9771165251731873, 2.4951614141464233), (1.8911914825439453, 2.420231580734253), (1.8114585280418396, 2.3387160301208496), (1.7394945025444033, 2.250212073326111), (1.677141010761261, 2.1548174619674683), (1.6248934864997864, 2.0534849166870117), (1.5823744535446167, 1.9477075338363647), (1.5505254864692688, 1.8382489681243896), (1.5311545133590698, 1.7257940173149109), (1.5271174907684326, 1.6120454668998718), (1.539400041103363, 1.4987789988517761), (1.5642725229263303, 1.387354493141175), (1.5989729762077332, 1.278760015964508), (1.6428920030593872, 1.1736074686050415), (1.6964020133018494, 1.0729964077472687), (1.7604795098304749, 0.9785585701465607), (1.8357470035552979, 0.8929627537727356), (1.9221299886703491, 0.8187586665153503), (2.0174149870872498, 0.7561855316162109), (2.1191929578781132, 0.704834684729576), (2.22581148147583, 0.6641798615455627), (2.33598256111145, 0.635000690817833), (2.448741912841797, 0.6194588989019394), (2.562835931777954, 0.6146939992904663), (2.676932454109192, 0.614323690533638), (2.790879011154175, 0.615065410733223), (2.904958486557007, 0.6154943406581879), (3.0190669298171997, 0.6158859431743622), (3.1330950260162354, 0.6165954917669296), (3.247138500213623, 0.6172222346067429), (3.3612254858016968, 0.6176614463329315), (3.475271463394165, 0.6182866990566254), (3.5893020629882812, 0.6188997328281403), (3.703405976295471, 0.6189960688352585), (3.8174840211868286, 0.6192460358142853), (3.9314393997192383, 0.6201631426811218), (4.045536994934082, 0.6195012480020523), (4.159003019332886, 0.6116561591625214), (4.269382476806641, 0.5892668068408966), (4.3730175495147705, 0.5481619536876678), (4.465728044509888, 0.4880164936184883), (4.5481369495391855, 0.4090211018919938), (4.621875524520874, 0.3185627665370703), (4.6936728954315186, 0.22756083868443966), (4.7715795040130615, 0.14663729816675186), (4.859802007675172, 0.0780811086297031), (4.959166049957275, 0.025352105498313904), (5.0663206577301025, -0.015855446457862854), (5.176241874694823, -0.05405664443969701), (5.283515930175781, -0.09862619638442993), (5.383999586105347, -0.15561671182513237), (5.4742419719696045, -0.22708586091175675), (5.549779891967773, -0.31260108947753906), (5.605553150177002, -0.40983645617961884), (5.639118432998657, -0.5152479559183121), (5.650930881500244, -0.6257368326187143), (5.643277406692505, -0.7384651899337769), (5.621659517288208, -0.8504203259944916), (5.592641115188599, -0.9608891308307648), (5.561022996902466, -1.070693016052246), (5.530486106872559, -1.1807215213775635), (5.5035319328308105, -1.2914490103721619), (5.480241298675537, -1.4030935168266296), (5.462010145187378, -1.5157455205917358), (5.45079493522644, -1.6292679905891418), (5.448741912841797, -1.7466390132904053), (5.459894418716431, -1.863289475440979), (5.48825740814209, -1.9755980372428894), (5.5363075733184814, -2.078725516796112), (5.60352635383606, -2.1696360111236572), (5.686964511871338, -2.2464959621429443), (5.7828369140625, -2.307755947113037), (5.88683295249939, -2.3526118993759155), (5.996015548706055, -2.380347967147827), (6.108441114425659, -2.3914250135421753), (6.2222607135772705, -2.388285517692566), (6.335166931152344, -2.371910572052002), (6.445005655288696, -2.3454989194869995), (6.550752639770508, -2.307651996612549), (6.655766487121582, -2.2621095180511475), (6.759855031967163, -2.215474545955658), (6.861518144607542, -2.164350986480714), (6.959713220596313, -2.106059551239014), (7.055949926376343, -2.044655501842499), (7.1512110233306885, -1.9823670387268066), (7.245310068130493, -1.9179010391235352), (7.3375091552734375, -1.8504455089569092), (7.42688202857971, -1.7797914743423473), (7.513786554336548, -1.7061240077018738), (7.5983476638793945, -1.6292839646339417), (7.677422523498535, -1.5470519661903381), (7.750153303146361, -1.457656025886537), (7.814417362213134, -1.3615394830703753), (7.8690268993377686, -1.2585055232048035), (7.910868167877197, -1.1510785222053528), (7.936350584030151, -1.041047990322113), (7.943183898925781, -0.9302619397640228), (7.929688930511475, -0.8188509643077873), (7.898606061935424, -0.7099088430404646), (7.858716964721679, -0.6015907526016219), (7.818351984024048, -0.49343155324459076), (7.785273790359497, -0.38304539024829865), (7.766066551208496, -0.2702548950910568), (7.764912366867065, -0.1569973491132242), (7.782723426818848, -0.04621594771742936), (7.816987752914428, 0.06044381856918132), (7.862348318099976, 0.1640622103586793), (7.9113850593566895, 0.2672598920762539), (7.964816093444824, 0.36797454953193665), (8.023759365081787, 0.4654194712638855), (8.083719730377197, 0.5625471323728577), (8.140750885009766, 0.661509245634079), (8.19270658493042, 0.7627629637718201), (8.238867044448853, 0.8667940497398376), (8.279578924179077, 0.9738516509532945), (8.31326961517334, 1.0863134860992432), (8.33589792251587, 1.2011854648590088), (8.344946384429932, 1.3162800073623657), (8.336476802825928, 1.4300925135612488), (8.307107925415039, 1.5377934575080872), (8.256765365600586, 1.6361489892005905), (8.187145233154297, 1.7235015034675598), (8.102343559265135, 1.7990955710411083), (8.010600328445433, 1.8678620457649242), (7.919651508331299, 1.9377470016479492), (7.838100910186769, 2.0161675214767443), (7.767462730407714, 2.1045645475387587), (7.704502820968628, 2.199170470237732), (7.6444172859191895, 2.2959940433502197), (7.5782294273376465, 2.3898375034332275), (7.501000642776489, 2.4726409912109375), (7.413156032562256, 2.543642044067383), (7.317309379577637, 2.601830005645752), (7.213808059692383, 2.6475000381469727), (7.105192422866821, 2.680868983268738), (6.993459939956665, 2.7023710012435913), (6.879996061325073, 2.7138789892196655), (6.766035556793213, 2.718880534172058), (6.651995420455933, 2.720201015472412), (6.537929534912109, 2.7195639610290527), (6.423866033554077, 2.7183064222335815), (6.309836387634277, 2.717386484146118)]
15 |
16 | oval = [(2.973129727863096, 0.9587203451227853), (3.1686550001583385, 0.957973927514008), (3.3641587621388993, 0.957502662680531), (3.5596536099349976, 0.9571676056167091), (3.7551399311198708, 0.9569079073242543), (3.9506256709448877, 0.9566988842326032), (4.146107922610766, 0.9565304352142532), (4.341591530782978, 0.9563990236634121), (4.537073588662238, 0.9563010645276331), (4.732557196834449, 0.9562337963475989), (4.92803925471371, 0.9561973644632735), (5.123521506379589, 0.9561847441097273), (5.3190037580454685, 0.9562067146676283), (5.514486009711348, 0.9562466104877638), (5.709974462549027, 0.9563314648034498), (5.905463109173326, 0.9564632639275283), (6.10095815075604, 0.9566372843111675), (6.296465594682358, 0.956848729735553), (6.491997261936018, 0.9569796325965199), (6.6875785385640825, 0.9567336689306691), (6.883257677434614, 0.9557806263396478), (7.079130990497134, 0.9538671530427651), (7.275221344572657, 0.9543163504250318), (7.4705043835944585, 0.968040367211689), (7.662157411673801, 1.00506531126039), (7.845235769446617, 1.0715002572806311), (8.014446369208315, 1.1684281333446516), (8.165421648145468, 1.2924605804235763), (8.294117279524725, 1.4398041043387009), (8.397584218581926, 1.6056121986483556), (8.469351930116943, 1.7860276860462465), (8.511767170082862, 1.9763842816461406), (8.530750119682551, 2.1709724987464085), (8.535956778555175, 2.3671952090825386), (8.538760870928513, 2.563413656113056), (8.537808603483967, 2.75963888567523), (8.532572489045293, 2.95569387369283), (8.51481039514374, 3.15055503924561), (8.475491090199, 3.341414414227855), (8.407975057079398, 3.5247578720951225), (8.31106120632191, 3.693881267878382), (8.186502531679764, 3.844170542185153), (8.037129092933212, 3.969503006795976), (7.868136309330993, 4.066595722602571), (7.6851610460393545, 4.1345014606124835), (7.494133948738579, 4.175703983918254), (7.299554742716083, 4.195335731117524), (7.103587636930088, 4.201242347257079), (6.907607353654015, 4.201247579495785), (6.711783262392657, 4.199924210676329), (6.516154120469764, 4.199300605337186), (6.3205893157042965, 4.199124065727503), (6.125061330396392, 4.199215533011554), (5.929553692683456, 4.199390716114905), (5.734056325661314, 4.199555822314082), (5.538567872823634, 4.1996779078838955), (5.343080582705667, 4.199756585251109), (5.147595618027125, 4.199802318893134), (4.952113560147865, 4.199816465316303), (4.756630145762273, 4.199800962386803), (4.561147894096393, 4.19975794175744), (4.365664285924183, 4.199686628281739), (4.170183390764635, 4.199580045641426), (3.974701139098755, 4.1994405192759245), (3.779218887432876, 4.199264948599335), (3.5837366357669964, 4.199009925409058), (3.3881109820032407, 4.198595803404785), (3.3881109820032407, 4.198595803404785), (3.1927025630391057, 4.198236329227001), (2.997255774324458, 4.197737328683715), (2.801790188307791, 4.197125156755078), (2.6062952436183835, 4.195692686069265), (2.410804949807826, 4.190964292571721), (2.2150827903079318, 4.183555248776983), (2.0190451461927097, 4.16967140647651), (1.8255455254232797, 4.1381578265350925), (1.6399065197169342, 4.077816355401538), (1.4684209619443997, 3.98580995697732), (1.316564535251782, 3.863567226215878), (1.18828627180266, 3.716441712246848), (1.087181058714844, 3.5495077176822467), (1.0159622477774413, 3.3684589840609287), (0.9734102913519926, 3.178145699770326), (0.9534938958331036, 2.9834065228940503), (0.9444216541596013, 2.7872029974331767), (0.9405074066940884, 2.5907339843046135), (0.9396984929007637, 2.3942255355991335), (0.9471365077950047, 2.1980486557983383), (0.9667406161777752, 2.003330698556816), (1.008643508547042, 1.8129062776403588), (1.0777365771700467, 1.6310002804643384), (1.1746683531897695, 1.460860280079107), (1.2993533282606862, 1.3105290994160301), (1.4485447529255744, 1.1851194108376364), (1.618276541798405, 1.0898755162672418), (1.80267831683733, 1.026955253927975), (1.9950098887622332, 0.9923725057420933), (2.190220548481932, 0.9752908935522877), (2.3860145059240736, 0.9666594679897911), (2.581804490740531, 0.9621571992530031), (2.77751667022956, 0.9599051322865064), (2.973129727863096, 0.9587203451227853)]
17 |
18 | bowtie = [(2.0846271888571692, 0.8706601931795019), (2.194043764683286, 0.8716426671132462), (2.302089784648281, 0.8852901866321512), (2.4072427641819303, 0.9121101819974184), (2.5082300096655814, 0.9515110226619987), (2.604580425829049, 1.0017894453637004), (2.6963777284916333, 1.0604913848093054), (2.783898354264984, 1.125405275435636), (2.867849139840999, 1.19488504525636), (2.949468284820192, 1.267090278529864), (3.0314925407258855, 1.338788420668749), (3.1164390988423563, 1.40675025990479), (3.206142924662565, 1.4680526704340802), (3.3007656362265507, 1.5213249510555331), (3.39972383891856, 1.5660911133868392), (3.5017875690693785, 1.6028887215084178), (3.6059362494513465, 1.6321652287229649), (3.7106033090384756, 1.654876245294201), (3.8165671886782917, 1.6701384918138553), (3.922774658097879, 1.6777550326306214), (4.029503025948671, 1.6761163729824562), (4.137520268600781, 1.6637501705867381), (4.248063519828321, 1.641340346867697), (4.356234435269101, 1.6121070056224769), (4.460816422530598, 1.5767272372969965), (4.562518159277586, 1.5345382432084709), (4.660673794688037, 1.4860938170666353), (4.755010670989364, 1.4312758459273633), (4.845077846719732, 1.3700452333403208), (4.930635220258509, 1.3026943548665495), (5.012500764923445, 1.2306687133419738), (5.093230720002495, 1.15719349946248), (5.176696360778465, 1.086492970836929), (5.264875085909097, 1.022232359125738), (5.356701068991256, 0.9690724747431612), (5.4535970913798195, 0.9277889486307525), (5.552453846776913, 0.898092917609935), (5.649335916528926, 0.8786943441596782), (5.742943767570509, 0.868390152504116), (5.835258674291779, 0.8679594132972854), (5.927503817830299, 0.8777711447079446), (5.927503817830299, 0.8777711447079446), (6.021150038622395, 0.8978701841150072), (6.116593048943557, 0.9275729249974989), (6.211942072754624, 0.9671564095502527), (6.305304977510104, 1.0163211890006425), (6.394923731004681, 1.0747011519791914), (6.479259086125609, 1.1424339354318678), (6.55556101696618, 1.2190297921264313), (6.623423346773492, 1.303674382244232), (6.682039923213537, 1.3952060034525078), (6.7308371378948095, 1.492320617147023), (6.768290859060826, 1.594265168527308), (6.793858484179083, 1.6998927314902803), (6.809249792586826, 1.8076623148436257), (6.8175481231750155, 1.9163238011097763), (6.821596713213978, 2.0252424422190103), (6.8234124938316825, 2.134190635787604), (6.82421399528684, 2.2431108271897884), (6.824611645428519, 2.3520054387582974), (6.824865893472321, 2.4608853225437812), (6.8251387450315235, 2.5697382699892586), (6.825251528843637, 2.678588698208692), (6.8252697447858, 2.7874442617735227), (6.825210058507224, 2.8963035072841095), (6.825091848669786, 3.0051705042594463), (6.825028286658835, 3.1144133503818523), (6.823068328796779, 3.223605327516836), (6.817423324592539, 3.3328786950316953), (6.804945791784348, 3.441905759754121), (6.782846559568512, 3.548499252118262), (6.7481562355858955, 3.6509375718031265), (6.701175382882184, 3.7480709827996606), (6.643319225134121, 3.840594403922708), (6.576401605093224, 3.9279117475329883), (6.502037928013408, 4.009094000580205), (6.420977566749386, 4.083304004871351), (6.333561198176923, 4.149477290509623), (6.240148877833661, 4.206397458889114), (6.1413413442377305, 4.252757613052964), (6.038100554164615, 4.287701409932907), (5.931556477388256, 4.309951989497989), (5.823203983885705, 4.319469237918128), (5.714544144805814, 4.31640101438343), (5.607876819739928, 4.3016753630111), (5.503477573259914, 4.275317669848192), (5.402686633621059, 4.23687738100611), (5.307115336558283, 4.186403718286016), (5.2175370844670255, 4.125393101957911), (5.133129253150685, 4.056889338442531), (5.051686550887865, 3.9845817373876713), (4.970472710621792, 3.9119619460900026), (4.887038657064679, 3.8420065270135524), (4.799704454018567, 3.7771463395039433), (4.707721116201981, 3.719187474847942), (4.611272159542878, 3.6689818190215817), (4.51117090648016, 3.6263212451963227), (4.408427760443999, 3.59010582052413), (4.3037188429472195, 3.559928205532387), (4.197352468500256, 3.536433128301681), (4.089604589248211, 3.520961979807012), (3.9809852515716386, 3.514736390892992), (3.8722223180105715, 3.5182148606995867), (3.7640360934269097, 3.5305160476847135), (3.657004449517771, 3.55069640480167), (3.551605845444854, 3.578117017568431), (3.4484055567750573, 3.6127662587878717), (3.3480805770609905, 3.654898764077032), (3.2512431751246, 3.7044986429331743), (3.1581839340007036, 3.76091826047643), (3.0687403636094785, 3.822987145529538), (2.9823536802357538, 3.889317785902236), (2.8980764611004517, 3.958395739168978), (2.8145408633551128, 4.0284476639815665), (2.7299297498757014, 4.097218077884349), (2.6423491471438467, 4.162108689893103), (2.5467712613360334, 4.220834755772742), (2.447368415247297, 4.267252076989124), (2.3446720686795643, 4.299309422182759), (2.2376432346763977, 4.317781550255418), (2.1269197618934186, 4.321778205480555), (2.0177673172286603, 4.313549831861735), (1.9133023770848894, 4.294769001705404), (1.8082865984773164, 4.265484161666251), (1.707903482777624, 4.225935025791671), (1.611928092168096, 4.176062295376326), (1.5209921225792087, 4.115786711693147), (1.437207945048666, 4.045327059834705), (1.3608611041591985, 3.966640584650392), (1.2932369381063324, 3.880302057251427), (1.2343876723838214, 3.78807978053392), (1.1849487333145525, 3.6914391689088717), (1.1465006445610655, 3.5906379585792223), (1.1192923734818017, 3.486129610232851), (1.1019517896993616, 3.379184201369057), (1.0916233989397828, 3.270973850351359), (1.0854693657347365, 3.1623024809676537), (1.0818254748257097, 3.0535117390267956), (1.080564529520819, 2.944679139176287), (1.081007477284631, 2.835822315998435), (1.0816858757902263, 2.726959194755473), (1.0819457678692999, 2.6180948138994893), (1.0819509274380241, 2.5092226815787555), (1.0817726437487725, 2.400234858646627), (1.0815676659527877, 2.291246938821189), (1.0814943903875722, 2.1821671641384626), (1.0821417103641853, 2.0729467003705224), (1.0847603247200512, 1.9635008627649722), (1.0916203468005374, 1.854340957315394), (1.1051496564820038, 1.7459559076608928), (1.1275455033411674, 1.639288824828281), (1.1611287243708546, 1.5358176224654694), (1.207115064147132, 1.4371209348154645), (1.2644737231982042, 1.345720797828012), (1.332120756072083, 1.2614456618988614), (1.4077424958808358, 1.1834941709128197), (1.489520109867513, 1.1110059122826288), (1.5764458591679507, 1.0448595872076913), (1.6683443668921782, 0.9864707342680072), (1.7664947700639217, 0.9392008003757726), (1.8700660632153188, 0.9042407496431812), (1.9759280110936714, 0.8817409120397299), (2.0846271888571692, 0.8706601931795019)]
--------------------------------------------------------------------------------
/data/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/data/.DS_Store
--------------------------------------------------------------------------------
/data/_reinvent_waypoints2019_4__10__20191206-102941.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/data/_reinvent_waypoints2019_4__10__20191206-102941.png
--------------------------------------------------------------------------------
/data/_reinvent_waypoints2019_4__10__20191206-102941SP.txt:
--------------------------------------------------------------------------------
1 | 1,
2 | 1,
3 | 1,
4 | 1,
5 | 1,
6 | 1,
7 | 1,
8 | 1,
9 | 1,
10 | 2,
11 | 3,
12 | 3,
13 | 3,
14 | 3,
15 | 2,
16 | 1,
17 | 1,
18 | 1,
19 | 1,
20 | 1,
21 | 1,
22 | 1,
23 | 1,
24 | 1,
25 | 1,
26 | 1,
27 | 1,
28 | 2,
29 | 3,
30 | 3,
31 | 3,
32 | 3,
33 | 2,
34 | 1,
35 | 1,
36 | 1,
37 | 1,
38 | 1,
39 | 1,
40 | 1,
41 | 2,
42 | 3,
43 | 3,
44 | 3,
45 | 2,
46 | 2,
47 | 1,
48 | 2,
49 | 3,
50 | 3,
51 | 2,
52 | 2,
53 | 3,
54 | 1,
55 | 3,
56 | 3,
57 | 3,
58 | 1,
59 | 1,
60 | 1,
61 | 1,
62 | 1,
63 | 1,
64 | 2,
65 | 2,
66 | 2,
67 | 2,
68 | 2,
69 | 1,
70 | 2,
71 | 1,
72 | 2,
73 | 2,
74 | 2,
75 | 2,
76 | 2,
77 | 2,
78 | 1,
79 | 2,
80 | 2,
81 | 2,
82 | 2,
83 | 3,
84 | 2,
85 | 3,
86 | 3,
87 | 2,
88 | 3,
89 | 2,
90 | 2,
91 | 2,
92 | 2,
93 | 1,
94 | 2,
95 | 3,
96 | 3,
97 | 2,
98 | 2,
99 | 3,
100 | 2,
101 | 2,
102 | 3,
103 | 3,
104 | 3,
105 | 3,
106 | 2,
107 | 2,
108 | 3,
109 | 3,
110 | 2,
111 | 2,
112 | 3,
113 | 1,
114 | 3,
115 | 3,
116 | 3,
117 | 2,
118 | 1,
119 | 1,
120 | 1,
121 | 2,
122 | 3,
123 | 2,
124 | 2,
125 | 2,
126 | 2,
127 | 3,
128 | 2,
129 | 1,
130 | 1,
131 | 2,
132 | 2,
133 | 2,
134 | 2,
135 | 3,
136 | 3,
137 | 3,
138 | 1,
139 | 3,
140 | 3,
141 | 3,
142 | 2,
143 | 1,
144 | 1,
145 | 1,
146 | 1,
147 | 2,
148 | 1,
149 | 2,
150 | 3,
151 | 3,
152 | 2,
153 | 2,
154 | 1,
155 | 2,
156 | 3,
157 | 2,
158 | 1,
159 | 1,
160 | 1,
161 | 2,
162 | 3,
163 | 3,
164 | 2,
165 | 2,
166 | 3,
167 | 3,
168 | 2,
169 | 1,
170 | 1,
171 | 1,
172 | 2,
173 | 3,
174 | 3,
175 | 3,
176 | 3,
177 | 2,
178 | 1,
179 | 1,
180 | 1,
181 | 1,
182 | 1,
183 | 1,
184 |
--------------------------------------------------------------------------------
/data/_reinvent_waypoints2019_4__10__20191206-102941WP.txt:
--------------------------------------------------------------------------------
1 | (0.34694278119367206, 2.446942781193672),
2 | (0.42480953071047234, 2.369233261155884),
3 | (0.5025853927403221, 2.29144651578949),
4 | (0.5801866407767486, 2.213511404311612),
5 | (0.6577659554927209, 2.13555765651826),
6 | (0.7357608274019345, 2.0579569995835008),
7 | (0.8143965425638633, 1.980900854687047),
8 | (0.8924853779505955, 1.903380036690208),
9 | (0.9683334543433428, 1.8239552893908475),
10 | (1.0430183197332568, 1.743542184343395),
11 | (1.1224969725453469, 1.6672022671611448),
12 | (1.2126165000161353, 1.6008830543788308),
13 | (1.3132821448851413, 1.5550872433749208),
14 | (1.4209963760555235, 1.5408129323458475),
15 | (1.5318377385595172, 1.546136684567033),
16 | (1.642213345826295, 1.5485133551639148),
17 | (1.751955318172313, 1.5468806737767629),
18 | (1.8619076154838137, 1.5465788266959057),
19 | (1.971975721445848, 1.5470097825062334),
20 | (2.0819759728486287, 1.5470113927005993),
21 | (2.1919630795323966, 1.5469297415178334),
22 | (2.301967210750354, 1.5469558421552705),
23 | (2.4119542384613233, 1.5468740772473213),
24 | (2.5219545201657394, 1.5468758349376435),
25 | (2.632022882003506, 1.5473070680074321),
26 | (2.7419748999418863, 1.5470043901108925),
27 | (2.8517159912677656, 1.545371122740359),
28 | (2.962093394842141, 1.5477518896280702),
29 | (3.0729373054729745, 1.5530755169745163),
30 | (3.1806416592490816, 1.5387818847907218),
31 | (3.2812931418310587, 1.4929659319092439),
32 | (3.3714377633085806, 1.4266668436213212),
33 | (3.4509711772735687, 1.3503743707286098),
34 | (3.5256250456689275, 1.2699344494427296),
35 | (3.601264148124541, 1.190328828211103),
36 | (3.6792228235513185, 1.1126953545683125),
37 | (3.7582640727244425, 1.0359901799816083),
38 | (3.837123016565131, 0.9591373360978013),
39 | (3.914539051764238, 0.8810422796534947),
40 | (3.9894878983800344, 0.8008116527397826),
41 | (4.06489863575942, 0.7209780151749383),
42 | (4.146978347285668, 0.646914592479172),
43 | (4.2404213646609215, 0.5852916626897545),
44 | (4.343482580145638, 0.5476183933136374),
45 | (4.452616243841675, 0.5410078824987496),
46 | (4.563431071752605, 0.5478807767908054),
47 | (4.67317334322737, 0.5498811151163641),
48 | (4.783850964175125, 0.5443364867630114),
49 | (4.894722729128505, 0.5407183273346317),
50 | (4.999804869025251, 0.5626163934639625),
51 | (5.097722200047036, 0.6139741381400282),
52 | (5.192104219378672, 0.6782522499760235),
53 | (5.289101370815466, 0.732234059007079),
54 | (5.396817941338233, 0.7480260906277569),
55 | (5.50888474149478, 0.7416700458119632),
56 | (5.6037718242959915, 0.7755968462253895),
57 | (5.680030383981013, 0.8571034351461817),
58 | (5.751174617765207, 0.9522173089077912),
59 | (5.827394690337483, 1.0349319918397004),
60 | (5.906620889726478, 1.109012581562126),
61 | (5.984389350032279, 1.184183464736392),
62 | (6.060654805463864, 1.263001076512268),
63 | (6.1399463905261555, 1.3406011579944066),
64 | (6.224568008281231, 1.4138245190400276),
65 | (6.3042481075129615, 1.4900822061682657),
66 | (6.364980330891582, 1.579957156589456),
67 | (6.409996045837524, 1.6813564570025772),
68 | (6.468193082617304, 1.773309618083676),
69 | (6.549608677371808, 1.8484816419638173),
70 | (6.629740950302187, 1.9245517876635696),
71 | (6.6851204613133834, 2.0184649612508676),
72 | (6.7304998807984955, 2.119604802453042),
73 | (6.797264798969881, 2.2053559024712834),
74 | (6.880823637760756, 2.2789914418762884),
75 | (6.955684639919697, 2.3588243283271577),
76 | (7.007403925431877, 2.4552964361596223),
77 | (7.0517854704713585, 2.557294524213018),
78 | (7.102177475261595, 2.6551716844807847),
79 | (7.149955536448818, 2.7541040496571543),
80 | (7.191134675961283, 2.856924563624855),
81 | (7.249816369774722, 2.95006900497354),
82 | (7.340581263804289, 3.02443443300699),
83 | (7.423673049363687, 3.098719239335552),
84 | (7.449811708612907, 3.196673674696831),
85 | (7.440464663388488, 3.310702679376638),
86 | (7.486249231507287, 3.4023566569842134),
87 | (7.580847527902858, 3.473433186850969),
88 | (7.6495901793840115, 3.5541835734923066),
89 | (7.65085965112768, 3.6624049424499288),
90 | (7.651923015608649, 3.77468717768105),
91 | (7.699359522795014, 3.8736216110084167),
92 | (7.759507207931829, 3.9687042039096894),
93 | (7.807844972197492, 4.067237035740376),
94 | (7.85739558772147, 4.165738918939393),
95 | (7.913052208247338, 4.262628518532633),
96 | (7.95060151421432, 4.363695642966773),
97 | (7.9546866239393985, 4.472696971406139),
98 | (7.94217730162657, 4.5857481254455585),
99 | (7.937775992060359, 4.696861290458555),
100 | (7.968707273248306, 4.79913298920361),
101 | (8.024206405810185, 4.895796309491256),
102 | (8.058697727804146, 4.9992346634738585),
103 | (8.054610636069931, 5.110587596881063),
104 | (8.023752893017425, 5.219289878058719),
105 | (7.971184782568129, 5.316342961127052),
106 | (7.898027644906275, 5.3961222088395715),
107 | (7.820470795549651, 5.4785706163827665),
108 | (7.748468344273018, 5.571609918058986),
109 | (7.667353739104454, 5.639407846809712),
110 | (7.563834576093578, 5.651486884831391),
111 | (7.450764268486909, 5.646550127391134),
112 | (7.34815361221853, 5.680622709417955),
113 | (7.2533147988063025, 5.742489987529785),
114 | (7.1579749891336295, 5.803878671369944),
115 | (7.057473872853423, 5.844664299037035),
116 | (6.949438436307988, 5.852809524833658),
117 | (6.837896795054549, 5.8465764270032405),
118 | (6.727523113510754, 5.84625837183024),
119 | (6.618242594906775, 5.846533643198532),
120 | (6.508667190400752, 5.844698671756436),
121 | (6.396864312077925, 5.851564779114764),
122 | (6.286121760102564, 5.854833870028633),
123 | (6.184840958858766, 5.818026566499816),
124 | (6.088191995807472, 5.76141376627303),
125 | (5.98268766399905, 5.742499550536435),
126 | (5.871179347275461, 5.748885337063156),
127 | (5.7676080862674315, 5.720920344774395),
128 | (5.6714116760814886, 5.662577971840459),
129 | (5.5753697393355, 5.606246288860657),
130 | (5.476343167709858, 5.559492771788033),
131 | (5.3741048990115505, 5.5163349746533985),
132 | (5.275880966696381, 5.466520911336827),
133 | (5.191827615986499, 5.398846621914698),
134 | (5.117200310911786, 5.318096068281225),
135 | (5.037884384095102, 5.239094830249458),
136 | (4.94407641288006, 5.176798330068069),
137 | (4.838979978143458, 5.1460850080157226),
138 | (4.728518177808121, 5.148331546937603),
139 | (4.6197549662570285, 5.1417494344012695),
140 | (4.518519537382211, 5.097976302104849),
141 | (4.427817223760206, 5.030987302236126),
142 | (4.347738178953193, 4.955066161781399),
143 | (4.272925750357178, 4.8751110809654445),
144 | (4.197647122002266, 4.794733629674781),
145 | (4.119979874068246, 4.716250936540936),
146 | (4.040564905076481, 4.6411084947822605),
147 | (3.9606354601048097, 4.568459398535458),
148 | (3.8831425944551676, 4.490277857540708),
149 | (3.810999929163088, 4.398128523019375),
150 | (3.738821885533452, 4.305741309846098),
151 | (3.653103828194984, 4.248530275666321),
152 | (3.5455198778314876, 4.246849215693546),
153 | (3.434398011712226, 4.243934535633166),
154 | (3.3359910986167254, 4.1935346211552975),
155 | (3.238102212939728, 4.144388951590734),
156 | (3.129462791845244, 4.138914320083716),
157 | (3.016999396675865, 4.148828856073186),
158 | (2.906956133605696, 4.149019573687415),
159 | (2.7978325562831228, 4.145428463006947),
160 | (2.6878771321487522, 4.145220327215712),
161 | (2.5763277900661845, 4.151758549118691),
162 | (2.4666726264407792, 4.150306007487313),
163 | (2.364375203177887, 4.1176796672653975),
164 | (2.267820513577013, 4.060722661410715),
165 | (2.1723082622687384, 3.9993611845791137),
166 | (2.0731036880152476, 3.9536294545323654),
167 | (1.9662565066649957, 3.9402349822133806),
168 | (1.8547861486712032, 3.946487166334467),
169 | (1.744228471411911, 3.9489951705355053),
170 | (1.634744461137912, 3.9466145911127835),
171 | (1.5250272152061175, 3.944931688930209),
172 | (1.4143615901970092, 3.9489160390622025),
173 | (1.303739664976498, 3.9528575326633244),
174 | (1.1969147194068555, 3.933456596169744),
175 | (1.0976779553946603, 3.8835842063801436),
176 | (1.0094240245908246, 3.8151932186178867),
177 | (0.9311219802041584, 3.7378550589138633),
178 | (0.8566102478163689, 3.6572854266252546),
179 | (0.7803362086886443, 3.578218268517512),
180 | (0.7020519960708169, 3.500864906140953),
181 | (0.6234429120505962, 3.4237885164860757),
182 | (0.5454883859455998, 3.3461540762119593),
183 | (0.46796552128821844, 3.268151618177249),
184 |
--------------------------------------------------------------------------------
/data/_reinvent_waypoints2019_5__10__20191206-164237.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrousseau/AWS-Deepracer-Optimal-Path-Generator/f980e3c18d6e1dfe30b21da63d2415594fca6812/data/_reinvent_waypoints2019_5__10__20191206-164237.png
--------------------------------------------------------------------------------
/data/_reinvent_waypoints2019_5__10__20191206-164237SP.txt:
--------------------------------------------------------------------------------
1 | 1,
2 | 1,
3 | 1,
4 | 1,
5 | 1,
6 | 1,
7 | 1,
8 | 1,
9 | 1,
10 | 2,
11 | 3,
12 | 3,
13 | 3,
14 | 3,
15 | 2,
16 | 1,
17 | 1,
18 | 1,
19 | 1,
20 | 1,
21 | 1,
22 | 1,
23 | 1,
24 | 1,
25 | 1,
26 | 1,
27 | 1,
28 | 2,
29 | 3,
30 | 3,
31 | 3,
32 | 3,
33 | 2,
34 | 1,
35 | 1,
36 | 1,
37 | 1,
38 | 1,
39 | 1,
40 | 1,
41 | 2,
42 | 3,
43 | 3,
44 | 3,
45 | 2,
46 | 2,
47 | 1,
48 | 2,
49 | 3,
50 | 3,
51 | 2,
52 | 2,
53 | 3,
54 | 1,
55 | 3,
56 | 3,
57 | 3,
58 | 1,
59 | 1,
60 | 1,
61 | 1,
62 | 1,
63 | 1,
64 | 2,
65 | 2,
66 | 2,
67 | 2,
68 | 2,
69 | 1,
70 | 2,
71 | 1,
72 | 2,
73 | 2,
74 | 2,
75 | 2,
76 | 2,
77 | 2,
78 | 1,
79 | 2,
80 | 2,
81 | 2,
82 | 2,
83 | 3,
84 | 2,
85 | 3,
86 | 3,
87 | 2,
88 | 3,
89 | 2,
90 | 2,
91 | 2,
92 | 2,
93 | 1,
94 | 2,
95 | 3,
96 | 3,
97 | 2,
98 | 2,
99 | 3,
100 | 2,
101 | 2,
102 | 3,
103 | 3,
104 | 3,
105 | 3,
106 | 2,
107 | 2,
108 | 3,
109 | 3,
110 | 2,
111 | 2,
112 | 3,
113 | 1,
114 | 3,
115 | 3,
116 | 3,
117 | 2,
118 | 1,
119 | 1,
120 | 1,
121 | 2,
122 | 3,
123 | 2,
124 | 2,
125 | 2,
126 | 2,
127 | 3,
128 | 2,
129 | 1,
130 | 1,
131 | 2,
132 | 2,
133 | 2,
134 | 2,
135 | 3,
136 | 3,
137 | 3,
138 | 1,
139 | 3,
140 | 3,
141 | 3,
142 | 2,
143 | 1,
144 | 1,
145 | 1,
146 | 1,
147 | 2,
148 | 1,
149 | 2,
150 | 3,
151 | 3,
152 | 2,
153 | 2,
154 | 1,
155 | 2,
156 | 3,
157 | 2,
158 | 1,
159 | 1,
160 | 1,
161 | 2,
162 | 3,
163 | 3,
164 | 2,
165 | 2,
166 | 3,
167 | 3,
168 | 2,
169 | 1,
170 | 1,
171 | 1,
172 | 2,
173 | 3,
174 | 3,
175 | 3,
176 | 3,
177 | 2,
178 | 1,
179 | 1,
180 | 1,
181 | 1,
182 | 1,
183 | 1,
184 |
--------------------------------------------------------------------------------
/data/_reinvent_waypoints2019_5__10__20191206-164237WP.txt:
--------------------------------------------------------------------------------
1 | (0.34694278119367206, 2.446942781193672),
2 | (0.42480953071047234, 2.369233261155884),
3 | (0.5025853927403221, 2.29144651578949),
4 | (0.5801866407767486, 2.213511404311612),
5 | (0.6577659554927209, 2.13555765651826),
6 | (0.7357608274019345, 2.0579569995835008),
7 | (0.8143965425638633, 1.980900854687047),
8 | (0.8924853779505955, 1.903380036690208),
9 | (0.9683334543433428, 1.8239552893908475),
10 | (1.0430183197332568, 1.743542184343395),
11 | (1.1224969725453469, 1.6672022671611448),
12 | (1.2126165000161353, 1.6008830543788308),
13 | (1.3132821448851413, 1.5550872433749208),
14 | (1.4209963760555235, 1.5408129323458475),
15 | (1.5318377385595172, 1.546136684567033),
16 | (1.642213345826295, 1.5485133551639148),
17 | (1.751955318172313, 1.5468806737767629),
18 | (1.8619076154838137, 1.5465788266959057),
19 | (1.971975721445848, 1.5470097825062334),
20 | (2.0819759728486287, 1.5470113927005993),
21 | (2.1919630795323966, 1.5469297415178334),
22 | (2.301967210750354, 1.5469558421552705),
23 | (2.4119542384613233, 1.5468740772473213),
24 | (2.5219545201657394, 1.5468758349376435),
25 | (2.632022882003506, 1.5473070680074321),
26 | (2.7419748999418863, 1.5470043901108925),
27 | (2.8517159912677656, 1.545371122740359),
28 | (2.962093394842141, 1.5477518896280702),
29 | (3.0729373054729745, 1.5530755169745163),
30 | (3.1806416592490816, 1.5387818847907218),
31 | (3.2812931418310587, 1.4929659319092439),
32 | (3.3714377633085806, 1.4266668436213212),
33 | (3.4509711772735687, 1.3503743707286098),
34 | (3.5256250456689275, 1.2699344494427296),
35 | (3.601264148124541, 1.190328828211103),
36 | (3.6792228235513185, 1.1126953545683125),
37 | (3.7582640727244425, 1.0359901799816083),
38 | (3.837123016565131, 0.9591373360978013),
39 | (3.914539051764238, 0.8810422796534947),
40 | (3.9894878983800344, 0.8008116527397826),
41 | (4.06489863575942, 0.7209780151749383),
42 | (4.146978347285668, 0.646914592479172),
43 | (4.2404213646609215, 0.5852916626897545),
44 | (4.343482580145638, 0.5476183933136374),
45 | (4.452616243841675, 0.5410078824987496),
46 | (4.563431071752605, 0.5478807767908054),
47 | (4.67317334322737, 0.5498811151163641),
48 | (4.783850964175125, 0.5443364867630114),
49 | (4.894722729128505, 0.5407183273346317),
50 | (4.999804869025251, 0.5626163934639625),
51 | (5.097722200047036, 0.6139741381400282),
52 | (5.192104219378672, 0.6782522499760235),
53 | (5.289101370815466, 0.732234059007079),
54 | (5.396817941338233, 0.7480260906277569),
55 | (5.50888474149478, 0.7416700458119632),
56 | (5.6037718242959915, 0.7755968462253895),
57 | (5.680030383981013, 0.8571034351461817),
58 | (5.751174617765207, 0.9522173089077912),
59 | (5.827394690337483, 1.0349319918397004),
60 | (5.906620889726478, 1.109012581562126),
61 | (5.984389350032279, 1.184183464736392),
62 | (6.060654805463864, 1.263001076512268),
63 | (6.1399463905261555, 1.3406011579944066),
64 | (6.224568008281231, 1.4138245190400276),
65 | (6.3042481075129615, 1.4900822061682657),
66 | (6.364980330891582, 1.579957156589456),
67 | (6.409996045837524, 1.6813564570025772),
68 | (6.468193082617304, 1.773309618083676),
69 | (6.549608677371808, 1.8484816419638173),
70 | (6.629740950302187, 1.9245517876635696),
71 | (6.6851204613133834, 2.0184649612508676),
72 | (6.7304998807984955, 2.119604802453042),
73 | (6.797264798969881, 2.2053559024712834),
74 | (6.880823637760756, 2.2789914418762884),
75 | (6.955684639919697, 2.3588243283271577),
76 | (7.007403925431877, 2.4552964361596223),
77 | (7.0517854704713585, 2.557294524213018),
78 | (7.102177475261595, 2.6551716844807847),
79 | (7.149955536448818, 2.7541040496571543),
80 | (7.191134675961283, 2.856924563624855),
81 | (7.249816369774722, 2.95006900497354),
82 | (7.340581263804289, 3.02443443300699),
83 | (7.423673049363687, 3.098719239335552),
84 | (7.449811708612907, 3.196673674696831),
85 | (7.440464663388488, 3.310702679376638),
86 | (7.486249231507287, 3.4023566569842134),
87 | (7.580847527902858, 3.473433186850969),
88 | (7.6495901793840115, 3.5541835734923066),
89 | (7.65085965112768, 3.6624049424499288),
90 | (7.651923015608649, 3.77468717768105),
91 | (7.699359522795014, 3.8736216110084167),
92 | (7.759507207931829, 3.9687042039096894),
93 | (7.807844972197492, 4.067237035740376),
94 | (7.85739558772147, 4.165738918939393),
95 | (7.913052208247338, 4.262628518532633),
96 | (7.95060151421432, 4.363695642966773),
97 | (7.9546866239393985, 4.472696971406139),
98 | (7.94217730162657, 4.5857481254455585),
99 | (7.937775992060359, 4.696861290458555),
100 | (7.968707273248306, 4.79913298920361),
101 | (8.024206405810185, 4.895796309491256),
102 | (8.058697727804146, 4.9992346634738585),
103 | (8.054610636069931, 5.110587596881063),
104 | (8.023752893017425, 5.219289878058719),
105 | (7.971184782568129, 5.316342961127052),
106 | (7.898027644906275, 5.3961222088395715),
107 | (7.820470795549651, 5.4785706163827665),
108 | (7.748468344273018, 5.571609918058986),
109 | (7.667353739104454, 5.639407846809712),
110 | (7.563834576093578, 5.651486884831391),
111 | (7.450764268486909, 5.646550127391134),
112 | (7.34815361221853, 5.680622709417955),
113 | (7.2533147988063025, 5.742489987529785),
114 | (7.1579749891336295, 5.803878671369944),
115 | (7.057473872853423, 5.844664299037035),
116 | (6.949438436307988, 5.852809524833658),
117 | (6.837896795054549, 5.8465764270032405),
118 | (6.727523113510754, 5.84625837183024),
119 | (6.618242594906775, 5.846533643198532),
120 | (6.508667190400752, 5.844698671756436),
121 | (6.396864312077925, 5.851564779114764),
122 | (6.286121760102564, 5.854833870028633),
123 | (6.184840958858766, 5.818026566499816),
124 | (6.088191995807472, 5.76141376627303),
125 | (5.98268766399905, 5.742499550536435),
126 | (5.871179347275461, 5.748885337063156),
127 | (5.7676080862674315, 5.720920344774395),
128 | (5.6714116760814886, 5.662577971840459),
129 | (5.5753697393355, 5.606246288860657),
130 | (5.476343167709858, 5.559492771788033),
131 | (5.3741048990115505, 5.5163349746533985),
132 | (5.275880966696381, 5.466520911336827),
133 | (5.191827615986499, 5.398846621914698),
134 | (5.117200310911786, 5.318096068281225),
135 | (5.037884384095102, 5.239094830249458),
136 | (4.94407641288006, 5.176798330068069),
137 | (4.838979978143458, 5.1460850080157226),
138 | (4.728518177808121, 5.148331546937603),
139 | (4.6197549662570285, 5.1417494344012695),
140 | (4.518519537382211, 5.097976302104849),
141 | (4.427817223760206, 5.030987302236126),
142 | (4.347738178953193, 4.955066161781399),
143 | (4.272925750357178, 4.8751110809654445),
144 | (4.197647122002266, 4.794733629674781),
145 | (4.119979874068246, 4.716250936540936),
146 | (4.040564905076481, 4.6411084947822605),
147 | (3.9606354601048097, 4.568459398535458),
148 | (3.8831425944551676, 4.490277857540708),
149 | (3.810999929163088, 4.398128523019375),
150 | (3.738821885533452, 4.305741309846098),
151 | (3.653103828194984, 4.248530275666321),
152 | (3.5455198778314876, 4.246849215693546),
153 | (3.434398011712226, 4.243934535633166),
154 | (3.3359910986167254, 4.1935346211552975),
155 | (3.238102212939728, 4.144388951590734),
156 | (3.129462791845244, 4.138914320083716),
157 | (3.016999396675865, 4.148828856073186),
158 | (2.906956133605696, 4.149019573687415),
159 | (2.7978325562831228, 4.145428463006947),
160 | (2.6878771321487522, 4.145220327215712),
161 | (2.5763277900661845, 4.151758549118691),
162 | (2.4666726264407792, 4.150306007487313),
163 | (2.364375203177887, 4.1176796672653975),
164 | (2.267820513577013, 4.060722661410715),
165 | (2.1723082622687384, 3.9993611845791137),
166 | (2.0731036880152476, 3.9536294545323654),
167 | (1.9662565066649957, 3.9402349822133806),
168 | (1.8547861486712032, 3.946487166334467),
169 | (1.744228471411911, 3.9489951705355053),
170 | (1.634744461137912, 3.9466145911127835),
171 | (1.5250272152061175, 3.944931688930209),
172 | (1.4143615901970092, 3.9489160390622025),
173 | (1.303739664976498, 3.9528575326633244),
174 | (1.1969147194068555, 3.933456596169744),
175 | (1.0976779553946603, 3.8835842063801436),
176 | (1.0094240245908246, 3.8151932186178867),
177 | (0.9311219802041584, 3.7378550589138633),
178 | (0.8566102478163689, 3.6572854266252546),
179 | (0.7803362086886443, 3.578218268517512),
180 | (0.7020519960708169, 3.500864906140953),
181 | (0.6234429120505962, 3.4237885164860757),
182 | (0.5454883859455998, 3.3461540762119593),
183 | (0.46796552128821844, 3.268151618177249),
184 |
--------------------------------------------------------------------------------
/generate_track.py:
--------------------------------------------------------------------------------
1 | import matplotlib.pyplot as plt
2 | import seaborn as sns;
3 |
4 | sns.set()
5 | import numpy as np
6 | import pandas as pd
7 | import inquirer
8 | import math
9 | from CubicSpline.a_star import AStarPlanner
10 | from CubicSpline.rear_wheel_feedback import main
11 |
12 | from all_waypoints import reinvent_waypoints, kumo_torraku, AWS_track, Shanghai, Toronto, reinvent_waypoints2019, cumulo, oval, bowtie
13 |
14 | import shapely.geometry as shp
15 |
16 | from scipy.interpolate import interp1d
17 | import time
18 |
19 | show_animation = True
20 |
21 | def getdistance(x1, x2, y1, y2):
22 | return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
23 |
24 |
25 | def getAngle(a, b, c):
26 | ang = math.degrees(math.atan2(c[1] - b[1], c[0] - b[0]) - math.atan2(a[1] - b[1], a[0] - b[0]))
27 | return ang + 360 if ang < 0 else ang
28 |
29 |
30 | class generate_Track():
31 |
32 | def __init__(self):
33 |
34 | self.all_track = [reinvent_waypoints, kumo_torraku, AWS_track, Shanghai, Toronto, reinvent_waypoints2019, cumulo, oval, bowtie]
35 | self.all_responses = ['reinvent_waypoints', 'kumo_torraku', 'AWS_track', 'Shanghai', 'Toronto','reinvent_waypoints2019', 'cumulo','oval','bowtie']
36 |
37 | questions = [
38 | inquirer.List('track',
39 | message="Which track do you want ?",
40 | choices=self.all_responses,
41 | ), ]
42 |
43 | self.tracks = inquirer.prompt(questions)
44 | self.waypoints = self.all_track[self.all_responses.index(self.tracks["track"])]
45 | self.SCALE_COEFF = int(input(" Enlargement coefficient : "))
46 | self.INTERPOL_COEFF = int(input(" Interpolation coefficient : "))
47 | self.df_waypoints = pd.DataFrame(self.waypoints, columns=['X', 'Y'])
48 | self.x_origin = self.df_waypoints.X
49 | self.y_origin = self.df_waypoints.Y
50 | self.filename = str(
51 | 'data/_' + str(self.tracks["track"]) + "_" + str(self.INTERPOL_COEFF) + '__' + str(
52 | self.SCALE_COEFF) + '__' + time.strftime("%Y%m%d-%H%M%S"))
53 |
54 | def interpolate_waypoints(self, waypoints):
55 | points = np.array(waypoints)
56 | # Linear length along the line:
57 | distance = np.cumsum(np.sqrt(np.sum(np.diff(points, axis=0) ** 2, axis=1)))
58 | distance = np.insert(distance, 0, 0) / distance[-1]
59 |
60 | # interpolations_methods = ['cubic','next','previous' ...]
61 | alpha = np.linspace(0, 1, 1000)
62 |
63 | interpolated_points = {}
64 | interpolator = interp1d(distance, points, kind='next', axis=0)
65 | interpolated_points = interpolator(alpha)
66 |
67 | return interpolated_points
68 |
69 | def generate_both_shapes(self):
70 |
71 | self.central_waypoints = self.interpolate_waypoints(np.array(list(zip(self.x_origin, self.y_origin))))
72 |
73 | afpoly = shp.Polygon(self.central_waypoints)
74 | # Create offset airfoils, both inward and outward
75 |
76 |
77 | # Change the width of the track
78 | poffafpoly = afpoly.buffer(1.0666124816191023/2) # Outward offset
79 | noffafpoly = afpoly.buffer(-1.0666124816191023/2) # Inward offset
80 |
81 | # Turn polygon points into numpy arrays for plotting
82 | self.poffafpolypts = np.array(poffafpoly.exterior)
83 | self.noffafpolypts = np.array(noffafpoly.exterior)
84 |
85 | self.poffafpolypts = self.interpolate_waypoints(self.poffafpolypts)
86 | self.noffafpolypts = self.interpolate_waypoints(self.noffafpolypts)
87 |
88 | if show_animation:
89 | fig, axs = plt.subplots(2, 2, figsize=(10, 8), constrained_layout=True)
90 | axs[0, 0].plot(*self.central_waypoints.T)
91 | axs[0, 0].set_title('Central Line')
92 | axs[0, 0].set_xlabel('X')
93 | axs[0, 0].set_ylabel('Y')
94 | axs[0, 0].plot(self.x_origin, self.y_origin)
95 | fig.suptitle('Track generated', fontsize=16)
96 | axs[0, 1].plot(*self.noffafpolypts.T)
97 | axs[0, 1].set_xlabel('X')
98 | axs[0, 1].set_title('Outward offset')
99 | axs[0, 1].set_ylabel('Y')
100 |
101 | axs[1, 0].plot(*self.poffafpolypts.T)
102 | axs[1, 0].set_xlabel('X')
103 | axs[1, 0].set_title('Inward offset')
104 | axs[1, 0].set_ylabel('Y')
105 |
106 | axs[1, 1].plot(*self.poffafpolypts.T)
107 | axs[1, 1].plot(*self.noffafpolypts.T)
108 | axs[1, 1].plot(*self.central_waypoints.T)
109 | axs[1, 1].plot(self.x_origin, self.y_origin)
110 | axs[1, 1].set_xlabel('X')
111 | axs[1, 1].set_title('Total track')
112 | axs[1, 1].set_ylabel('Y')
113 | plt.show()
114 |
115 | self.all_coordinates = pd.concat([pd.DataFrame(self.poffafpolypts, columns=["X_ext", 'Y_ext']),
116 | pd.DataFrame(self.noffafpolypts, columns=["X_int", 'Y_int']),
117 | pd.DataFrame(self.central_waypoints, columns=["X_central", 'Y_central'])],
118 | axis=1)
119 |
120 | self.mindf = abs(min(self.all_coordinates.min()))
121 | self.all_coordinates = round((self.all_coordinates + self.mindf) * self.SCALE_COEFF)
122 | self.all_coordinates.to_csv('all_coordinates_scaled.csv', index=False)
123 |
124 | def generate_shortest_path(self):
125 |
126 | print(" Computing the shortest path !!")
127 |
128 | all_coordinates = self.all_coordinates
129 |
130 | # start and goal position
131 | sx = int(all_coordinates.X_central.iloc[10]) # [m]
132 | sy = int(all_coordinates.Y_central.iloc[10]) # [m]
133 | gx = int(all_coordinates.X_central.iloc[len(all_coordinates) - 20]) # [m]
134 | gy = int(all_coordinates.Y_central.iloc[len(all_coordinates) - 20]) # [m]
135 | grid_size = 1 # [m]
136 | robot_radius = 1 # [m]
137 |
138 | ox = [int(round(x)) for x in all_coordinates.X_ext[1:]] + [int(round(x)) for x in all_coordinates.X_int[:-1]]
139 | oy = [int(round(x)) for x in all_coordinates.Y_ext[1:]] + [int(round(x)) for x in all_coordinates.Y_int[:-1]]
140 |
141 | print("start enhanced")
142 |
143 | for i in range(0, self.INTERPOL_COEFF):
144 | ox_enhanced = [x + (ox[i + 1] - ox[i]) / 2 for i, (x, y) in enumerate(zip(ox, oy)) if i + 1 < len(ox)] + ox
145 | oy_enhanced = [y + (oy[i + 1] - oy[i]) / 2 for i, (x, y) in enumerate(zip(ox, oy)) if i + 1 < len(oy)] + oy
146 | ox = ox_enhanced
147 | oy = oy_enhanced
148 |
149 |
150 |
151 |
152 | # Add barrieres add the beginning of the track (use it for Reinvent 2018)
153 | #ox = ox + [int(all_coordinates.X_central.iloc[0])] * (int(self.SCALE_COEFF / 2) + 5)
154 | #oy = oy + [x + int(all_coordinates.Y_central.iloc[0]) for x in range(-5, int(self.SCALE_COEFF / 2))]
155 |
156 | print("enhanced finished")
157 | if show_animation:
158 | plt.plot(ox, oy, ".k")
159 | plt.plot(sx, sy, "og")
160 | plt.plot(gx, gy, "xb")
161 | plt.grid(True)
162 | plt.axis("equal")
163 |
164 | a_star = AStarPlanner(ox, oy, grid_size, robot_radius)
165 | rx, ry = a_star.planning(sx, sy, gx, gy)
166 |
167 | if show_animation: # pragma: no cover
168 | plt.plot(rx, ry, "-r")
169 | plt.show()
170 |
171 | print("Export shortest path")
172 | shortest_path_df = pd.DataFrame(list(zip(rx, ry)),
173 | columns=["xr", 'yr'])
174 | shortest_path_df = shortest_path_df.drop_duplicates()
175 | shortest_path_df.to_csv('shortest_path_points.csv', index=True)
176 |
177 | return rx, ry
178 |
179 | def improve_shorted_path(self):
180 |
181 | cx, cy = main()
182 |
183 | path_generated = pd.DataFrame(list(zip(cx, cy)), columns=["xr", 'yr'])
184 | path_generated = path_generated.drop_duplicates()
185 |
186 |
187 | ox = path_generated.xr
188 | oy = path_generated.yr
189 |
190 | self.downsampl = [(x, y) for i, (x, y) in enumerate(zip(ox, oy))]
191 | self.downsampl = (pd.DataFrame(self.downsampl, columns=['ox', 'oy'])) / (
192 | self.SCALE_COEFF) - self.mindf # <---- CHANGE THIS
193 | self.downsampl = self.downsampl.iloc[::int(len(self.downsampl) / 179), :].reset_index()
194 |
195 | # Windows version
196 | # filename = str('data/_' + str(reinventTrack.INTERPOL_COEFF) + '__' + str(reinventTrack.SCALE_COEFF) + '__' + timestr)
197 |
198 | exportfile = open(self.filename + "WP" + str('.txt'), 'w')
199 |
200 | for element in zip(self.downsampl.ox, self.downsampl.oy):
201 | exportfile.write(str(element) + ",")
202 | exportfile.write('\n')
203 | exportfile.close()
204 |
205 | def generated_speedpoints(self):
206 |
207 | downsampl = self.downsampl
208 | speedpoints = []
209 |
210 | SEUIL_ANGLE_MEDIUM = 20
211 | SEUIL_ANGLE_SMALL = 5
212 | STEP = 3
213 |
214 | for i in range(0, len(downsampl)):
215 | if i + STEP + 1 < len(downsampl) and i > STEP:
216 |
217 | angle = abs(180 - getAngle([downsampl.ox.iloc[i - STEP], downsampl.oy.iloc[i - STEP]],
218 | [downsampl.ox.iloc[i], downsampl.oy.iloc[i]],
219 | [downsampl.ox.iloc[i + STEP], downsampl.oy.iloc[i + STEP]]))
220 |
221 | if angle < SEUIL_ANGLE_SMALL:
222 | speedpoints.append(1)
223 | elif SEUIL_ANGLE_SMALL < angle < SEUIL_ANGLE_MEDIUM:
224 | speedpoints.append(2)
225 | elif angle > SEUIL_ANGLE_MEDIUM:
226 | speedpoints.append(3)
227 | else:
228 | speedpoints.append(1)
229 |
230 | self.speedpoints = speedpoints
231 |
232 | return speedpoints
233 |
234 | def export_result(self):
235 |
236 | labels = self.speedpoints
237 |
238 | exportfile = open(self.filename + "SP" + str('.txt'), 'w')
239 |
240 | for element in self.speedpoints:
241 | exportfile.write(str(element) + ",")
242 | exportfile.write('\n')
243 | exportfile.close()
244 |
245 | fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(35, 35)) # create figure & 1 axis
246 | plt.scatter(self.downsampl.ox, self.downsampl.oy, c='red', s=0.5)
247 |
248 | for i, txt in enumerate(labels):
249 | ax.annotate(txt, (self.downsampl.ox[i], self.downsampl.oy[i]))
250 | fig.savefig(self.filename + '.png') # save the figure to file
251 | plt.close(fig)
252 |
253 |
254 | reinventTrack = generate_Track()
255 |
256 | reinventTrack.generate_both_shapes()
257 |
258 | rx, ry = reinventTrack.generate_shortest_path()
259 |
260 | reinventTrack.improve_shorted_path()
261 |
262 | reinventTrack.generated_speedpoints()
263 |
264 | reinventTrack.export_result()
265 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | appnope==0.1.0
2 | attrs==19.1.0
3 | backcall==0.1.0
4 | bleach==3.1.0
5 | certifi==2019.9.11
6 | chardet==3.0.4
7 | cvxpy==1.0.25
8 | cycler==0.10.0
9 | decorator==4.4.0
10 | defusedxml==0.6.0
11 | dill==0.3.1.1
12 | ecos==2.0.7.post1
13 | entrypoints==0.3
14 | future==0.17.1
15 | idna==2.8
16 | ipykernel==5.1.2
17 | ipython==7.8.0
18 | ipython-genutils==0.2.0
19 | ipywidgets==7.5.1
20 | jedi==0.15.1
21 | Jinja2==2.10.1
22 | json5==0.8.5
23 | jsonschema==3.0.2
24 | jupyter==1.0.0
25 | jupyter-client==5.3.3
26 | jupyter-console==6.0.0
27 | jupyter-core==4.5.0
28 | jupyterlab==1.1.4
29 | jupyterlab-server==1.0.6
30 | kiwisolver==1.1.0
31 | lab==4.2
32 | MarkupSafe==1.1.1
33 | matplotlib==3.1.1
34 | mistune==0.8.4
35 | multiprocess==0.70.9
36 | nbconvert==5.6.0
37 | nbformat==4.4.0
38 | notebook==6.0.1
39 | numpy==1.17.2
40 | osqp==0.6.1
41 | panda==0.3.1
42 | pandas==0.25.1
43 | pandocfilters==1.4.2
44 | parso==0.5.1
45 | pexpect==4.7.0
46 | pickleshare==0.7.5
47 | prometheus-client==0.7.1
48 | prompt-toolkit==2.0.9
49 | ptyprocess==0.6.0
50 | Pygments==2.4.2
51 | pyparsing==2.4.2
52 | pyrsistent==0.15.4
53 | python-dateutil==2.8.0
54 | pytz==2019.2
55 | pyzmq==18.1.0
56 | qtconsole==4.5.5
57 | requests==2.22.0
58 | scipy==1.3.1
59 | scs==2.1.1.post2
60 | seaborn==0.9.0
61 | Send2Trash==1.5.0
62 | Shapely==1.6.4.post2
63 | simplejson==3.16.0
64 | six==1.12.0
65 | terminado==0.8.2
66 | testpath==0.4.2
67 | tornado==6.0.3
68 | traitlets==4.3.2
69 | urllib3==1.25.6
70 | wcwidth==0.1.7
71 | webencodings==0.5.1
72 | widgetsnbextension==3.5.1
73 |
--------------------------------------------------------------------------------
/shortest_path_points.csv:
--------------------------------------------------------------------------------
1 | ,xr,yr
2 | 0,7,35
3 | 1,8,36
4 | 2,9,37
5 | 3,10,38
6 | 4,11,39
7 | 5,12,40
8 | 6,13,41
9 | 7,14,42
10 | 8,15,43
11 | 9,16,43
12 | 10,17,43
13 | 11,18,43
14 | 12,19,43
15 | 13,20,43
16 | 14,21,43
17 | 15,22,43
18 | 16,23,43
19 | 17,24,43
20 | 18,25,43
21 | 19,26,44
22 | 20,27,44
23 | 21,28,45
24 | 22,29,45
25 | 23,30,45
26 | 24,31,45
27 | 25,32,45
28 | 26,33,45
29 | 27,34,45
30 | 28,35,45
31 | 29,36,45
32 | 30,37,46
33 | 31,38,46
34 | 32,39,46
35 | 33,40,46
36 | 34,41,47
37 | 35,42,48
38 | 36,43,49
39 | 37,44,50
40 | 38,45,51
41 | 39,46,52
42 | 40,47,53
43 | 41,48,54
44 | 42,49,54
45 | 43,50,55
46 | 44,51,55
47 | 45,52,55
48 | 46,53,56
49 | 47,54,56
50 | 48,55,57
51 | 49,56,58
52 | 50,57,59
53 | 51,58,59
54 | 52,59,60
55 | 53,60,60
56 | 54,61,60
57 | 55,62,61
58 | 56,63,61
59 | 57,64,61
60 | 58,65,61
61 | 59,66,62
62 | 60,67,62
63 | 61,68,62
64 | 62,69,62
65 | 63,70,62
66 | 64,71,62
67 | 65,72,62
68 | 66,73,62
69 | 67,74,62
70 | 68,75,62
71 | 69,76,61
72 | 70,77,61
73 | 71,78,60
74 | 72,79,60
75 | 73,80,60
76 | 74,81,59
77 | 75,82,58
78 | 76,83,57
79 | 77,83,56
80 | 78,84,55
81 | 79,84,54
82 | 80,84,53
83 | 81,84,52
84 | 82,83,51
85 | 83,83,50
86 | 84,83,49
87 | 85,83,48
88 | 86,83,47
89 | 87,82,46
90 | 88,82,45
91 | 89,82,44
92 | 90,81,43
93 | 91,81,42
94 | 92,80,41
95 | 93,80,40
96 | 94,80,39
97 | 95,79,38
98 | 96,78,37
99 | 97,78,36
100 | 98,78,35
101 | 99,77,34
102 | 100,76,33
103 | 101,76,32
104 | 102,75,31
105 | 103,75,30
106 | 104,74,29
107 | 105,73,28
108 | 106,73,27
109 | 107,72,26
110 | 108,71,25
111 | 109,70,24
112 | 110,70,23
113 | 111,69,22
114 | 112,68,21
115 | 113,67,20
116 | 114,67,19
117 | 115,66,18
118 | 116,65,17
119 | 117,64,16
120 | 118,63,15
121 | 119,62,14
122 | 120,61,13
123 | 121,60,12
124 | 122,59,11
125 | 123,58,11
126 | 124,57,11
127 | 125,56,10
128 | 126,55,10
129 | 127,54,9
130 | 128,53,9
131 | 129,52,9
132 | 130,51,9
133 | 131,50,9
134 | 132,49,9
135 | 133,48,9
136 | 134,47,9
137 | 135,46,10
138 | 136,45,10
139 | 137,44,11
140 | 138,43,12
141 | 139,42,13
142 | 140,41,14
143 | 141,40,15
144 | 142,39,16
145 | 143,38,17
146 | 144,37,18
147 | 145,36,19
148 | 146,35,19
149 | 147,34,19
150 | 148,33,19
151 | 149,32,19
152 | 150,31,19
153 | 151,30,19
154 | 152,29,19
155 | 153,28,19
156 | 154,27,19
157 | 155,26,19
158 | 156,25,19
159 | 157,24,19
160 | 158,23,19
161 | 159,22,19
162 | 160,21,19
163 | 161,20,19
164 | 162,19,19
165 | 163,18,19
166 | 164,17,19
167 | 165,16,19
168 | 166,15,20
169 | 167,14,21
170 | 168,13,22
171 | 169,12,23
172 | 170,11,24
173 | 171,10,25
174 | 172,9,26
175 | 173,8,27
176 | 174,7,28
177 | 175,7,29
178 |
--------------------------------------------------------------------------------