mirror of https://github.com/commaai/panda.git
Toyota: rename LTA torque wind down signal (#1757)
* rename setme_x64 * bump opendbc ref
This commit is contained in:
parent
a9af9cbd74
commit
ea78657bef
|
@ -52,7 +52,7 @@ ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
|
|||
|
||||
ENV PANDA_PATH=/tmp/openpilot/panda
|
||||
ENV OPENPILOT_REF="5690386d8d731c9bebda536a5c71c890f6dfe98c"
|
||||
ENV OPENDBC_REF="12dd7675c5ab2f49aedb813a79e6131b370b379f"
|
||||
ENV OPENDBC_REF="5b0c73977f1428700d0344d52874a90a4c5168fb"
|
||||
|
||||
COPY requirements.txt /tmp/
|
||||
RUN pyenv install 3.11.4 && \
|
||||
|
|
|
@ -178,15 +178,15 @@ static bool toyota_tx_hook(CANPacket_t *to_send) {
|
|||
// LTA steering check
|
||||
// only sent to prevent dash errors, no actuation is accepted
|
||||
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_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);
|
||||
lta_angle = to_signed(lta_angle, 16);
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,8 +40,8 @@ class TestToyotaSafetyBase(common.PandaCarSafetyTest, common.InterceptorSafetyTe
|
|||
values = {"STEER_TORQUE_CMD": torque, "STEER_REQUEST": steer_req}
|
||||
return self.packer.make_can_msg_panda("STEERING_LKA", 0, values)
|
||||
|
||||
def _lta_msg(self, req, req2, angle_cmd, setme_x64=100):
|
||||
values = {"STEER_REQUEST": req, "STEER_REQUEST_2": req2, "STEER_ANGLE_CMD": angle_cmd, "SETME_X64": setme_x64}
|
||||
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, "TORQUE_WIND_DOWN": torque_wind_down}
|
||||
return self.packer.make_can_msg_panda("STEERING_LTA", 0, values)
|
||||
|
||||
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
|
||||
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, 50, 100],
|
||||
np.linspace(-20, 20, 5)):
|
||||
self.safety.set_controls_allowed(engaged)
|
||||
|
||||
should_tx = not req and not req2 and angle == 0 and setme_x64 == 0
|
||||
self.assertEqual(should_tx, self._tx(self._lta_msg(req, req2, angle, setme_x64)))
|
||||
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, torque_wind_down)))
|
||||
|
||||
def test_rx_hook(self):
|
||||
# checksum checks
|
||||
|
|
Loading…
Reference in New Issue