Skip to content

Commit

Permalink
2017 Honda Ridgeline (#198)
Browse files Browse the repository at this point in the history
* Adds Honda Ridgeline

Replaced trim level placeholder

Adding 0x301 ridgeline message

(I restructured this slightly since we don't need to repeat `commands.append(make_can_msg(0x300, msg_0x300, idx, 1))` so many times

Updated dbc name

Use pedal_gas to detect gas pressed

Remove unnecessary signal check

Fix array notation

* Tire stiffness factor bumped to 1.5x

* Adds safety tests at line 133

* Revert "Adds safety tests at line 133"

This reverts commit 349edf5b1a879cac704db3786d0626211497bcb7.

* fix failing build due to syntax

* update variables for failing build

* Update interface.py

* Update Tire Slip Factor
  • Loading branch information
energee authored and rbiasini committed Apr 13, 2018
1 parent 9f59ef7 commit 703b051
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 23 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ Supported Cars

- Acura RDX 2018 with AcuraWatch Plus (alpha!)
- Can only be enabled above 25 mph

- Honda Pilot 2017 with Honda Sensing (alpha!)
- Can only be enabled above 27 mph
- Can only be enabled above 27 mph

- Honda Ridgeline 2017 with Honda Sensing (alpha!)
- Can only be enabled above 27 mph

- Toyota RAV-4 2016+ non-hybrid with TSS-P
- By default it uses stock Toyota ACC for longitudinal control
Expand Down
4 changes: 4 additions & 0 deletions common/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class HONDA:
ODYSSEY = "HONDA ODYSSEY 2018 EX-L"
ACURA_RDX = "ACURA RDX 2018 ACURAWATCH PLUS"
PILOT = "HONDA PILOT 2017 TOURING"
RIDGELINE = "HONDA RIDGELINE 2017 BLACK EDITION"


class TOYOTA:
Expand Down Expand Up @@ -45,6 +46,9 @@ class TOYOTA:
HONDA.PILOT: [{
1600L: 5, 1027L: 5, 1668L: 5, 1029L: 8, 1601L: 8, 777L: 8, 891L: 8, 1036L: 8, 399L: 7, 1424L: 5, 145L: 8, 660L: 8, 985L: 3, 1616L: 5, 538L: 3, 795L: 8, 542L: 7, 773L: 7, 800L: 8, 545L: 5, 546L: 3, 419L: 8, 420L: 8, 422L: 8, 1064L: 7, 425L: 8, 426L: 8, 427L: 3, 432L: 7, 819L: 7, 308L: 5, 821L: 5, 57L: 3, 965L: 8, 316L: 8, 829L: 5, 1088L: 8, 1089L: 8, 963L: 8, 837L: 5, 966L: 8, 929L: 8, 780L: 8, 923L: 2, 1613L: 5, 334L: 8, 463L: 8, 464L: 8, 1618L: 5, 1108L: 8, 597L: 8, 342L: 6, 983L: 8, 856L: 7, 804L: 8, 1612L: 5, 476L: 4, 1125L: 8, 344L: 8, 1296L: 8, 379L: 8, 228L: 5, 229L: 4, 871L: 8, 892L: 8, 490L: 8, 808L: 8, 882L: 2, 884L: 7, 967L: 8, 506L: 8, 507L: 1, 380L: 8,
}],
HONDA.RIDGELINE: [{
57L: 3, 145L: 8, 228L: 5, 229L: 4, 308L: 5, 316L: 8, 339L: 7, 342L: 6, 344L: 8, 380L: 8, 392L: 6, 399L: 7, 419L: 8, 420L: 8, 422L: 8, 425L: 8, 426L: 8, 427L: 3, 432L: 7, 464L: 8, 471L: 3, 476L: 4, 490L: 8, 506L: 8, 545L: 5, 546L: 3, 597L: 8, 660L: 8, 773L: 7, 777L: 8, 780L: 8, 795L: 8, 800L: 8, 804L: 8, 808L: 8, 819L: 7, 821L: 5, 829L: 5, 871L: 8, 882L: 2, 884L: 7, 892L: 8, 923L: 2, 927L: 8, 929L: 8, 963L: 8, 965L: 8, 966L: 8, 967L: 8, 983L: 8, 985L: 3, 1027L: 5, 1029L: 8, 1036L: 8, 1039L: 8, 1064L: 7, 1088L: 8, 1089L: 8, 1108L: 8, 1125L: 8, 1296L: 8, 1365L: 5, 1424L: 5, 1600L: 5, 1601L: 8, 1613L: 5, 1616L: 5, 1618L: 5, 1668L: 5, 2015L: 3
}],
TOYOTA.RAV4: [{
36L: 8, 37L: 8, 170L: 8, 180L: 8, 186L: 4, 426L: 6, 452L: 8, 464L: 8, 466L: 8, 467L: 8, 547L: 8, 548L: 8, 552L: 4, 562L: 4, 608L: 8, 610L: 5, 643L: 7, 705L: 8, 725L: 2, 740L: 5, 800L: 8, 835L: 8, 836L: 8, 849L: 4, 869L: 7, 870L: 7, 871L: 2, 896L: 8, 897L: 8, 900L: 6, 902L: 6, 905L: 8, 911L: 8, 916L: 3, 918L: 7, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 951L: 8, 955L: 4, 956L: 8, 979L: 2, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1005L: 2, 1008L: 2, 1014L: 8, 1017L: 8, 1041L: 8, 1042L: 8, 1043L: 8, 1044L: 8, 1056L: 8, 1059L: 1, 1114L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1176L: 8, 1177L: 8, 1178L: 8, 1179L: 8, 1180L: 8, 1181L: 8, 1190L: 8, 1191L: 8, 1192L: 8, 1196L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1263L: 8, 1264L: 8, 1279L: 8, 1408L: 8, 1409L: 8, 1410L: 8, 1552L: 8, 1553L: 8, 1554L: 8, 1555L: 8, 1556L: 8, 1557L: 8, 1561L: 8, 1562L: 8, 1568L: 8, 1569L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1584L: 8, 1589L: 8, 1592L: 8, 1593L: 8, 1595L: 8, 1596L: 8, 1597L: 8, 1600L: 8, 1656L: 8, 1664L: 8, 1728L: 8, 1745L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8
}],
Expand Down
3 changes: 2 additions & 1 deletion selfdrive/car/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
HONDA.ACURA_ILX: HondaInterface,
HONDA.CRV: HondaInterface,
HONDA.ODYSSEY: HondaInterface,
HONDA.ACURA_RDX: HondaInterface,
HONDA.ACURA_RDX: HondaInterface,
HONDA.PILOT: HondaInterface,
HONDA.RIDGELINE: HondaInterface,


TOYOTA.PRIUS: ToyotaInterface,
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/honda/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \

# *** compute control surfaces ***
BRAKE_MAX = 1024/4
if CS.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY, CAR.PILOT):
if CS.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY, CAR.PILOT, CAR.RIDGELINE):
is_fw_modified = os.getenv("DONGLE_ID") in ['99c94dc769b5d96e']
STEER_MAX = 0x1FFF if is_fw_modified else 0x1000
elif CS.CP.carFingerprint in (CAR.CRV, CAR.ACURA_RDX):
Expand Down
9 changes: 6 additions & 3 deletions selfdrive/car/honda/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def parse_gear_shifter(can_gear_shifter, car_fingerprint):
return "sport"
elif can_gear_shifter == 0x20:
return "low"
elif car_fingerprint in (CAR.PILOT):
# TODO: neutral?

elif car_fingerprint in (CAR.PILOT, CAR.RIDGELINE):
if can_gear_shifter == 0x8:
return "reverse"
elif can_gear_shifter == 0x4:
Expand Down Expand Up @@ -140,6 +140,9 @@ def get_can_signals(CP):
dbc_f = 'honda_pilot_touring_2017_can_generated.dbc'
signals += [("MAIN_ON", "SCM_BUTTONS", 0),
("CAR_GAS", "GAS_PEDAL_2", 0)]
elif CP.carFingerprint == CAR.RIDGELINE:
dbc_f = 'honda_ridgeline_black_edition_2017_can_generated.dbc'
signals += [("MAIN_ON", "SCM_BUTTONS", 0)]

# add gas interceptor reading if we are using it
if CP.enableGas:
Expand Down Expand Up @@ -261,7 +264,7 @@ def update(self, cp):

self.pedal_gas = cp.vl["POWERTRAIN_DATA"]['PEDAL_GAS']
# crv doesn't include cruise control
if self.CP.carFingerprint in (CAR.CRV, CAR.ODYSSEY, CAR.ACURA_RDX):
if self.CP.carFingerprint in (CAR.CRV, CAR.ODYSSEY, CAR.ACURA_RDX, CAR.RIDGELINE):
self.car_gas = self.pedal_gas
else:
self.car_gas = cp.vl["GAS_PEDAL_2"]['CAR_GAS']
Expand Down
27 changes: 13 additions & 14 deletions selfdrive/car/honda/hondacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,19 @@ def create_radar_commands(v_ego, car_fingerprint, idx):
if car_fingerprint == CAR.CIVIC:
msg_0x301 = "\x02\x38\x44\x32\x4f\x00\x00"
commands.append(make_can_msg(0x300, msg_0x300, idx + 8, 1)) # add 8 on idx.
elif car_fingerprint == CAR.CRV:
msg_0x301 = "\x00\x00\x50\x02\x51\x00\x00"
commands.append(make_can_msg(0x300, msg_0x300, idx, 1))
elif car_fingerprint == CAR.ACURA_RDX:
msg_0x301 = "\x0f\x57\x4f\x02\x5a\x00\x00"
commands.append(make_can_msg(0x300, msg_0x300, idx, 1))
elif car_fingerprint == CAR.ODYSSEY:
msg_0x301 = "\x00\x00\x56\x02\x55\x00\x00"
commands.append(make_can_msg(0x300, msg_0x300, idx, 1))
elif car_fingerprint == CAR.ACURA_ILX:
msg_0x301 = "\x0f\x18\x51\x02\x5a\x00\x00"
commands.append(make_can_msg(0x300, msg_0x300, idx, 1))
elif car_fingerprint == CAR.PILOT:
msg_0x301 = "\x00\x00\x56\x02\x58\x00\x00"
else:
if car_fingerprint == CAR.CRV:
msg_0x301 = "\x00\x00\x50\x02\x51\x00\x00"
elif car_fingerprint == CAR.ACURA_RDX:
msg_0x301 = "\x0f\x57\x4f\x02\x5a\x00\x00"
elif car_fingerprint == CAR.ODYSSEY:
msg_0x301 = "\x00\x00\x56\x02\x55\x00\x00"
elif car_fingerprint == CAR.ACURA_ILX:
msg_0x301 = "\x0f\x18\x51\x02\x5a\x00\x00"
elif car_fingerprint == CAR.PILOT:
msg_0x301 = "\x00\x00\x56\x02\x58\x00\x00"
elif car_fingerprint == CAR.RIDGELINE:
msg_0x301 = "\x00\x00\x56\x02\x57\x00\x00"
commands.append(make_can_msg(0x300, msg_0x300, idx, 1))

