Skip to content

Commit 15ecf72

Browse files
Recertified Herbalist Model (commaai#31616)取り込み。
Merge commit 'a38a5e8bb4c0eda459ec42dd4e2f42e17e6dfef6' into master-cit0
2 parents f8dc2ff + a38a5e8 commit 15ecf72

File tree

10 files changed

+141
-141
lines changed

10 files changed

+141
-141
lines changed

selfdrive/car/honda/interface.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
209209
raise ValueError(f"unsupported car {candidate}")
210210

211211
# These cars use alternate user brake msg (0x1BE)
212-
if 0x1BE in fingerprint[CAN.pt] and candidate in HONDA_BOSCH:
212+
# TODO: Only detect feature for Accord/Accord Hybrid, not all Bosch DBCs have BRAKE_MODULE
213+
if 0x1BE in fingerprint[CAN.pt] and candidate == CAR.ACCORD:
213214
ret.flags |= HondaFlags.BOSCH_ALT_BRAKE.value
215+
216+
if ret.flags & HondaFlags.BOSCH_ALT_BRAKE:
214217
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_ALT_BRAKE
215218

216219
# These cars use alternate SCM messages (SCM_FEEDBACK AND SCM_BUTTON)

selfdrive/car/honda/values.py

Lines changed: 47 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ class HondaFlags(IntFlag):
5959
NIDEC_ALT_PCM_ACCEL = 32
6060
NIDEC_ALT_SCM_MESSAGES = 64
6161

62-
AUTORESUME_SNG = 128
63-
ELECTRIC_PARKING_BRAKE = 256
6462

6563
# Car button codes
6664
class CruiseButtons:
@@ -100,16 +98,19 @@ class Footnote(Enum):
10098
Column.FSR_STEERING)
10199

102100

103-
class HondaPlatformConfig(PlatformConfig):
101+
class HondaBoschPlatformConfig(PlatformConfig):
104102
def init(self):
105-
if self.flags & HondaFlags.BOSCH:
106-
self.flags |= HondaFlags.AUTORESUME_SNG
107-
self.flags |= HondaFlags.ELECTRIC_PARKING_BRAKE
103+
self.flags |= HondaFlags.BOSCH
104+
105+
106+
class HondaNidecPlatformConfig(PlatformConfig):
107+
def init(self):
108+
self.flags |= HondaFlags.NIDEC
108109

109110

