(x, y, yaw)
| 68 | |
| 69 | |
| 70 | def plot_car(x, y, yaw): |
| 71 | car_color = '-k' |
| 72 | c, s = cos(yaw), sin(yaw) |
| 73 | |
| 74 | car_outline_x, car_outline_y = [], [] |
| 75 | for rx, ry in zip(VRX, VRY): |
| 76 | tx = c * rx - s * ry + x |
| 77 | ty = s * rx + c * ry + y |
| 78 | car_outline_x.append(tx) |
| 79 | car_outline_y.append(ty) |
| 80 | |
| 81 | arrow_x, arrow_y, arrow_yaw = c * 1.5 + x, s * 1.5 + y, yaw |
| 82 | plot_arrow(arrow_x, arrow_y, arrow_yaw) |
| 83 | |
| 84 | plt.plot(car_outline_x, car_outline_y, car_color) |
| 85 | |
| 86 | |
| 87 | def pi_2_pi(angle): |
no test coverage detected