MCPcopy Create free account
hub / github.com/LeCAR-Lab/model-based-diffusion / render

Method render

mbd/envs/car2d.py:112–135  ·  view source on GitHub ↗
(self, ax, xs: jnp.ndarray)

Source from the content-addressed store, hash-verified

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")

Callers 4

render_usFunction · 0.80
train_brax.pyFile · 0.80
mainFunction · 0.80
run_diffusionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected