Skip to content

Commit

Permalink
fixed desired_torque reading
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasloetkolben committed Dec 24, 2024
1 parent 53a8022 commit 1c88392
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion board/safety/safety_rivian.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static bool rivian_tx_hook(const CANPacket_t *to_send) {

// Steering control
if (addr == 0x120) {
int desired_torque = ((GET_BYTES(to_send, 2, 3) >> 16) & 0x7ffU) - 1024U;
int desired_torque = ((GET_BYTE(to_push, 2) << 3U) | (GET_BYTE(to_push, 3) >> 5U)) - 1024U;
bool steer_req = GET_BIT(to_send, 28U);

if (steer_torque_cmd_checks(desired_torque, steer_req, RIVIAN_STEERING_LIMITS)) {
Expand Down

0 comments on commit 1c88392

Please sign in to comment.