(self, ax, xs: jnp.ndarray)
| 110 | return 3 |
| 111 | |
| 112 | def render(self, ax, xs: jnp.ndarray): |
| 113 | # obstacles |
| 114 | for i in range(self.obs_center.shape[0]): |
| 115 | circle = plt.Circle( |
| 116 | self.obs_center[i, :], self.obs_radius, color="k", fill=True, alpha=0.5 |
| 117 | ) |
| 118 | ax.add_artist(circle) |
| 119 | # ax.quiver( |
| 120 | # xs[:, 0], |
| 121 | # xs[:, 1], |
| 122 | # jnp.sin(xs[:, 2]), |
| 123 | # jnp.cos(xs[:, 2]), |
| 124 | # range(self.H + 1), |
| 125 | # cmap="Reds", |
| 126 | # ) |
| 127 | ax.scatter(xs[:, 0], xs[:, 1], c=range(self.H + 1), cmap="Reds") |
| 128 | ax.plot(xs[:, 0], xs[:, 1], "r-", label="Car path") |
| 129 | ax.set_xlabel("x") |
| 130 | ax.set_ylabel("y") |
| 131 | ax.set_xlim(-2, 2) |
| 132 | ax.set_ylim(-2, 2) |
| 133 | ax.set_aspect("equal") |
| 134 | ax.grid(True) |
| 135 | # ax.set_title("Car 2D") |
no outgoing calls
no test coverage detected