Skip to content

Commit 19fb385

Browse files
committed
nvm we can't do this since the state management to know when openpilot stops sending cancel is too complex
1 parent b9afa13 commit 19fb385

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

opendbc/safety/safety/safety_rivian.h

+13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include "safety_declarations.h"
44

55
static bool rivian_longitudinal = false;
6+
// If VDM_AdasSts is being sent to the ACM with the intention of canceling
7+
static bool rivian_openpilot_canceling = false;
68

79
static void rivian_rx_hook(const CANPacket_t *to_push) {
810
int bus = GET_BUS(to_push);
@@ -100,6 +102,17 @@ static bool rivian_tx_hook(const CANPacket_t *to_send) {
100102
}
101103
}
102104

105+
if (bus == 2) {
106+
if (addr == 0x162) {
107+
// VDM_AdasInterfaceStatus
108+
const int adas_interface_status = ((GET_BYTE(to_push, 6) >> 3U) & 0x3U;
109+
if (adas_interface_status != 0) {
110+
tx = false;
111+
}
112+
rivian_openpilot_canceling = GET_BIT(to_push, 0);
113+
}
114+
}
115+
103116
return tx;
104117
}
105118

0 commit comments

Comments
 (0)