Toyota: rename LTA torque wind down signal (#1757)

* rename setme_x64

* bump opendbc ref
This commit is contained in:
Shane Smiskol 2023-12-04 23:05:02 -06:00 committed by GitHub
parent a9af9cbd74
commit ea78657bef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -52,7 +52,7 @@ ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
ENV PANDA_PATH=/tmp/openpilot/panda ENV PANDA_PATH=/tmp/openpilot/panda
ENV OPENPILOT_REF="5690386d8d731c9bebda536a5c71c890f6dfe98c" ENV OPENPILOT_REF="5690386d8d731c9bebda536a5c71c890f6dfe98c"
ENV OPENDBC_REF="12dd7675c5ab2f49aedb813a79e6131b370b379f" ENV OPENDBC_REF="5b0c73977f1428700d0344d52874a90a4c5168fb"
COPY requirements.txt /tmp/ COPY requirements.txt /tmp/
RUN pyenv install 3.11.4 && \ RUN pyenv install 3.11.4 && \

View File

@ -178,15 +178,15 @@ static bool toyota_tx_hook(CANPacket_t *to_send) {
// LTA steering check // LTA steering check
// only sent to prevent dash errors, no actuation is accepted // only sent to prevent dash errors, no actuation is accepted
if (addr == 0x191) { if (addr == 0x191) {
// check the STEER_REQUEST, STEER_REQUEST_2, SETME_X64 STEER_ANGLE_CMD signals // check the STEER_REQUEST, STEER_REQUEST_2, TORQUE_WIND_DOWN, STEER_ANGLE_CMD signals
bool lta_request = GET_BIT(to_send, 0U) != 0U; bool lta_request = GET_BIT(to_send, 0U) != 0U;
bool lta_request2 = GET_BIT(to_send, 25U) != 0U; bool lta_request2 = GET_BIT(to_send, 25U) != 0U;
int setme_x64 = GET_BYTE(to_send, 5); int torque_wind_down = GET_BYTE(to_send, 5);
int lta_angle = (GET_BYTE(to_send, 1) << 8) | GET_BYTE(to_send, 2); int lta_angle = (GET_BYTE(to_send, 1) << 8) | GET_BYTE(to_send, 2);
lta_angle = to_signed(lta_angle, 16); lta_angle = to_signed(lta_angle, 16);
// block LTA msgs with actuation requests // block LTA msgs with actuation requests
if (lta_request || lta_request2 || (lta_angle != 0) || (setme_x64 != 0)) { if (lta_request || lta_request2 || (lta_angle != 0) || (torque_wind_down != 0)) {
tx = false; tx = false;
} }
} }

View File

@ -40,8 +40,8 @@ class TestToyotaSafetyBase(common.PandaCarSafetyTest, common.InterceptorSafetyTe
values = {"STEER_TORQUE_CMD": torque, "STEER_REQUEST": steer_req} values = {"STEER_TORQUE_CMD": torque, "STEER_REQUEST": steer_req}
return self.packer.make_can_msg_panda("STEERING_LKA", 0, values) return self.packer.make_can_msg_panda("STEERING_LKA", 0, values)
def _lta_msg(self, req, req2, angle_cmd, setme_x64=100): def _lta_msg(self, req, req2, angle_cmd, torque_wind_down=100):
values = {"STEER_REQUEST": req, "STEER_REQUEST_2": req2, "STEER_ANGLE_CMD": angle_cmd, "SETME_X64": setme_x64} values = {"STEER_REQUEST": req, "STEER_REQUEST_2": req2, "STEER_ANGLE_CMD": angle_cmd, "TORQUE_WIND_DOWN": torque_wind_down}
return self.packer.make_can_msg_panda("STEERING_LTA", 0, values) return self.packer.make_can_msg_panda("STEERING_LTA", 0, values)
def _accel_msg(self, accel, cancel_req=0): def _accel_msg(self, accel, cancel_req=0):
@ -78,14 +78,14 @@ class TestToyotaSafetyBase(common.PandaCarSafetyTest, common.InterceptorSafetyTe
# Only allow LTA msgs with no actuation # Only allow LTA msgs with no actuation
def test_lta_steer_cmd(self): def test_lta_steer_cmd(self):
for engaged, req, req2, setme_x64, angle in itertools.product([True, False], for engaged, req, req2, torque_wind_down, angle in itertools.product([True, False],
[0, 1], [0, 1], [0, 1], [0, 1],
[0, 50, 100], [0, 50, 100],
np.linspace(-20, 20, 5)): np.linspace(-20, 20, 5)):
self.safety.set_controls_allowed(engaged) self.safety.set_controls_allowed(engaged)
should_tx = not req and not req2 and angle == 0 and setme_x64 == 0 should_tx = not req and not req2 and angle == 0 and torque_wind_down == 0
self.assertEqual(should_tx, self._tx(self._lta_msg(req, req2, angle, setme_x64))) self.assertEqual(should_tx, self._tx(self._lta_msg(req, req2, angle, torque_wind_down)))
def test_rx_hook(self): def test_rx_hook(self):
# checksum checks # checksum checks