|  |  | @ -18,17 +18,11 @@ class CarInterface(CarInterfaceBase): | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   @staticmethod |  |  |  |   @staticmethod | 
			
		
	
		
		
			
				
					
					|  |  |  |   def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, car_fw=[]): |  |  |  |   def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, car_fw=[]): | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |     ret = CarInterfaceBase.get_std_params(candidate, fingerprint, has_relay) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     ret = car.CarParams.new_message() |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.carName = "toyota" |  |  |  |     ret.carName = "toyota" | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.carFingerprint = candidate |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.isPandaBlack = has_relay |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.safetyModel = car.CarParams.SafetyModel.toyota |  |  |  |     ret.safetyModel = car.CarParams.SafetyModel.toyota | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.enableCruise = True |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.steerActuatorDelay = 0.12  # Default delay, Prius has larger delay |  |  |  |     ret.steerActuatorDelay = 0.12  # Default delay, Prius has larger delay | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.steerLimitTimer = 0.4 |  |  |  |     ret.steerLimitTimer = 0.4 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -49,19 +43,6 @@ class CarInterface(CarInterfaceBase): | 
			
		
	
		
		
			
				
					
					|  |  |  |       ret.lateralTuning.indi.outerLoopGain = 3.0 |  |  |  |       ret.lateralTuning.indi.outerLoopGain = 3.0 | 
			
		
	
		
		
			
				
					
					|  |  |  |       ret.lateralTuning.indi.timeConstant = 1.0 |  |  |  |       ret.lateralTuning.indi.timeConstant = 1.0 | 
			
		
	
		
		
			
				
					
					|  |  |  |       ret.lateralTuning.indi.actuatorEffectiveness = 1.0 |  |  |  |       ret.lateralTuning.indi.actuatorEffectiveness = 1.0 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # TODO: Determine if this is better than INDI |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.init('lqr') |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.scale = 1500.0 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.ki = 0.01 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.a = [0., 1., -0.22619643, 1.21822268] |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.b = [-1.92006585e-04, 3.95603032e-05] |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.c = [1., 0.] |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.k = [-110.73572306, 451.22718255] |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.l = [0.03233671, 0.03185757] |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       # ret.lateralTuning.lqr.dcGain = 0.002237852961363602 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       ret.steerActuatorDelay = 0.5 |  |  |  |       ret.steerActuatorDelay = 0.5 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     elif candidate in [CAR.RAV4, CAR.RAV4H]: |  |  |  |     elif candidate in [CAR.RAV4, CAR.RAV4H]: | 
			
		
	
	
		
		
			
				
					|  |  | @ -265,16 +246,6 @@ class CarInterface(CarInterfaceBase): | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, |  |  |  |     ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, | 
			
		
	
		
		
			
				
					
					|  |  |  |                                                                          tire_stiffness_factor=tire_stiffness_factor) |  |  |  |                                                                          tire_stiffness_factor=tire_stiffness_factor) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     # no rear steering, at least on the listed cars above |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.steerRatioRear = 0. |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.steerControlType = car.CarParams.SteerControlType.torque |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     # steer, gas, brake limitations VS speed |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.steerMaxBP = [16. * CV.KPH_TO_MS, 45. * CV.KPH_TO_MS]  # breakpoints at 1 and 40 kph |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.steerMaxV = [1., 1.]  # 2/3rd torque allowed above 45 kph |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.brakeMaxBP = [0.] |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.brakeMaxV = [1.] |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.enableCamera = is_ecu_disconnected(fingerprint[0], FINGERPRINTS, ECU_FINGERPRINT, candidate, Ecu.fwdCamera) or has_relay |  |  |  |     ret.enableCamera = is_ecu_disconnected(fingerprint[0], FINGERPRINTS, ECU_FINGERPRINT, candidate, Ecu.fwdCamera) or has_relay | 
			
		
	
		
		
			
				
					
					|  |  |  |     # Detect smartDSU, which intercepts ACC_CMD from the DSU allowing openpilot to send it |  |  |  |     # Detect smartDSU, which intercepts ACC_CMD from the DSU allowing openpilot to send it | 
			
		
	
		
		
			
				
					
					|  |  |  |     smartDsu = 0x2FF in fingerprint[0] |  |  |  |     smartDsu = 0x2FF in fingerprint[0] | 
			
		
	
	
		
		
			
				
					|  |  | @ -301,8 +272,6 @@ class CarInterface(CarInterfaceBase): | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.longitudinalTuning.deadzoneV = [0., .15] |  |  |  |     ret.longitudinalTuning.deadzoneV = [0., .15] | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.longitudinalTuning.kpBP = [0., 5., 35.] |  |  |  |     ret.longitudinalTuning.kpBP = [0., 5., 35.] | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.longitudinalTuning.kiBP = [0., 35.] |  |  |  |     ret.longitudinalTuning.kiBP = [0., 35.] | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.stoppingControl = False |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     ret.startAccel = 0.0 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     if ret.enableGasInterceptor: |  |  |  |     if ret.enableGasInterceptor: | 
			
		
	
		
		
			
				
					
					|  |  |  |       ret.gasMaxBP = [0., 9., 35] |  |  |  |       ret.gasMaxBP = [0., 9., 35] | 
			
		
	
	
		
		
			
				
					|  |  | 
 |