      ret.enableCamera = True
      ret.steerRateCost = 0.5
  
      ret.steerActuatorDelay = 0.1
      ret.lateralTuning.pid.kf = 0.00006
      ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.0], [0.0]]
      ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.01], [0.005]]
      ret.steerMaxBP = [0.]  # m/s
      ret.steerMaxV = [1.]
  
      if candidate in [CAR.ROGUE, CAR.XTRAIL]:
        ret.mass = 1610 + STD_CARGO_KG
        ret.wheelbase = 2.705
        ret.centerToFront = ret.wheelbase * 0.44
 
</s> remove     # reset to current steer angle if not active or overriding
    if active:
      curvature_desired = next_curvature
      desired_curvature_rate = next_curvature_rate
    else:
      curvature_desired = measured_curvature
      desired_curvature_rate = 0.0

    # negative sign, controls uses different convention
    self.desired_steering_wheel_angle_deg = -float(math.degrees(curvature_desired * VM.sR)/curvature_factor) + steering_wheel_angle_offset_deg
    self.desired_steering_wheel_angle_rate_deg = -float(math.degrees(desired_curvature_rate * VM.sR)/curvature_factor)
 </s> add     self.desired_curvature = next_curvature
    self.desired_curvature_rate = next_curvature_rate </s> remove       u_lqr = float(self.angle_steers_des / self.dc_gain - self.K.dot(self.x_hat))
 </s> add       u_lqr = float(desired_angle / self.dc_gain - self.K.dot(self.x_hat)) </s> remove   sm['liveParameters'].valid = True
  sm['liveParameters'].sensorValid = True
  sm['liveParameters'].steerRatio = CP.steerRatio
  sm['liveParameters'].stiffnessFactor = 1.0

 </s> add  </s> remove     steering_wheel_angle_offset_deg = sm['liveParameters'].angleOffsetDeg
    steering_wheel_angle_deg = sm['carState'].steeringAngleDeg

    # Update vehicle model
    x = max(sm['liveParameters'].stiffnessFactor, 0.1)
    sr = max(sm['liveParameters'].steerRatio, 0.1)
    VM.update_params(x, sr)
    curvature_factor = VM.curvature_factor(v_ego)
    measured_curvature = -curvature_factor * math.radians(steering_wheel_angle_deg - steering_wheel_angle_offset_deg) / VM.sR

 </s> add     measured_curvature = sm['controlsState'].curvature
      ret.enableCamera = True
      ret.steerRateCost = 0.5
  
      ret.steerActuatorDelay = 0.1





  
      if candidate in [CAR.ROGUE, CAR.XTRAIL]:
        ret.mass = 1610 + STD_CARGO_KG
        ret.wheelbase = 2.705
        ret.centerToFront = ret.wheelbase * 0.44
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 LateralPlanner should only compute curvature (#20289)

* get curvature from planner

* no need to check active

* remove that

* remove self

* liveParams not needed

* cast

* fix test bug

* fixes

* fix ui.py

* fix radians

* update refs

* update refs

* bump cereal

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
selfdrive/car/nissan/interface.py