Skip to content

Commit 8e0a095

Browse files
committed
Revert "Rocket league model (#24869)"
This reverts commit 9283040.
1 parent 95d8517 commit 8e0a095

22 files changed

+31
-16
lines changed

selfdrive/car/body/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def get_params(candidate, fingerprint=None, car_fw=None, disable_radar=False):
1919
ret.minSteerSpeed = -math.inf
2020
ret.maxLateralAccel = math.inf # TODO: set to a reasonable value
2121
ret.steerRatio = 0.5
22+
ret.steerRateCost = 0.5
2223
ret.steerLimitTimer = 1.0
2324
ret.steerActuatorDelay = 0.
2425

selfdrive/car/chrysler/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
1313
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.chrysler)]
1414

1515
ret.steerActuatorDelay = 0.1
16+
ret.steerRateCost = 0.7
1617
ret.steerLimitTimer = 0.4
1718

1819
ret.minSteerSpeed = 3.8 # m/s

selfdrive/car/ford/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
5959
# LCA can steer down to zero
6060
ret.minSteerSpeed = 0.
6161

62+
ret.steerRateCost = 1.0
6263
ret.centerToFront = ret.wheelbase * 0.44
6364

6465
ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase)

selfdrive/car/gm/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
6363
ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]]
6464
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.00]]
6565
ret.lateralTuning.pid.kf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594
66+
ret.steerRateCost = 1.0
6667
ret.steerActuatorDelay = 0.1 # Default delay, not measured yet
6768

6869
ret.longitudinalTuning.kpBP = [5., 35.]

selfdrive/car/honda/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
323323
tire_stiffness_factor=tire_stiffness_factor)
324324

325325
ret.steerActuatorDelay = 0.1
326+
ret.steerRateCost = 0.5
326327
ret.steerLimitTimer = 0.8
327328

328329
return ret

selfdrive/car/hyundai/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
4040
ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, CAR.ELANTRA_GT_I30} or candidate in HDA2_CAR
4141

4242
ret.steerActuatorDelay = 0.1 # Default delay
43+
ret.steerRateCost = 0.5
4344
ret.steerLimitTimer = 0.4
4445
tire_stiffness_factor = 1.
4546

selfdrive/car/mazda/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
2525
ret.dashcamOnly = candidate not in (CAR.CX5_2022, CAR.CX9_2021)
2626

2727
ret.steerActuatorDelay = 0.1
28+
ret.steerRateCost = 1.0
2829
ret.steerLimitTimer = 0.8
2930
tire_stiffness_factor = 0.70 # not optimized yet
3031

selfdrive/car/nissan/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
1414
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.nissan)]
1515

1616
ret.steerLimitTimer = 1.0
17+
ret.steerRateCost = 0.5
1718

1819
ret.steerActuatorDelay = 0.1
1920

selfdrive/car/subaru/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
2222

2323
ret.dashcamOnly = candidate in PREGLOBAL_CARS
2424

25+
ret.steerRateCost = 0.7
2526
ret.steerLimitTimer = 0.4
2627

2728
if candidate == CAR.ASCENT:

selfdrive/car/tesla/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
4242

4343
ret.steerLimitTimer = 1.0
4444
ret.steerActuatorDelay = 0.25
45+
ret.steerRateCost = 0.5
4546

4647
if candidate in (CAR.AP2_MODELS, CAR.AP1_MODELS):
4748
ret.mass = 2100. + STD_CARGO_KG

selfdrive/car/tests/test_car_interfaces.py

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_car_interfaces(self, car_name):
3333
assert car_interface
3434

3535
self.assertGreater(car_params.mass, 1)
36+
self.assertGreater(car_params.steerRateCost, 1e-3)
3637

3738
if car_params.steerControlType != car.CarParams.SteerControlType.angle:
3839
tuning = car_params.lateralTuning.which()

selfdrive/car/tests/test_models.py

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def test_car_params(self):
121121

122122
# make sure car params are within a valid range
123123
self.assertGreater(self.CP.mass, 1)
124+
self.assertGreater(self.CP.steerRateCost, 1e-3)
124125

125126
if self.CP.steerControlType != car.CarParams.SteerControlType.angle:
126127
tuning = self.CP.lateralTuning.which()

selfdrive/car/toyota/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
213213
ret.mass = 4305. * CV.LB_TO_KG + STD_CARGO_KG
214214
set_lat_tune(ret.lateralTuning, LatTunes.PID_J)
215215

216+
ret.steerRateCost = 1.
216217
ret.centerToFront = ret.wheelbase * 0.44
217218

218219
# TODO: get actual value, for now starting with reasonable value for

selfdrive/car/volkswagen/interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
4545
# Global lateral tuning defaults, can be overridden per-vehicle
4646

4747
ret.steerActuatorDelay = 0.1
48+
ret.steerRateCost = 1.0
4849
ret.steerLimitTimer = 0.4
4950
ret.steerRatio = 15.6 # Let the params learner figure this out
5051
tire_stiffness_factor = 1.0 # Let the params learner figure this out

selfdrive/controls/lib/lateral_planner.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111

1212

1313
class LateralPlanner:
14-
def __init__(self, use_lanelines=True, wide_camera=False):
14+
def __init__(self, CP, use_lanelines=True, wide_camera=False):
1515
self.use_lanelines = use_lanelines
1616
self.LP = LanePlanner(wide_camera)
1717
self.DH = DesireHelper()
1818

1919
self.last_cloudlog_t = 0
20+
self.steer_rate_cost = CP.steerRateCost
2021
self.solution_invalid_cnt = 0
2122

2223
self.path_xyz = np.zeros((TRAJECTORY_SIZE, 3))
@@ -58,12 +59,12 @@ def update(self, sm):
5859
# Calculate final driving path and set MPC costs
5960
if self.use_lanelines:
6061
d_path_xyz = self.LP.get_d_path(v_ego, self.t_idxs, self.path_xyz)
61-
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, MPC_COST_LAT.HEADING, MPC_COST_LAT.STEER_RATE)
62+
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, MPC_COST_LAT.HEADING, self.steer_rate_cost)
6263
else:
6364
d_path_xyz = self.path_xyz
6465
# Heading cost is useful at low speed, otherwise end of plan can be off-heading
6566
heading_cost = interp(v_ego, [5.0, 10.0], [MPC_COST_LAT.HEADING, 0.15])
66-
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, heading_cost, MPC_COST_LAT.STEER_RATE)
67+
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, heading_cost, self.steer_rate_cost)
6768

6869
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])
6970
heading_pts = np.interp(v_ego * self.t_idxs[:LAT_MPC_N + 1], np.linalg.norm(self.path_xyz, axis=1), self.plan_yaw)
@@ -78,7 +79,7 @@ def update(self, sm):
7879
y_pts,
7980
heading_pts)
8081
# init state for next
81-
# mpc.u_sol is the desired curvature rate given x0 curv state.
82+
# mpc.u_sol is the desired curvature rate given x0 curv state.
8283
# with x0[3] = measured_curvature, this would be the actual desired rate.
8384
# instead, interpolate x_sol so that x0[3] is the desired curvature for lat_control.
8485
self.x0[3] = interp(DT_MDL, self.t_idxs[:LAT_MPC_N + 1], self.lat_mpc.x_sol[:, 3])

selfdrive/controls/plannerd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def plannerd_thread(sm=None, pm=None):
2222
cloudlog.event("e2e mode", on=use_lanelines)
2323

2424
longitudinal_planner = Planner(CP)
25-
lateral_planner = LateralPlanner(use_lanelines=use_lanelines, wide_camera=wide_camera)
25+
lateral_planner = LateralPlanner(CP, use_lanelines=use_lanelines, wide_camera=wide_camera)
2626

2727
if sm is None:
2828
sm = messaging.SubMaster(['carState', 'controlsState', 'radarState', 'modelV2'],

selfdrive/modeld/models/driving.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ struct ModelOutput {
245245

246246
constexpr int OUTPUT_SIZE = sizeof(ModelOutput) / sizeof(float);
247247
#ifdef TEMPORAL
248-
constexpr int TEMPORAL_SIZE = 512+256;
248+
constexpr int TEMPORAL_SIZE = 512;
249249
#else
250250
constexpr int TEMPORAL_SIZE = 0;
251251
#endif
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:4c2cb3a3054f3292bbe538d6b793908dc2e234c200802d41b6766d3cb51b0b44
3-
size 101662751
2+
oid sha256:027cbb1fabae369878271cb0e3505071a8bdaa07473fad9a0b2e8d695c5dc1ff
3+
size 76725611
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:96b60d0bfd1386c93b4f79195aa1c5e77b23e0250578a308ee2c58857ed5eb49
3-
size 102570834
2+
oid sha256:484976ea5bd4ddcabc82e95faf30d7311a27802c1e337472558699fa2395a499
3+
size 77472267

selfdrive/modeld/thneed/compile.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "selfdrive/modeld/thneed/thneed.h"
66
#include "system/hardware/hw.h"
77

8-
#define TEMPORAL_SIZE 512+256
8+
#define TEMPORAL_SIZE 512
99
#define DESIRE_LEN 8
1010
#define TRAFFIC_CONVENTION_LEN 2
1111

selfdrive/modeld/thneed/optimizer.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
extern map<cl_program, string> g_program_source;
1111

12-
/*static int is_same_size_image(cl_mem a, cl_mem b) {
12+
static int is_same_size_image(cl_mem a, cl_mem b) {
1313
size_t a_width, a_height, a_depth, a_array_size, a_row_pitch, a_slice_pitch;
1414
clGetImageInfo(a, CL_IMAGE_WIDTH, sizeof(a_width), &a_width, NULL);
1515
clGetImageInfo(a, CL_IMAGE_HEIGHT, sizeof(a_height), &a_height, NULL);
@@ -29,7 +29,7 @@ extern map<cl_program, string> g_program_source;
2929
return (a_width == b_width) && (a_height == b_height) &&
3030
(a_depth == b_depth) && (a_array_size == b_array_size) &&
3131
(a_row_pitch == b_row_pitch) && (a_slice_pitch == b_slice_pitch);
32-
}*/
32+
}
3333

3434
static cl_mem make_image_like(cl_context context, cl_mem val) {
3535
cl_image_format format;
@@ -138,7 +138,7 @@ int Thneed::optimize() {
138138

139139
// delete useless copy layers
140140
// saves ~0.7 ms
141-
/*if (kq[i]->name == "concatenation" || kq[i]->name == "flatten") {
141+
if (kq[i]->name == "concatenation" || kq[i]->name == "flatten") {
142142
string in = kq[i]->args[kq[i]->get_arg_num("input")];
143143
string out = kq[i]->args[kq[i]->get_arg_num("output")];
144144
if (is_same_size_image(*(cl_mem*)in.data(), *(cl_mem*)out.data())) {
@@ -148,7 +148,7 @@ int Thneed::optimize() {
148148

149149
kq.erase(kq.begin()+i); --i;
150150
}
151-
}*/
151+
}
152152

153153
// NOTE: if activations/accumulation are done in the wrong order, this will be wrong
154154

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ed1dfb8b155ebcd8fdad4e06462b3bb7869fc67b
1+
1d66eed104dbc124c4e5679f5dddf40197b86ce9

0 commit comments

Comments
 (0)