  class FirstOrderFilter:
    # first order filter
    def __init__(self, x0, rc, dt):
      self.x = x0
      self.dt = dt
      self.update_alpha(rc)
  
    def update_alpha(self, rc):
 
</s> remove     self.x = (1. - self.alpha) * self.x + self.alpha * x
 </s> add     if self.initialized:
      self.x = (1. - self.alpha) * self.x + self.alpha * x
    else:
      self.initialized = True
      self.x = x </s> remove     self.angle_offset = 0.
 </s> add     self.angle_offset = FirstOrderFilter(None, 60.0, DT_CTRL, initialized=False) </s> remove     if abs(cp.vl["STEER_TORQUE_SENSOR"]["STEER_ANGLE"]) > 1e-3:
 </s> add     if abs(torque_sensor_angle_deg) > 1e-3:
  def __init__(self, x0, rc, dt, initialized=True):
  class FirstOrderFilter:
    # first order filter
  def __init__(self, x0, rc, dt, initialized=True):
      self.x = x0
      self.dt = dt
      self.update_alpha(rc)
  
    def update_alpha(self, rc):
keep keep replace keep keep keep keep keep
 Continuously update offset between TSS2 angle sensors (#21943)

* Continuously update offset between TSS2 angle sensors

* add comment

* less lines

* only when initialized

* init to None

* update ref 
common/filter_simple.py