jyoung8607 / openpilot

open source driving agent
MIT License
73 stars 54 forks source link

Fix bug with ACC engagement tracking when driver accelerates #27

Closed edukinara closed 5 years ago

edukinara commented 5 years ago

Track gas press state in ACC engagement tracking logic:

// panda/board/safety/safety_volkswagen.h
  if (addr == 0x122)
  {
    uint8_t acc_status = (GET_BYTE(to_push, 7) & 0x70) >> 4;
    controls_allowed = (acc_status == 3 || acc_status == 4) ? true : false;
  }
# selfdrive/car/volkswagen/carstate.py
elif acc_control_status == 3 or acc_control_status == 4:
      # ACC okay and enabled, currently engaged and regulating speed (3) or engaged with driver accelerating (4)
      self.acc_enabled = True
      self.acc_active = True
      self.acc_error = False
jyoung8607 commented 5 years ago

This is resolved at both the controls and Panda level in vw-063-devel, to be merged into base later. Thanks!