Skip to content

Commit 7ccc06e

Browse files
committed
bugfix
1 parent e3bc05a commit 7ccc06e

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

proj/environment/plotter.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,13 @@ def _plot_cost(self, keep_s=1.2):
226226
for k, v in self.cost_history.items():
227227
if "total" not in k:
228228
n = len(v)
229+
if n > keep_n + 2:
230+
x = v[n - keep_n]
231+
else:
232+
x = v.copy()
233+
229234
ax.plot(
230-
v[n - keep_n],
231-
label=k,
232-
lw=3,
233-
solid_capstyle="round",
234-
color=colors[k],
235+
x, label=k, lw=3, solid_capstyle="round", color=colors[k],
235236
)
236237
ax.legend()
237238

proj/model/config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class Config:
2626
# ------------------------------- Mouse params ------------------------------- #
2727
# ? works
2828
# mouse = dict(
29-
# L=1.5, # half body width | cm
30-
# R=1, # radius of wheels | cm
31-
# d=0.1, # distance between axel and CoM | cm
32-
# length=3, # cm
33-
# m=round(20 / 9.81, 2), # mass | g
34-
# m_w=round(2 / 9.81, 2), # mass of wheels/legs |g
29+
# L = 1.5, # half body width | cm
30+
# R = 1, # radius of wheels | cm
31+
# d = 0.1, # distance between axel and CoM | cm
32+
# length = 3, # cm
33+
# m = round(20 / 9.81, 2), # mass | g
34+
# m_w = round(2 / 9.81, 2), # mass of wheels/legs |g
3535
# )
3636

3737
# ? more realistic
@@ -52,7 +52,7 @@ class Config:
5252
distance=150,
5353
max_speed=100,
5454
min_speed=80,
55-
min_dist=100, # if agent is within this distance from trajectory end the goal is considered achieved
55+
min_dist=5, # if agent is within this distance from trajectory end the goal is considered achieved
5656
dist_th=300, # keep frames only after moved away from start location
5757
resample=True, # if True when using tracking trajectory resamples it
5858
max_deg_interpol=8, # if using track fit a N degree polynomial to daa to smoothen

0 commit comments

Comments
 (0)