Skip to content

Commit 6b07cd7

Browse files
committed
config working px to cm realistic
1 parent 04d53e9 commit 6b07cd7

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

analysis_workspace.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,19 @@
7171
zip(loaded["trajectory"], loaded["history"]),
7272
total=len(loaded["trajectory"]),
7373
):
74+
last_idx = hist.trajectory_idx.values[-1]
7475
metad = compute_trajectory_stats(
75-
traj, 1, config["trajectory"], config["planning"], mute=True
76+
traj[:last_idx, :],
77+
1,
78+
config["trajectory"],
79+
config["planning"],
80+
mute=True,
7681
)[-1]
82+
7783
traj_dist.append(metad["distance_travelled"])
7884

7985
actual_dist.append(
8086
np.sum(calc_distance_between_points_in_a_vector_2d(hist.x, hist.y))
81-
+ config["trajectory"]["dist_th"]
8287
)
8388

8489
# %%
@@ -92,7 +97,7 @@
9297
lw=1,
9398
ec=[0.3, 0.3, 0.3],
9499
)
95-
ax.plot([0, 400], [0, 400], lw=2, color=[0.6, 0.6, 0.6], zorder=-1)
100+
ax.plot([25, 130], [25, 130], lw=2, color=[0.6, 0.6, 0.6], zorder=-1)
96101

97102
ax.set(xlabel="Trajectory length", ylabel="Distance travelled")
98103
# %%

proj/model/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
STATE_SIZE=5,
66
INPUT_SIZE=2,
77
ANGLE_IDX=2, # state vector index which is angle, used to fit diff in
8-
R=np.diag([1.0e-8, 1.0e-8]), # control cost
8+
R=np.diag([1.0e-7, 1.0e-7]), # control cost
99
Q=np.diag([30, 30, 30, 10, 0]), # state cost | x, y, theta, v, omega
1010
Sf=np.diag([0, 0, 0, 0, 0]), # final state cost
1111
)
@@ -64,7 +64,7 @@ class Config:
6464
trajectory = dict( # parameters of the goals trajectory
6565
name="tracking",
6666
# ? For artificial trajectories
67-
nsteps=1000,
67+
nsteps=500,
6868
distance=150,
6969
max_speed=100,
7070
min_speed=80,

0 commit comments

Comments
 (0)