diff --git a/openpilot/starpilot/lateral/palisade_policy.py b/openpilot/starpilot/lateral/palisade_policy.py index 166818cc03..c9b1ace41e 100644 --- a/openpilot/starpilot/lateral/palisade_policy.py +++ b/openpilot/starpilot/lateral/palisade_policy.py @@ -62,7 +62,7 @@ class PalisadeTorquePolicy(HKGShapedTorquePolicy): speed_weight = np.interp(speed, (10.5, 17.0), (0., 1.)) curve_weight = np.interp(abs(setpoint), (.55, 1.65), (1., 0.)) threshold += .28 * speed_weight * curve_weight - ramp_speed = np.interp(speed, (10.5, 13.5, 16., 21.), (0., 1., 1., 0.)) + ramp_speed = np.interp(speed, (10.5, 13.5, 20.5, 24.), (0., 1., 1., 0.)) near_center = np.interp(abs(setpoint), (.12, .65), (1., 0.)) threshold += .25 * ramp_speed * near_center return threshold, scale diff --git a/openpilot/starpilot/lateral/tests/test_palisade_policy.py b/openpilot/starpilot/lateral/tests/test_palisade_policy.py index 4534754cb4..34c6dbf152 100644 --- a/openpilot/starpilot/lateral/tests/test_palisade_policy.py +++ b/openpilot/starpilot/lateral/tests/test_palisade_policy.py @@ -191,13 +191,13 @@ def test_hda2_uses_stronger_friction_damping_in_both_longitudinal_modes(alpha): controller = LatControlTorque(cp.as_reader(), interfaces[cp.carFingerprint](cp), .01) policy = controller.starpilot_extension.policy for sign in (-1., 1.): - for speed, demand, increment in ((10.5, .3, 0.), (21., .3, .28), (30., 1.1, .14), (30., 1.65, 0.)): + for speed, demand, increment in ((10.5, .3, 0.), (24., .3, .28), (30., 1.1, .14), (30., 1.65, 0.)): baseline, scale = policy.friction(sign * demand, .4, speed) assert policy.friction_context(sign * demand, .4, 0., speed) == pytest.approx((baseline + increment, scale)) vm = VehicleModel(cp) parameters = log.VehicleParameters.new_message(angleOffsetDeg=0., roll=0.) - state = SimpleNamespace(vEgo=21., steeringAngleDeg=0., steeringPressed=False) + state = SimpleNamespace(vEgo=24., steeringAngleDeg=0., steeringPressed=False) shaped = policy.friction_context increments = [] @@ -249,7 +249,8 @@ def test_palisade_ramp_friction_is_limited_to_shallow_mid_speed_corrections(topo mid_speed_damping = .28 * (15. - 10.5) / (17. - 10.5) if policy.hda2 else 0. highway_damping = .28 if policy.hda2 else 0. for demand in (-.1, .1): - for speed, increment in ((10.5, 0.), (15., mid_speed_damping + extra), (21., highway_damping), (30., highway_damping)): + for speed, increment in ((10.5, 0.), (15., mid_speed_damping + extra), (22., highway_damping + extra * 2. / 3.5), + (24., highway_damping), (30., highway_damping)): threshold, scale = policy.friction(demand, .4, speed) assert policy.friction_context(demand, .4, 0., speed) == pytest.approx((threshold + increment, scale)) diff --git a/prebuilt.json b/prebuilt.json index 844d9e2afb..e909cf42b4 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "eff0a83f9023b678da553c027dce6b47766ddf265fd5483feb899d27c4a6b489", "schema_version": 1} +{"protected_inventory_sha256": "bff229eaa4911ce7bc4e994ed192a5823589f6d862885079e23fddbea78ce6f7", "schema_version": 1}