| 
						
						
						
					 | 
					 | 
					@ -1,4 +1,5 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#!/usr/bin/env python3 | 
					 | 
					 | 
					 | 
					#!/usr/bin/env python3 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import os | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import numpy as np | 
					 | 
					 | 
					 | 
					import numpy as np | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from collections import deque, defaultdict | 
					 | 
					 | 
					 | 
					from collections import deque, defaultdict | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -242,6 +243,8 @@ class TorqueEstimator(ParameterEstimator): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def main(demo=False): | 
					 | 
					 | 
					 | 
					def main(demo=False): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  config_realtime_process([0, 1, 2, 3], 5) | 
					 | 
					 | 
					 | 
					  config_realtime_process([0, 1, 2, 3], 5) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  DEBUG = bool(int(os.getenv("DEBUG", "0"))) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  pm = messaging.PubMaster(['liveTorqueParameters']) | 
					 | 
					 | 
					 | 
					  pm = messaging.PubMaster(['liveTorqueParameters']) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  sm = messaging.SubMaster(['carControl', 'carOutput', 'carState', 'liveCalibration', 'livePose', 'liveDelay'], poll='livePose') | 
					 | 
					 | 
					 | 
					  sm = messaging.SubMaster(['carControl', 'carOutput', 'carState', 'liveCalibration', 'livePose', 'liveDelay'], poll='livePose') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -258,7 +261,7 @@ def main(demo=False): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # 4Hz driven by livePose | 
					 | 
					 | 
					 | 
					    # 4Hz driven by livePose | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if sm.frame % 5 == 0: | 
					 | 
					 | 
					 | 
					    if sm.frame % 5 == 0: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      pm.send('liveTorqueParameters', estimator.get_msg(valid=sm.all_checks())) | 
					 | 
					 | 
					 | 
					      pm.send('liveTorqueParameters', estimator.get_msg(valid=sm.all_checks(), with_points=DEBUG)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # Cache points every 60 seconds while onroad | 
					 | 
					 | 
					 | 
					    # Cache points every 60 seconds while onroad | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if sm.frame % 240 == 0: | 
					 | 
					 | 
					 | 
					    if sm.frame % 240 == 0: | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |