Skip to content

Commit 49e76cc

Browse files
committed
fixes
1 parent e9411f5 commit 49e76cc

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

proj/environment/plotter.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,13 @@ def _plot_goal(self, goal):
244244
x = self.model.curr_x
245245

246246
for n, k in enumerate(x._fields):
247-
self.goal_ax.bar(n, goal._asdict()[k], color=colors[k], alpha=0.7)
248-
self.goal_ax.scatter(
247+
self.goal_ax.bar(
249248
n,
250-
x._asdict()[k],
249+
goal._asdict()[k] - x._asdict()[k],
251250
color=desaturate_color(colors[k]),
252-
s=200,
253251
zorder=99,
254252
lw=1,
255-
edgecolors="white",
253+
ec="k",
256254
label=k,
257255
)
258256

proj/model/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
INPUT_SIZE=2,
77
ANGLE_IDX=2, # state vector index which is angle, used to fit diff in
88
R=np.diag([1.0e-06, 1.0e-06]), # control cost
9-
Q=np.diag([10, 10, 10, 10, 0]), # state cost | x, y, theta, v, omega
9+
Q=np.diag([10, 10, 10, 3, 0]), # state cost | x, y, theta, v, omega
1010
Sf=np.diag([0, 0, 0, 0, 0]), # final state cost
1111
)
1212

proj/plotting/results.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ def _plot_cost(cost_history, ax=None):
134134
ax.legend()
135135

136136

137-
def _plot_integrals(history, tax=None, aax=None):
138-
R, L = history["tau_r"], history["tau_l"]
137+
def _plot_integrals(history, dt, tax=None, aax=None):
138+
R, L = np.cumsum(history["tau_r"]), np.cumsum(history["tau_l"])
139139

140140
plot_line_outlined(
141141
tax,
@@ -198,7 +198,7 @@ def plot_results(results_folder, plot_every=20, save_path=None):
198198
_plot_v(history, trajectory, plot_every, ax=sax)
199199
_plot_accel(history, ax=accel_ax)
200200
_plot_cost(cost_history, ax=cost_ax)
201-
_plot_integrals(history, tax=tau_int_ax, aax=acc_int_ax)
201+
_plot_integrals(history, config["dt"], tax=tau_int_ax, aax=acc_int_ax)
202202

203203
clean_axes(f)
204204

0 commit comments

Comments
 (0)