mirror of https://github.com/commaai/panda.git
Honda: remove bosch giraffe support (#791)
This commit is contained in:
parent
e9365d44d3
commit
5d2d4ce1e7
|
@ -241,7 +241,6 @@ const safety_hook_config safety_hook_registry[] = {
|
|||
{SAFETY_TOYOTA, &toyota_hooks},
|
||||
{SAFETY_ELM327, &elm327_hooks},
|
||||
{SAFETY_GM, &gm_hooks},
|
||||
{SAFETY_HONDA_BOSCH_GIRAFFE, &honda_bosch_giraffe_hooks},
|
||||
{SAFETY_HONDA_BOSCH_HARNESS, &honda_bosch_harness_hooks},
|
||||
{SAFETY_HYUNDAI, &hyundai_hooks},
|
||||
{SAFETY_CHRYSLER, &chrysler_hooks},
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
// brake rising edge
|
||||
// brake > 0mph
|
||||
const CanMsg HONDA_N_TX_MSGS[] = {{0xE4, 0, 5}, {0x194, 0, 4}, {0x1FA, 0, 8}, {0x200, 0, 6}, {0x30C, 0, 8}, {0x33D, 0, 5}};
|
||||
const CanMsg HONDA_BG_TX_MSGS[] = {{0xE4, 2, 5}, {0xE5, 2, 8}, {0x296, 0, 4}, {0x33D, 2, 5}}; // Bosch Giraffe
|
||||
const CanMsg HONDA_BH_TX_MSGS[] = {{0xE4, 0, 5}, {0xE5, 0, 8}, {0x296, 1, 4}, {0x33D, 0, 5}}; // Bosch Harness
|
||||
const CanMsg HONDA_BG_LONG_TX_MSGS[] = {{0xE4, 0, 5}, {0x1DF, 0, 8}, {0x1EF, 0, 8}, {0x1FA, 0, 8}, {0x30C, 0, 8}, {0x33D, 0, 5}, {0x39F, 0, 8}, {0x18DAB0F1, 0, 8}}; // Bosch Giraffe w/ gas and brakes
|
||||
const CanMsg HONDA_BH_LONG_TX_MSGS[] = {{0xE4, 1, 5}, {0x1DF, 1, 8}, {0x1EF, 1, 8}, {0x1FA, 1, 8}, {0x30C, 1, 8}, {0x33D, 1, 5}, {0x39F, 1, 8}, {0x18DAB0F1, 1, 8}}; // Bosch Harness w/ gas and brakes
|
||||
|
||||
// Roughly calculated using the offsets in openpilot +5%:
|
||||
|
@ -24,7 +22,7 @@ const int HONDA_BOSCH_NO_GAS_VALUE = -30000; // value sent when not requesting g
|
|||
const int HONDA_BOSCH_GAS_MAX = 2000;
|
||||
const int HONDA_BOSCH_ACCEL_MIN = -350; // max braking == -3.5m/s2
|
||||
|
||||
// Nidec and Bosch giraffe have pt on bus 0
|
||||
// Nidec has the powertrain bus on bus 0
|
||||
AddrCheckStruct honda_nidec_addr_checks[] = {
|
||||
{.msg = {{0x1A6, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U},
|
||||
{0x296, 0, 4, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U}, { 0 }}},
|
||||
|
@ -61,7 +59,7 @@ int honda_brake = 0;
|
|||
bool honda_alt_brake_msg = false;
|
||||
bool honda_fwd_brake = false;
|
||||
bool honda_bosch_long = false;
|
||||
enum {HONDA_N_HW, HONDA_BG_HW, HONDA_BH_HW} honda_hw = HONDA_N_HW;
|
||||
enum {HONDA_N_HW, HONDA_BH_HW} honda_hw = HONDA_N_HW;
|
||||
addr_checks honda_rx_checks = {honda_nidec_addr_checks, HONDA_NIDEC_ADDR_CHECKS_LEN};
|
||||
|
||||
|
||||
|
@ -217,11 +215,7 @@ static int honda_tx_hook(CANPacket_t *to_send) {
|
|||
int addr = GET_ADDR(to_send);
|
||||
int bus = GET_BUS(to_send);
|
||||
|
||||
if ((honda_hw == HONDA_BG_HW) && !honda_bosch_long) {
|
||||
tx = msg_allowed(to_send, HONDA_BG_TX_MSGS, sizeof(HONDA_BG_TX_MSGS)/sizeof(HONDA_BG_TX_MSGS[0]));
|
||||
} else if ((honda_hw == HONDA_BG_HW) && honda_bosch_long) {
|
||||
tx = msg_allowed(to_send, HONDA_BG_LONG_TX_MSGS, sizeof(HONDA_BG_LONG_TX_MSGS)/sizeof(HONDA_BG_LONG_TX_MSGS[0]));
|
||||
} else if ((honda_hw == HONDA_BH_HW) && !honda_bosch_long) {
|
||||
if ((honda_hw == HONDA_BH_HW) && !honda_bosch_long) {
|
||||
tx = msg_allowed(to_send, HONDA_BH_TX_MSGS, sizeof(HONDA_BH_TX_MSGS)/sizeof(HONDA_BH_TX_MSGS[0]));
|
||||
} else if ((honda_hw == HONDA_BH_HW) && honda_bosch_long) {
|
||||
tx = msg_allowed(to_send, HONDA_BH_LONG_TX_MSGS, sizeof(HONDA_BH_LONG_TX_MSGS)/sizeof(HONDA_BH_LONG_TX_MSGS[0]));
|
||||
|
@ -343,22 +337,6 @@ static const addr_checks* honda_nidec_init(int16_t param) {
|
|||
return &honda_rx_checks;
|
||||
}
|
||||
|
||||
static const addr_checks* honda_bosch_giraffe_init(int16_t param) {
|
||||
controls_allowed = false;
|
||||
relay_malfunction_reset();
|
||||
honda_hw = HONDA_BG_HW;
|
||||
// Checking for alternate brake override from safety parameter
|
||||
honda_alt_brake_msg = GET_FLAG(param, HONDA_PARAM_ALT_BRAKE);
|
||||
|
||||
// radar disabled so allow gas/brakes
|
||||
#ifdef ALLOW_DEBUG
|
||||
honda_bosch_long = GET_FLAG(param, HONDA_PARAM_BOSCH_LONG);
|
||||
#endif
|
||||
|
||||
honda_rx_checks = (addr_checks){honda_nidec_addr_checks, HONDA_NIDEC_ADDR_CHECKS_LEN};
|
||||
return &honda_rx_checks;
|
||||
}
|
||||
|
||||
static const addr_checks* honda_bosch_harness_init(int16_t param) {
|
||||
controls_allowed = false;
|
||||
relay_malfunction_reset();
|
||||
|
@ -427,14 +405,6 @@ const safety_hooks honda_nidec_hooks = {
|
|||
.fwd = honda_nidec_fwd_hook,
|
||||
};
|
||||
|
||||
const safety_hooks honda_bosch_giraffe_hooks = {
|
||||
.init = honda_bosch_giraffe_init,
|
||||
.rx = honda_rx_hook,
|
||||
.tx = honda_tx_hook,
|
||||
.tx_lin = nooutput_tx_lin_hook,
|
||||
.fwd = honda_bosch_fwd_hook,
|
||||
};
|
||||
|
||||
const safety_hooks honda_bosch_harness_hooks = {
|
||||
.init = honda_bosch_harness_init,
|
||||
.rx = honda_rx_hook,
|
||||
|
|
|
@ -372,21 +372,6 @@ class TestHondaBoschHarnessSafety(TestHondaBoschSafety):
|
|||
self.assertTrue(self._tx(self._button_msg(Btn.RESUME)))
|
||||
|
||||
|
||||
class TestHondaBoschGiraffeSafety(TestHondaBoschHarnessSafety):
|
||||
TX_MSGS = [[0xE4, 2], [0xE5, 2], [0x296, 0], [0x33D, 2]] # Bosch Giraffe
|
||||
RELAY_MALFUNCTION_BUS = 2
|
||||
FWD_BLACKLISTED_ADDRS = {1: [0xE4, 0xE5, 0x33D]}
|
||||
FWD_BUS_LOOKUP = {1: 2, 2: 1}
|
||||
|
||||
PT_BUS = 0
|
||||
STEER_BUS = 2
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.safety.set_safety_hooks(Panda.SAFETY_HONDA_BOSCH_GIRAFFE, 0)
|
||||
self.safety.init_tests_honda()
|
||||
|
||||
|
||||
class TestHondaBoschLongSafety(TestHondaBoschSafety):
|
||||
NO_GAS = -30000
|
||||
MAX_GAS = 2000
|
||||
|
@ -451,20 +436,5 @@ class TestHondaBoschLongHarnessSafety(TestHondaBoschLongSafety):
|
|||
self.safety.init_tests_honda()
|
||||
|
||||
|
||||
class TestHondaBoschLongGiraffeSafety(TestHondaBoschLongSafety):
|
||||
TX_MSGS = [[0xE4, 0], [0x1DF, 0], [0x1EF, 0], [0x1FA, 0], [0x30C, 0], [0x33D, 0], [0x39F, 0], [0x18DAB0F1, 0]] # Bosch Giraffe w/ gas and brakes
|
||||
RELAY_MALFUNCTION_BUS = 2
|
||||
FWD_BLACKLISTED_ADDRS = {1: [0xE4, 0xE5, 0x33D]}
|
||||
FWD_BUS_LOOKUP = {1: 2, 2: 1}
|
||||
|
||||
PT_BUS = 0
|
||||
STEER_BUS = 0
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.safety.set_safety_hooks(Panda.SAFETY_HONDA_BOSCH_GIRAFFE, 2)
|
||||
self.safety.init_tests_honda()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
@ -10,7 +10,7 @@ def to_signed(d, bits):
|
|||
|
||||
def is_steering_msg(mode, addr):
|
||||
ret = False
|
||||
if mode in [Panda.SAFETY_HONDA_NIDEC, Panda.SAFETY_HONDA_BOSCH_GIRAFFE, Panda.SAFETY_HONDA_BOSCH_HARNESS]:
|
||||
if mode in [Panda.SAFETY_HONDA_NIDEC, Panda.SAFETY_HONDA_BOSCH_HARNESS]:
|
||||
ret = (addr == 0xE4) or (addr == 0x194) or (addr == 0x33D)
|
||||
elif mode == Panda.SAFETY_TOYOTA:
|
||||
ret = addr == 0x2E4
|
||||
|
@ -26,7 +26,7 @@ def is_steering_msg(mode, addr):
|
|||
|
||||
def get_steer_torque(mode, to_send):
|
||||
ret = 0
|
||||
if mode in [Panda.SAFETY_HONDA_NIDEC, Panda.SAFETY_HONDA_BOSCH_GIRAFFE, Panda.SAFETY_HONDA_BOSCH_HARNESS]:
|
||||
if mode in [Panda.SAFETY_HONDA_NIDEC, Panda.SAFETY_HONDA_BOSCH_HARNESS]:
|
||||
ret = to_send.RDLR & 0xFFFF0000
|
||||
elif mode == Panda.SAFETY_TOYOTA:
|
||||
ret = (to_send.RDLR & 0xFF00) | ((to_send.RDLR >> 16) & 0xFF)
|
||||
|
@ -44,7 +44,7 @@ def get_steer_torque(mode, to_send):
|
|||
return ret
|
||||
|
||||
def set_desired_torque_last(safety, mode, torque):
|
||||
if mode in [Panda.SAFETY_HONDA_NIDEC, Panda.SAFETY_HONDA_BOSCH_GIRAFFE, Panda.SAFETY_HONDA_BOSCH_HARNESS]:
|
||||
if mode in [Panda.SAFETY_HONDA_NIDEC, Panda.SAFETY_HONDA_BOSCH_HARNESS]:
|
||||
pass # honda safety mode doesn't enforce a rate on steering msgs
|
||||
elif mode == Panda.SAFETY_TOYOTA:
|
||||
safety.set_toyota_desired_torque_last(torque)
|
||||
|
|
|
@ -13,7 +13,6 @@ logs = [
|
|||
("2425568437959f9d|2019-12-22--16-24-37.bz2", Panda.SAFETY_HONDA_NIDEC, 0), # HONDA.CIVIC (fcw presents: 0x1FA blocked as expected)
|
||||
("38bfd238edecbcd7|2019-06-07--10-15-25.bz2", Panda.SAFETY_TOYOTA, 66), # TOYOTA.PRIUS
|
||||
("f89c604cf653e2bf|2018-09-29--13-46-50.bz2", Panda.SAFETY_GM, 0), # GM.VOLT
|
||||
("0375fdf7b1ce594d|2019-05-21--20-10-33.bz2", Panda.SAFETY_HONDA_BOSCH_GIRAFFE, 1), # HONDA.ACCORD
|
||||
("6fb4948a7ebe670e|2019-11-12--00-35-53.bz2", Panda.SAFETY_CHRYSLER, 0), # CHRYSLER.PACIFICA_2018_HYBRID
|
||||
("791340bc01ed993d|2019-04-08--10-26-00.bz2", Panda.SAFETY_SUBARU, 0), # SUBARU.IMPREZA
|
||||
("76b83eb0245de90e|2020-03-05--19-16-05.bz2", Panda.SAFETY_VOLKSWAGEN_MQB, 0), # VOLKSWAGEN.GOLF (MK7)
|
||||
|
|
Loading…
Reference in New Issue