Skip to content

Commit 40f0781

Browse files
author
Ross Fisher
committed
1 parent 4a86346 commit 40f0781

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

selfdrive/controls/lib/drive_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
class MPC_COST_LAT:
35-
PATH = 1.0
35+
PATH = 0.5
3636
HEADING = 1.0
3737
STEER_RATE = 1.0
3838

selfdrive/controls/lib/lateral_planner.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,9 @@ def update(self, sm):
5959
# Calculate final driving path and set MPC costs
6060
if self.use_lanelines:
6161
d_path_xyz = self.LP.get_d_path(v_ego, self.t_idxs, self.path_xyz)
62-
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, MPC_COST_LAT.HEADING, self.steer_rate_cost)
6362
else:
6463
d_path_xyz = self.path_xyz
65-
path_cost = np.clip(abs(self.path_xyz[0, 1] / self.path_xyz_stds[0, 1]), 0.5, 1.5) * MPC_COST_LAT.PATH
66-
# Heading cost is useful at low speed, otherwise end of plan can be off-heading
67-
heading_cost = interp(v_ego, [5.0, 10.0], [MPC_COST_LAT.HEADING, 0.0])
68-
self.lat_mpc.set_weights(path_cost, heading_cost, self.steer_rate_cost)
64+
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, MPC_COST_LAT.HEADING, self.steer_rate_cost)
6965

7066
y_pts = np.interp(v_ego * self.t_idxs[:LAT_MPC_N + 1], np.linalg.norm(d_path_xyz, axis=1), d_path_xyz[:, 1])
7167
heading_pts = np.interp(v_ego * self.t_idxs[:LAT_MPC_N + 1], np.linalg.norm(self.path_xyz, axis=1), self.plan_yaw)

0 commit comments

Comments
 (0)