Skip to content

Commit 804cf78

Browse files
committed
bump
1 parent da65bc5 commit 804cf78

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

proj/environment/environment.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ def plan(self, curr_x, g_traj, itern):
104104
if start + pred_len > len(g_traj):
105105
end = len(g_traj) - 2
106106

107-
# if abs(start - end) != pred_len:
108-
# return np.tile(g_traj[-1], (pred_len, 1))
109-
110-
return g_traj[start:end]
107+
if abs(start - end) != pred_len:
108+
g_traj = g_traj[start:end]
109+
len_diff = (start - end) - pred_len
110+
return np.pad(g_traj, ((0, len_diff), (0, 0)), mode="edge")
111+
else:
112+
return g_traj[start:end]
111113

112114
def isdone(self, curr_x, trajectory):
113115
"""

proj/environment/manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _start_logging(self):
6666
# Start logging
6767
fancylog.start_logging(
6868
output_dir=str(self.datafolder),
69-
filename=self.exp_name + ".txt",
69+
filename=self.exp_name + ".log",
7070
multiprocessing_aware=False,
7171
write_git=False,
7272
verbose=False,
@@ -87,7 +87,7 @@ def _log_conf(self):
8787
# log config.py
8888
try:
8989
with open("proj/model/config.py") as f:
90-
conf = f.read()
90+
conf = "\n" + f.read()
9191
except FileNotFoundError:
9292
conf = self.model.config_dict()
9393
logging.info(conf)

proj/model/config.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,26 @@
3333

3434
_realistic_mouse = dict(
3535
L=2, # half body width | cm
36-
R=2, # radius of wheels | cm
37-
d=3, # distance between axel and CoM | cm
36+
R=1.5, # radius of wheels | cm
37+
d=2, # distance between axel and CoM | cm
3838
length=8.6, # cm
39-
m=round(25 / 9.81, 2), # mass | g
40-
m_w=round(0.6 / 9.81, 2), # mass of wheels/legs |g
39+
m=round(23 / 9.81, 2), # mass | g
40+
m_w=0.8, # mass of wheels/legs |g
4141
mouse_type="realistic",
4242
)
4343

44+
# ---------------------------------------------------------------------------- #
45+
# CONFIG #
46+
# ---------------------------------------------------------------------------- #
47+
4448

4549
class Config:
4650
# ----------------------------- Simulation params ---------------------------- #
4751
SIMULATION_NAME = ""
4852

4953
USE_FAST = True # if true use cumba's methods
5054
SPAWN_TYPE = "trajectory"
51-
LIVE_PLOT = True
55+
LIVE_PLOT = False
5256

5357
mouse_type = "easy"
5458
model_type = "cart"
@@ -72,7 +76,7 @@ class Config:
7276

7377
# ------------------------------ Planning params ----------------------------- #
7478
planning = dict( # params used to compute goal states to be used for control
75-
prediction_length=80,
79+
prediction_length=20,
7680
n_ahead=5, # start prediction states from N steps ahead
7781
)
7882

0 commit comments

Comments
 (0)