110111
class CAR(Platforms):
111112
# Bosch Cars
112-
ACCORD = HondaPlatformConfig(
113+
ACCORD = HondaBoschPlatformConfig(
113114
"HONDA ACCORD 2018",
114115
[
115116
HondaCarInfo("Honda Accord 2018-22", "All", video_link="https://www.youtube.com/watch?v=mrUwlj3Mi58", min_steer_speed=3. * CV.MPH_TO_MS),
@@ -118,9 +119,8 @@ class CAR(Platforms):
118119
],
119120
CarSpecs(mass=3279 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=16.33, centerToFrontRatio=0.39), # steerRatio: 11.82 is spec end-to-end
120121
dbc_dict('honda_accord_2018_can_generated', None),
121-
flags=HondaFlags.BOSCH,
122122
)
123-
CIVIC_BOSCH = HondaPlatformConfig(
123+
CIVIC_BOSCH = HondaBoschPlatformConfig(
124124
"HONDA CIVIC (BOSCH) 2019",
125125
[
126126
HondaCarInfo("Honda Civic 2019-21", "All", video_link="https://www.youtube.com/watch?v=4Iz1Mz5LGF8",
@@ -129,155 +129,149 @@ class CAR(Platforms):
129129
],
130130
CarSpecs(mass=1326, wheelbase=2.7, steerRatio=15.38, centerToFrontRatio=0.4), # steerRatio: 10.93 is end-to-end spec
131131
dbc_dict('honda_civic_hatchback_ex_2017_can_generated', None),
132-
flags=HondaFlags.BOSCH
133132
)
134-
CIVIC_BOSCH_DIESEL = HondaPlatformConfig(
133+
CIVIC_BOSCH_DIESEL = HondaBoschPlatformConfig(
135134
"HONDA CIVIC SEDAN 1.6 DIESEL 2019",
136-
None, # don't show in docs
135+
None, # don't show in docs
137136
CIVIC_BOSCH.specs,
138137
dbc_dict('honda_accord_2018_can_generated', None),
139-
flags=HondaFlags.BOSCH
140138
)
141-
CIVIC_2022 = HondaPlatformConfig(
139+
CIVIC_2022 = HondaBoschPlatformConfig(
142140
"HONDA CIVIC 2022",
143141
[
144142
HondaCarInfo("Honda Civic 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
145143
HondaCarInfo("Honda Civic Hatchback 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
146144
],
147145
CIVIC_BOSCH.specs,
148146
dbc_dict('honda_civic_ex_2022_can_generated', None),
149-
flags=HondaFlags.BOSCH | HondaFlags.BOSCH_RADARLESS,
147+
flags=HondaFlags.BOSCH_RADARLESS,
150148
)
151-
CRV_5G = HondaPlatformConfig(
149+
CRV_5G = HondaBoschPlatformConfig(
152150
"HONDA CR-V 2017",
153151
HondaCarInfo("Honda CR-V 2017-22", min_steer_speed=12. * CV.MPH_TO_MS),
154152
CarSpecs(mass=3410 * CV.LB_TO_KG, wheelbase=2.66, steerRatio=16.0, centerToFrontRatio=0.41), # steerRatio: 12.3 is spec end-to-end
155153
dbc_dict('honda_crv_ex_2017_can_generated', None, body_dbc='honda_crv_ex_2017_body_generated'),
156-
flags=HondaFlags.BOSCH,
154+
flags=HondaFlags.BOSCH_ALT_BRAKE,
157155
)
158-
CRV_HYBRID = HondaPlatformConfig(
156+
CRV_HYBRID = HondaBoschPlatformConfig(
159157
"HONDA CR-V HYBRID 2019",
160158
HondaCarInfo("Honda CR-V Hybrid 2017-20", min_steer_speed=12. * CV.MPH_TO_MS),
161159
CarSpecs(mass=1667, wheelbase=2.66, steerRatio=16, centerToFrontRatio=0.41), # mass: mean of 4 models in kg, steerRatio: 12.3 is spec end-to-end
162160
dbc_dict('honda_accord_2018_can_generated', None),
163-
flags=HondaFlags.BOSCH
164161
)
165-
HRV_3G = HondaPlatformConfig(
162+
HRV_3G = HondaBoschPlatformConfig(
166163
"HONDA HR-V 2023",
167164
HondaCarInfo("Honda HR-V 2023", "All"),
168165
CarSpecs(mass=3125 * CV.LB_TO_KG, wheelbase=2.61, steerRatio=15.2, centerToFrontRatio=0.41),
169166
dbc_dict('honda_civic_ex_2022_can_generated', None),
170-
flags=HondaFlags.BOSCH | HondaFlags.BOSCH_RADARLESS
167+
flags=HondaFlags.BOSCH_RADARLESS | HondaFlags.BOSCH_ALT_BRAKE,
171168
)
172-
ACURA_RDX_3G = HondaPlatformConfig(
169+
ACURA_RDX_3G = HondaBoschPlatformConfig(
173170
"ACURA RDX 2020",
174171
HondaCarInfo("Acura RDX 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
175172
CarSpecs(mass=4068 * CV.LB_TO_KG, wheelbase=2.75, steerRatio=11.95, centerToFrontRatio=0.41), # as spec
176173
dbc_dict('acura_rdx_2020_can_generated', None),
177-
flags=HondaFlags.BOSCH
174+
flags=HondaFlags.BOSCH_ALT_BRAKE,
178175
)
179-
INSIGHT = HondaPlatformConfig(
176+
INSIGHT = HondaBoschPlatformConfig(
180177
"HONDA INSIGHT 2019",
181178
HondaCarInfo("Honda Insight 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
182179
CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.0, centerToFrontRatio=0.39), # as spec
183180
dbc_dict('honda_insight_ex_2019_can_generated', None),
184-
flags=HondaFlags.BOSCH
185181
)
186-
HONDA_E = HondaPlatformConfig(
182+
HONDA_E = HondaBoschPlatformConfig(
187183
"HONDA E 2020",
188184
HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS),
189185
CarSpecs(mass=3338.8 * CV.LB_TO_KG, wheelbase=2.5, centerToFrontRatio=0.5, steerRatio=16.71),
190186
dbc_dict('acura_rdx_2020_can_generated', None),
191-
flags=HondaFlags.BOSCH
192187
)
193188

194189
# Nidec Cars
195-
ACURA_ILX = HondaPlatformConfig(
190+
ACURA_ILX = HondaNidecPlatformConfig(
196191
"ACURA ILX 2016",
197192
HondaCarInfo("Acura ILX 2016-19", "AcuraWatch Plus", min_steer_speed=25. * CV.MPH_TO_MS),
198193
CarSpecs(mass=3095 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=18.61, centerToFrontRatio=0.37), # 15.3 is spec end-to-end
199194
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
200-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
195+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
201196
)
202-
CRV = HondaPlatformConfig(
197+
CRV = HondaNidecPlatformConfig(
203198
"HONDA CR-V 2016",
204199
HondaCarInfo("Honda CR-V 2015-16", "Touring Trim", min_steer_speed=12. * CV.MPH_TO_MS),
205200
CarSpecs(mass=3572 * CV.LB_TO_KG, wheelbase=2.62, steerRatio=16.89, centerToFrontRatio=0.41), # as spec
206201
dbc_dict('honda_crv_touring_2016_can_generated', 'acura_ilx_2016_nidec'),
207-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
202+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
208203
)
209-
CRV_EU = HondaPlatformConfig(
204+
CRV_EU = HondaNidecPlatformConfig(
210205
"HONDA CR-V EU 2016",
211-
None, # Euro version of CRV Touring, don't show in docs
206+
None, # Euro version of CRV Touring, don't show in docs
212207
CRV.specs,
213208
dbc_dict('honda_crv_executive_2016_can_generated', 'acura_ilx_2016_nidec'),
214-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
209+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
215210
)
216-
FIT = HondaPlatformConfig(
211+
FIT = HondaNidecPlatformConfig(
217212
"HONDA FIT 2018",
218213
HondaCarInfo("Honda Fit 2018-20", min_steer_speed=12. * CV.MPH_TO_MS),
219214
CarSpecs(mass=2644 * CV.LB_TO_KG, wheelbase=2.53, steerRatio=13.06, centerToFrontRatio=0.39),
220215
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
221-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
216+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
222217
)
223-
FREED = HondaPlatformConfig(
218+
FREED = HondaNidecPlatformConfig(
224219
"HONDA FREED 2020",
225220
HondaCarInfo("Honda Freed 2020", min_steer_speed=12. * CV.MPH_TO_MS),
226221
CarSpecs(mass=3086. * CV.LB_TO_KG, wheelbase=2.74, steerRatio=13.06, centerToFrontRatio=0.39), # mostly copied from FIT
227222
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
228-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
223+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
229224
)
230-
HRV = HondaPlatformConfig(
225+
HRV = HondaNidecPlatformConfig(
231226
"HONDA HRV 2019",
232227
HondaCarInfo("Honda HR-V 2019-22", min_steer_speed=12. * CV.MPH_TO_MS),
233228
HRV_3G.specs,
234229
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
235-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
230+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
236231
)
237-
ODYSSEY = HondaPlatformConfig(
232+
ODYSSEY = HondaNidecPlatformConfig(
238233
"HONDA ODYSSEY 2018",
239234
HondaCarInfo("Honda Odyssey 2018-20"),
240235
CarSpecs(mass=1900, wheelbase=3.0, steerRatio=14.35, centerToFrontRatio=0.41),
241236
dbc_dict('honda_odyssey_exl_2018_generated', 'acura_ilx_2016_nidec'),
242-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_PCM_ACCEL
237+
flags=HondaFlags.NIDEC_ALT_PCM_ACCEL,
243238
)
244-
ODYSSEY_CHN = HondaPlatformConfig(
239+
ODYSSEY_CHN = HondaNidecPlatformConfig(
245240
"HONDA ODYSSEY CHN 2019",
246-
None, # Chinese version of Odyssey, don't show in docs
241+
None, # Chinese version of Odyssey, don't show in docs
247242
ODYSSEY.specs,
248243
dbc_dict('honda_odyssey_extreme_edition_2018_china_can_generated', 'acura_ilx_2016_nidec'),
249-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES
244+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
250245
)
251-
ACURA_RDX = HondaPlatformConfig(
246+
ACURA_RDX = HondaNidecPlatformConfig(
252247
"ACURA RDX 2018",
253248
HondaCarInfo("Acura RDX 2016-18", "AcuraWatch Plus", min_steer_speed=12. * CV.MPH_TO_MS),
254249
CarSpecs(mass=3925 * CV.LB_TO_KG, wheelbase=2.68, steerRatio=15.0, centerToFrontRatio=0.38), # as spec
255250
dbc_dict('acura_rdx_2018_can_generated', 'acura_ilx_2016_nidec'),
256-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
251+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
257252
)
258-
PILOT = HondaPlatformConfig(
253+
PILOT = HondaNidecPlatformConfig(
259254
"HONDA PILOT 2017",
260255
[
261256
HondaCarInfo("Honda Pilot 2016-22", min_steer_speed=12. * CV.MPH_TO_MS),
262257
HondaCarInfo("Honda Passport 2019-23", "All", min_steer_speed=12. * CV.MPH_TO_MS),
263258
],
264259
CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0), # as spec
265260
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
266-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
261+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
267262
)
268-
RIDGELINE = HondaPlatformConfig(
263+
RIDGELINE = HondaNidecPlatformConfig(
269264
"HONDA RIDGELINE 2017",
270265
HondaCarInfo("Honda Ridgeline 2017-24", min_steer_speed=12. * CV.MPH_TO_MS),
271266
CarSpecs(mass=4515 * CV.LB_TO_KG, wheelbase=3.18, centerToFrontRatio=0.41, steerRatio=15.59), # as spec
272267
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
273-
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
268+
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
274269
)
275-
CIVIC = HondaPlatformConfig(
270+
CIVIC = HondaNidecPlatformConfig(
276271
"HONDA CIVIC 2016",
277272
HondaCarInfo("Honda Civic 2016-18", min_steer_speed=12. * CV.MPH_TO_MS, video_link="https://youtu.be/-IkImTe1NYE"),
278273
CarSpecs(mass=1326, wheelbase=2.70, centerToFrontRatio=0.4, steerRatio=15.38), # 10.93 is end-to-end spec
279274
dbc_dict('honda_civic_touring_2016_can_generated', 'acura_ilx_2016_nidec'),
280-
flags=HondaFlags.NIDEC | HondaFlags.AUTORESUME_SNG | HondaFlags.ELECTRIC_PARKING_BRAKE,
281275
)
282276

283277

@@ -344,7 +338,6 @@ class CAR(Platforms):
344338
],
345339
)
346340

347-
348341
STEER_THRESHOLD = {
349342
# default is 1200, overrides go here
350343
CAR.ACURA_RDX: 400,

0 commit comments

Comments
 (0)