          else:
            self.lkas_action = 5   # 4 and 5 seem the best. 8 and 9 seem to aggressive and laggy
  
          can_sends.append(create_steer_command(self.packer, apply_steer, enabled,
                                                CS.lkas_state, CS.angle_steers, curvature, self.lkas_action))
          self.generic_toggle_last = CS.generic_toggle
  
        if (frame % 100) == 0:
  
          can_sends.append(make_can_msg(973, b'\x00\x00\x00\x00\x00\x00\x00\x00', 0))
          #can_sends.append(make_can_msg(984, b'\x00\x00\x00\x00\x80\x45\x60\x30', 0))
 
</s> remove           self.lkas_action += int(CS.generic_toggle and not self.generic_toggle_last)
 </s> add           self.lkas_action += int(CS.out.genericToggle and not self.generic_toggle_last) </s> remove       if (frame % 100) == 0 or (self.enabled_last != enabled) or (self.main_on_last != CS.main_on) or \
 </s> add       if (frame % 100) == 0 or (self.enabled_last != enabled) or (self.main_on_last != CS.out.cruiseState.available) or \ </s> remove         can_sends.append(create_lkas_ui(self.packer, CS.main_on, enabled, steer_alert))
 </s> add         can_sends.append(create_lkas_ui(self.packer, CS.out.cruiseState.available, enabled, steer_alert)) </s> remove         curvature = self.vehicle_model.calc_curvature(actuators.steerAngle*3.1415/180., CS.v_ego)
 </s> add         curvature = self.vehicle_model.calc_curvature(actuators.steerAngle*3.1415/180., CS.out.vEgo) </s> remove     return ret.as_reader()
 </s> add     self.CS.out = ret.as_reader()

    return self.CS.out
                                              CS.lkas_state, CS.out.steeringAngle, curvature, self.lkas_action))
        self.generic_toggle_last = CS.out.genericToggle
          else:
            self.lkas_action = 5   # 4 and 5 seem the best. 8 and 9 seem to aggressive and laggy
  
          can_sends.append(create_steer_command(self.packer, apply_steer, enabled,
                                              CS.lkas_state, CS.out.steeringAngle, curvature, self.lkas_action))
        self.generic_toggle_last = CS.out.genericToggle
                                              CS.lkas_state, CS.out.steeringAngle, curvature, self.lkas_action))
        self.generic_toggle_last = CS.out.genericToggle
  
        if (frame % 100) == 0:
  
          can_sends.append(make_can_msg(973, b'\x00\x00\x00\x00\x00\x00\x00\x00', 0))
          #can_sends.append(make_can_msg(984, b'\x00\x00\x00\x00\x80\x45\x60\x30', 0))
keep keep keep keep replace replace keep keep keep keep keep
 Ford: have carstate update returning capnp struct directly (#1113)

* Before abstraction, adding speed init from VW as well

* strting to abstract carstate class

* fix bug and update lock?

* revert pipfile change

* another bug

* fix linter

* bug fix

* remove a bunch of diplicated kf code

* better to not have class vars. will abstract __init__ anyway later

* abstract common instance vars in carstate init and a generic gear parser static method

* abstract gear parser for chrysler

* abstract gm gear parser too

* remove unnecessary random vars

* Chrysler: carstate returns capnp struct directly

* revert ref commit

* test ref

* WIP

* more WIP

* ops, missed this conflict

* ford as well

* not sure why this got deleted

* no need to copy

* remove copy

* remove copy import

* remove unnecessary intermediate variable

* remove obsolete comments

Co-authored-by: Willem Melching <willem.melching@gmail.com> 
selfdrive/car/ford/carcontroller.py