| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -12,7 +12,7 @@ from . import hondacan | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from .values import AH | 
					 | 
					 | 
					 | 
					from .values import AH | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def actuator_hystereses(brake, braking, brake_steady, v_ego, civic): | 
					 | 
					 | 
					 | 
					def actuator_hystereses(brake, braking, brake_steady, v_ego, civic, odyssey): | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  # hyst params... TODO: move these to VehicleParams | 
					 | 
					 | 
					 | 
					  # hyst params... TODO: move these to VehicleParams | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  brake_hyst_on = 0.02     # to activate brakes exceed this value | 
					 | 
					 | 
					 | 
					  brake_hyst_on = 0.02     # to activate brakes exceed this value | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  brake_hyst_off = 0.005                     # to deactivate brakes below this value | 
					 | 
					 | 
					 | 
					  brake_hyst_off = 0.005                     # to deactivate brakes below this value | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -32,7 +32,7 @@ def actuator_hystereses(brake, braking, brake_steady, v_ego, civic): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    brake_steady = brake + brake_hyst_gap | 
					 | 
					 | 
					 | 
					    brake_steady = brake + brake_hyst_gap | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  brake = brake_steady | 
					 | 
					 | 
					 | 
					  brake = brake_steady | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  if not civic and brake > 0.0: | 
					 | 
					 | 
					 | 
					  if (not civic and not odyssey) and brake > 0.0: | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    brake += 0.15 | 
					 | 
					 | 
					 | 
					    brake += 0.15 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  return brake, braking, brake_steady | 
					 | 
					 | 
					 | 
					  return brake, braking, brake_steady | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -78,7 +78,7 @@ class CarController(object): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return | 
					 | 
					 | 
					 | 
					      return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # *** apply brake hysteresis *** | 
					 | 
					 | 
					 | 
					    # *** apply brake hysteresis *** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    brake, self.braking, self.brake_steady = actuator_hystereses(actuators.brake, self.braking, self.brake_steady, CS.v_ego, CS.civic) | 
					 | 
					 | 
					 | 
					    brake, self.braking, self.brake_steady = actuator_hystereses(actuators.brake, self.braking, self.brake_steady, CS.v_ego, CS.civic, CS.odyssey) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # *** no output if not enabled *** | 
					 | 
					 | 
					 | 
					    # *** no output if not enabled *** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if not enabled and CS.pcm_acc_status: | 
					 | 
					 | 
					 | 
					    if not enabled and CS.pcm_acc_status: | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -121,8 +121,8 @@ class CarController(object): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    tt = sec_since_boot() | 
					 | 
					 | 
					 | 
					    tt = sec_since_boot() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    GAS_MAX = 1004 | 
					 | 
					 | 
					 | 
					    GAS_MAX = 1004 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    BRAKE_MAX = 1024/4 | 
					 | 
					 | 
					 | 
					    BRAKE_MAX = 1024/4 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if CS.civic: | 
					 | 
					 | 
					 | 
					    if CS.civic or CS.odyssey: | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      is_fw_modified = os.getenv("DONGLE_ID") in ['b0f5a01cf604185c'] | 
					 | 
					 | 
					 | 
					      is_fw_modified = os.getenv("DONGLE_ID") in ['b0f5a01cf604185cxxx'] | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      STEER_MAX = 0x1FFF if is_fw_modified else 0x1000 | 
					 | 
					 | 
					 | 
					      STEER_MAX = 0x1FFF if is_fw_modified else 0x1000 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    elif CS.crv: | 
					 | 
					 | 
					 | 
					    elif CS.crv: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      STEER_MAX = 0x300  # CR-V only uses 12-bits and requires a lower value | 
					 | 
					 | 
					 | 
					      STEER_MAX = 0x300  # CR-V only uses 12-bits and requires a lower value | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |