Skip to content

Commit

Permalink
Ford: fix gas/brake cmd in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Jan 17, 2022
1 parent 52c6a26 commit 6fe4ecd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/safety/test_ford.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def setUp(self):
# Driver brake pedal
def _brake_msg(self, brake):
# brake pedal and cruise state share same message, so we have to send
# the cruise state signal too
enable = self.safety.get_cruise_engaged_prev()
# the other signal too (use prev value)
enable = self.safety.get_controls_allowed()
values = {
"BpedDrvAppl_D_Actl": 2 if brake else 1,
"CcStat_D_Actl": 5 if enable else 0,
Expand All @@ -70,7 +70,11 @@ def _gas_msg(self, gas):

# Cruise status
def _pcm_status_msg(self, enable):
# brake pedal and cruise state share same message, so we have to send
# the other signal too (use prev value)
brake = self.safety.get_brake_pressed_prev()
values = {
"BpedDrvAppl_D_Actl": 2 if brake else 1,
"CcStat_D_Actl": 5 if enable else 0,
}
return self.packer.make_can_msg_panda("EngBrakeData", 0, values)
Expand Down

0 comments on commit 6fe4ecd

Please sign in to comment.