Skip to content

Commit 9e802ce

Browse files
haraschaxYassineYousfi
authored andcommitted
Rocket league model (commaai#24869)
* dd9a502d-c8e2-4831-b365-804b0ae0739d/600 80041070-d276-4fed-bdb9-0075e5442908/420 * no elementwise op * 9dabf0f-2e60-44bf-8d3a-d20a74aca072/600 ae746590-0bb5-4a16-80db-15f02d314f03/300 c4663a12-b499-4c9b-90dd-b169e3948cb1/60 * explicit slice * some copies are useful * 1456d261-d232-4654-8885-4d9fde883894/440 c06eba55-1931-4e00-9d63-acad00161be0/700 af2eb6ba-1935-4318-aaf8-868db81a4932/425 * 154f663e-d3e9-4020-ad49-0e640588ebbe/399 badb5e69-504f-4544-a99e-ba75ed204b74/800 08330327-7663-4874-af7a-dcbd2c994ba7/800 * set steer rate cost to 1.0 * smaller temporal size * Update model reg * update model ref again * This did upload somehow * Update steer rate cost Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
1 parent 6f394ab commit 9e802ce

23 files changed

+17
-32
lines changed

models/supercombo.dlc

+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:027cbb1fabae369878271cb0e3505071a8bdaa07473fad9a0b2e8d695c5dc1ff
3-
size 76725611
2+
oid sha256:4c2cb3a3054f3292bbe538d6b793908dc2e234c200802d41b6766d3cb51b0b44
3+
size 101662751

models/supercombo.onnx

+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:484976ea5bd4ddcabc82e95faf30d7311a27802c1e337472558699fa2395a499
3-
size 77472267
2+
oid sha256:96b60d0bfd1386c93b4f79195aa1c5e77b23e0250578a308ee2c58857ed5eb49
3+
size 102570834

selfdrive/car/body/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def get_params(candidate, fingerprint=None, car_fw=None, disable_radar=False):
1818

1919
ret.minSteerSpeed = -math.inf
2020
ret.steerRatio = 0.5
21-
ret.steerRateCost = 0.5
2221
ret.steerLimitTimer = 1.0
2322
ret.steerActuatorDelay = 0.
2423

selfdrive/car/chrysler/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
2020
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.15, 0.30], [0.03, 0.05]]
2121
ret.lateralTuning.pid.kf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594
2222
ret.steerActuatorDelay = 0.1
23-
ret.steerRateCost = 0.7
2423
ret.steerLimitTimer = 0.4
2524

2625
if candidate in (CAR.JEEP_CHEROKEE, CAR.JEEP_CHEROKEE_2019):

selfdrive/car/ford/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ 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
6362
ret.centerToFront = ret.wheelbase * 0.44
6463

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

selfdrive/car/gm/interface.py

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

6766
if candidate == CAR.VOLT:

selfdrive/car/honda/interface.py

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

319319
ret.steerActuatorDelay = 0.1
320-
ret.steerRateCost = 0.5
321320
ret.steerLimitTimer = 0.8
322321

323322
return ret

selfdrive/car/hyundai/interface.py

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

3737
ret.steerActuatorDelay = 0.1 # Default delay
38-
ret.steerRateCost = 0.5
3938
ret.steerLimitTimer = 0.4
4039
tire_stiffness_factor = 1.
4140

selfdrive/car/mazda/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ 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
2928
ret.steerLimitTimer = 0.8
3029
tire_stiffness_factor = 0.70 # not optimized yet
3130

selfdrive/car/nissan/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ 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
1817

1918
ret.steerActuatorDelay = 0.1
2019

selfdrive/car/subaru/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ 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
2625
ret.steerLimitTimer = 0.4
2726

2827
if candidate == CAR.ASCENT:

selfdrive/car/tesla/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ 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
4645

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

selfdrive/car/tests/test_car_interfaces.py

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

3434
self.assertGreater(car_params.mass, 1)
35-
self.assertGreater(car_params.steerRateCost, 1e-3)
3635

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

selfdrive/car/tests/test_models.py

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

110110
# make sure car params are within a valid range
111111
self.assertGreater(self.CP.mass, 1)
112-
self.assertGreater(self.CP.steerRateCost, 1e-3)
113112

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

selfdrive/car/toyota/interface.py

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

202-
ret.steerRateCost = 1.
203202
ret.centerToFront = ret.wheelbase * 0.44
204203

205204
# 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
@@ -46,7 +46,6 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, disa
4646
# Global lateral tuning defaults, can be overridden per-vehicle
4747

4848
ret.steerActuatorDelay = 0.1
49-
ret.steerRateCost = 1.0
5049
ret.steerLimitTimer = 0.4
5150
ret.steerRatio = 15.6 # Let the params learner figure this out
5251
tire_stiffness_factor = 1.0 # Let the params learner figure this out

selfdrive/controls/lib/lateral_planner.py

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

1212

1313
class LateralPlanner:
14-
def __init__(self, CP, use_lanelines=True, wide_camera=False):
14+
def __init__(self, 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
2120
self.solution_invalid_cnt = 0
2221

2322
self.path_xyz = np.zeros((TRAJECTORY_SIZE, 3))
@@ -59,12 +58,12 @@ def update(self, sm):
5958
# Calculate final driving path and set MPC costs
6059
if self.use_lanelines:
6160
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)
61+
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, MPC_COST_LAT.HEADING, MPC_COST_LAT.STEER_RATE)
6362
else:
6463
d_path_xyz = self.path_xyz
6564
# Heading cost is useful at low speed, otherwise end of plan can be off-heading
6665
heading_cost = interp(v_ego, [5.0, 10.0], [MPC_COST_LAT.HEADING, 0.15])
67-
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, heading_cost, self.steer_rate_cost)
66+
self.lat_mpc.set_weights(MPC_COST_LAT.PATH, heading_cost, MPC_COST_LAT.STEER_RATE)
6867

6968
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])
7069
heading_pts = np.interp(v_ego * self.t_idxs[:LAT_MPC_N + 1], np.linalg.norm(self.path_xyz, axis=1), self.plan_yaw)
@@ -79,7 +78,7 @@ def update(self, sm):
7978
y_pts,
8079
heading_pts)
8180
# init state for next
82-
# mpc.u_sol is the desired curvature rate given x0 curv state.
81+
# mpc.u_sol is the desired curvature rate given x0 curv state.
8382
# with x0[3] = measured_curvature, this would be the actual desired rate.
8483
# instead, interpolate x_sol so that x0[3] is the desired curvature for lat_control.
8584
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
@@ -23,7 +23,7 @@ def plannerd_thread(sm=None, pm=None):
2323
cloudlog.event("e2e mode", on=use_lanelines)
2424

2525
longitudinal_planner = Planner(CP)
26-
lateral_planner = LateralPlanner(CP, use_lanelines=use_lanelines, wide_camera=wide_camera)
26+
lateral_planner = LateralPlanner(use_lanelines=use_lanelines, wide_camera=wide_camera)
2727

2828
if sm is None:
2929
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;
248+
constexpr int TEMPORAL_SIZE = 512+256;
249249
#else
250250
constexpr int TEMPORAL_SIZE = 0;
251251
#endif

selfdrive/modeld/thneed/compile.cc

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

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

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 @@ static int is_same_size_image(cl_mem a, cl_mem b) {
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

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f74ab97371be93fdc28333e5ea12bbb78c3a32d0
1+
629eaa7b26d1721a71547f9de880f99732cb27f3
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0956446adfa91506f0a3d88f893e041bfb2890c1
1+
ed1dfb8b155ebcd8fdad4e06462b3bb7869fc67b

0 commit comments

Comments
 (0)