Skip to content

Commit

Permalink
safety replay: fix gm segments (commaai#1147)
Browse files Browse the repository at this point in the history
get torque on gm for safety replay
  • Loading branch information
sshane committed Nov 11, 2022
1 parent d574f4a commit 72fd777
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/safety_replay/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_steer_torque(mode, to_send):
ret = (to_send.RDLR & 0xFF00) | ((to_send.RDLR >> 16) & 0xFF)
ret = to_signed(ret, 16)
elif mode == Panda.SAFETY_GM:
ret = ((to_send.RDLR & 0x7) << 8) + ((to_send.RDLR & 0xFF00) >> 8)
ret = ((to_send.data[0] & 0x7) << 8) | to_send.data[1]
ret = to_signed(ret, 11)
elif mode == Panda.SAFETY_HYUNDAI:
ret = (((to_send.data[3] & 0x7) << 8) | to_send.data[2]) - 1024
Expand Down

0 comments on commit 72fd777

Please sign in to comment.