13file_name =
"./src/planning/src/utils/skidpad.txt"
19with open(file_name,
"w")
as file:
22 file.write(f
"{i/2:.3f} 0 {entryspeed}\n")
25 for i
in range(numPoints):
26 theta = (2 * math.pi / numPoints) * i - math.pi / 2
27 x = centerX + radius * math.cos(theta)
28 y = centerY + radius * math.sin(theta)
29 file.write(f
"{x:.3f} -{y:.3f} {circular_speed}\n")
31 for i
in range(numPoints):
32 theta = (2 * math.pi / numPoints) * i - math.pi / 2
33 x = centerX + radius * math.cos(theta)
34 y = centerY + radius * math.sin(theta)
35 file.write(f
"{x:.3f} -{y:.3f} {circular_speed}\n")
37 for i
in range(numPoints):
38 theta = (2 * math.pi / numPoints) * i - math.pi / 2
39 x = centerX + radius * math.cos(theta)
40 y = centerY + radius * math.sin(theta)
41 file.write(f
"{x:.3f} {y:.3f} {circular_speed}\n")
43 for i
in range(numPoints):
44 theta = (2 * math.pi / numPoints) * i - math.pi / 2
45 x = centerX + radius * math.cos(theta)
46 y = centerY + radius * math.sin(theta)
47 file.write(f
"{x:.3f} {y:.3f} {circular_speed}\n")
51 file.write(f
"{15+i/2:.3f} 0 {exitspeed}\n")
54 file.write(f
"{30+i/2:.3f} 0 {0}\n")
56 file_path = os.path.abspath(file_name)
57 print(f
"File written to: {file_path}")