Skip to content

Commit 2f973f6

Browse files
committed
body: we don't rx _torque_cmd_msg
1 parent d41d8c3 commit 2f973f6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

opendbc/safety/safety/safety_body.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ static bool body_tx_hook(const CANPacket_t *to_send) {
3030
}
3131

3232
static safety_config body_init(uint16_t param) {
33-
// TODO: double check these
3433
static RxCheck body_rx_checks[] = {
35-
{.msg = {{0x201, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}},
36-
{.msg = {{0x250, 0, 6, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}},
37-
{.msg = {{0x350, 0, 6, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}},
34+
{.msg = {{0x201, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, // MOTORS_DATA
35+
{.msg = {{0x203, 0, 4, .ignore_checksum = true, .ignore_counter = true, .frequency = 1U}, { 0 }, { 0 }}}, // BODY_DATA
3836
};
3937

4038
static const CanMsg BODY_TX_MSGS[] = {{0x250, 0, 8, false}, {0x250, 0, 6, false}, {0x251, 0, 5, false}, // body

opendbc/safety/tests/test_body.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ def _motors_data_msg(self, speed_l, speed_r):
2222
values = {"SPEED_L": speed_l, "SPEED_R": speed_r}
2323
return self.packer.make_can_msg_panda("MOTORS_DATA", 0, values)
2424

25+
def _body_data_msg(self):
26+
return self.packer.make_can_msg_panda("BODY_DATA", 0, {})
27+
2528
def _torque_cmd_msg(self, torque_l, torque_r):
2629
values = {"TORQUE_L": torque_l, "TORQUE_R": torque_r}
2730
return self.packer.make_can_msg_panda("TORQUE_CMD", 0, values)
@@ -39,7 +42,7 @@ def test_rx_hook(self):
3942
self.assertFalse(self.safety.get_vehicle_moving())
4043

4144
# controls allowed when we get MOTORS_DATA message
42-
self.assertTrue(self._rx(self._torque_cmd_msg(0, 0)))
45+
self.assertTrue(self._rx(self._body_data_msg()))
4346
self.assertTrue(self.safety.get_vehicle_moving()) # always moving
4447
self.assertFalse(self.safety.get_controls_allowed())
4548

0 commit comments

Comments
 (0)