Skip to content

Commit

Permalink
Merge pull request #43 from ShaneSmiskol/stock_additions-071
Browse files Browse the repository at this point in the history
New tune for Honda Pilot, Corolla, and slightly closer stock following distance
  • Loading branch information
sshane authored Jan 24, 2020
2 parents 38121e2 + 07e8abc commit 3865fda
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
14 changes: 9 additions & 5 deletions selfdrive/controls/lib/dynamic_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ def __init__(self, CP, candidate):

def update(self, v_ego, lead_data, mpc_TR):
x, y = [], [] # gasMaxBP, gasMaxV
if self.CP.enableGasInterceptor: # todo: make different profiles for different vehicles
if self.CP.enableGasInterceptor:
if self.candidate == CAR_TOYOTA.COROLLA:
x = [0.0, 1.4082, 2.80311, 4.22661, 5.38271, 6.16561, 7.24781, 8.28308, 10.24465, 12.96402, 15.42303, 18.11903, 20.11703, 24.46614, 29.05805, 32.71015, 35.76326]
y = [0.2, 0.20443, 0.21592, 0.23334, 0.25734, 0.27916, 0.3229, 0.35, 0.368, 0.377, 0.389, 0.399, 0.411, 0.45, 0.504, 0.558, 0.617]
# x = [0.0, 1.4082, 2.80311, 4.22661, 5.38271, 6.16561, 7.24781, 8.28308, 10.24465, 12.96402, 15.42303, 18.11903, 20.11703, 24.46614, 29.05805, 32.71015, 35.76326] # stock tune
# y = [0.2, 0.20443, 0.21592, 0.23334, 0.25734, 0.27916, 0.3229, 0.35, 0.368, 0.377, 0.389, 0.399, 0.411, 0.45, 0.504, 0.558, 0.617]
# x = [0.0, 1.4082, 2.8031, 4.2266, 5.3827, 6.1656, 7.2478, 8.2831, 10.2446, 12.964, 15.423, 18.119, 20.117, 24.4661, 29.058, 32.7102, 35.7633] # todo: test higher only at low speeds
# y = [0.221, 0.225, 0.236, 0.253, 0.275, 0.296, 0.338, 0.363, 0.38, 0.389, 0.4, 0.41, 0.421, 0.458, 0.51, 0.561, 0.617]
x = [0.0, 1.4082, 2.8031, 4.2266, 5.3827, 6.1656, 7.2478, 8.2831, 10.2446, 12.964, 15.423, 18.119, 20.117, 24.4661, 29.058, 32.7102, 35.7633] # now testing higher all around
y = [0.229, 0.233, 0.244, 0.261, 0.284, 0.305, 0.347, 0.373, 0.391, 0.399, 0.411, 0.421, 0.432, 0.47, 0.522, 0.574, 0.631]
elif self.candidate == CAR_TOYOTA.RAV4:
x = [0.0, 1.4082, 2.80311, 4.22661, 5.38271, 6.16561, 7.24781, 8.28308, 10.24465, 12.96402, 15.42303, 18.11903, 20.11703, 24.46614, 29.05805, 32.71015, 35.76326]
y = [0.234, 0.237, 0.246, 0.26, 0.279, 0.297, 0.332, 0.354, 0.368, 0.377, 0.389, 0.399, 0.411, 0.45, 0.504, 0.558, 0.617]
elif self.candidate == CAR_HONDA.PILOT_2019:
x = [0.0, 1.4082, 2.80311, 4.22661, 5.38271, 6.16561, 7.24781, 8.28308, 10.24465, 12.96402, 15.42303, 18.11903, 20.11703, 24.46614, 29.05805, 32.71015, 35.76326]
y = [0.234, 0.237, 0.246, 0.26, 0.279, 0.297, 0.332, 0.354, 0.368, 0.377, 0.389, 0.399, 0.411, 0.45, 0.504, 0.558, 0.617]
x = [0.0, 1.4082, 2.8031, 4.2266, 5.3827, 6.1656, 7.2478, 8.2831, 10.2446, 12.964, 15.423, 18.119, 20.117, 24.4661, 29.058, 32.7102, 35.7633]
y = [0.272, 0.275, 0.283, 0.296, 0.313, 0.329, 0.36, 0.38, 0.393, 0.401, 0.412, 0.421, 0.432, 0.467, 0.515, 0.564, 0.617]
# else:
# if self.candidate in [CAR_TOYOTA.CAMRY, CAR_TOYOTA.CAMRYH]:
# x = [0.]
Expand Down
4 changes: 3 additions & 1 deletion selfdrive/controls/lib/long_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ def lead_accel_over_time(self):
def dynamic_follow(self, CS):
# x_vel = [0.0, 1.8627, 3.7253, 5.588, 7.4507, 9.3133, 11.5598, 13.645, 22.352, 31.2928, 33.528, 35.7632, 40.2336] # velocities
# y_mod = [1.102, 1.12, 1.14, 1.168, 1.21, 1.273, 1.36, 1.411, 1.543, 1.62, 1.664, 1.736, 1.853] # TRs
# x_vel = [0.0, 1.8627, 3.7253, 5.588, 7.4507, 9.3133, 11.5598, 13.645, 22.352, 31.2928, 33.528, 35.7632, 40.2336]
# y_mod = [1.385, 1.394, 1.406, 1.421, 1.444, 1.474, 1.516, 1.538, 1.554, 1.604, 1.627, 1.658, 1.705]
x_vel = [0.0, 1.8627, 3.7253, 5.588, 7.4507, 9.3133, 11.5598, 13.645, 22.352, 31.2928, 33.528, 35.7632, 40.2336]
y_mod = [1.385, 1.394, 1.406, 1.421, 1.444, 1.474, 1.516, 1.538, 1.554, 1.604, 1.627, 1.658, 1.705]
y_mod = [1.385, 1.394, 1.406, 1.421, 1.444, 1.474, 1.516, 1.538, 1.554, 1.594, 1.612, 1.637, 1.675]

sng_TR = 1.8 # stop and go TR
sng_speed = 15.0 * CV.MPH_TO_MS
Expand Down
8 changes: 6 additions & 2 deletions selfdrive/controls/lib/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@

# need fast accel at very low speed for stop and go
# make sure these accelerations are smaller than mpc limits
_A_CRUISE_MAX_V = [1.2, 1.2, 0.65, .4]
_A_CRUISE_MAX_V_FOLLOWING = [1.6, 1.6, 0.65, .4]
if travis:
_A_CRUISE_MAX_V = [1.2, 1.2, 0.65, .4]
_A_CRUISE_MAX_V_FOLLOWING = [1.6, 1.6, 0.65, .4]
else:
_A_CRUISE_MAX_V = [1.6, 1.4, 0.65, .4]
_A_CRUISE_MAX_V_FOLLOWING = [1.9, 1.9, 0.75, .6]
_A_CRUISE_MAX_BP = [0., 6.4, 22.5, 40.]

# Lookup table for turns
Expand Down

0 comments on commit 3865fda

Please sign in to comment.