commands.append(make_can_msg(0x301, msg_0x301, idx, 1))
Expand Down
20 changes: 18 additions & 2 deletions selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def get_params(candidate, fingerprint):
# kg of standard extra cargo to count for drive, gas, etc...
std_cargo = 136

# Ridgeline reqires scaled tire stiffness
ts_factor = 1

ret = car.CarParams.new_message()

ret.carName = "honda"
Expand Down Expand Up @@ -236,6 +239,19 @@ def get_params(candidate, fingerprint):
ret.steerRatio = 16.0
ret.steerKpV, ret.steerKiV = [[0.38], [0.11]]

ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
ret.longitudinalKiBP = [0., 35.]
ret.longitudinalKiV = [0.18, 0.12]
elif candidate == CAR.RIDGELINE:
stop_and_go = False
ts_factor = 1.4
ret.mass = 4515./2.205 + std_cargo
ret.wheelbase = 3.18
ret.centerToFront = ret.wheelbase * 0.41
ret.steerRatio = 15.59
ret.steerKpV, ret.steerKiV = [[0.38], [0.11]]

ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
ret.longitudinalKiBP = [0., 35.]
Expand All @@ -258,10 +274,10 @@ def get_params(candidate, fingerprint):

# TODO: start from empirically derived lateral slip stiffness for the civic and scale by
# mass and CG position, so all cars will have approximately similar dyn behaviors
ret.tireStiffnessFront = tireStiffnessFront_civic * \
ret.tireStiffnessFront = (tireStiffnessFront_civic * ts_factor) * \
ret.mass / mass_civic * \
(centerToRear / ret.wheelbase) / (centerToRear_civic / wheelbase_civic)
ret.tireStiffnessRear = tireStiffnessRear_civic * \
ret.tireStiffnessRear = (tireStiffnessRear_civic * ts_factor) * \
ret.mass / mass_civic * \
(ret.centerToFront / ret.wheelbase) / (centerToFront_civic / wheelbase_civic)

Expand Down

0 comments on commit 703b051

Please sign in to comment.