-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
For the traffic light "detected" is used to decide whether it's green or not:
dt-core/packages/led_detection/src/led_detector_node.py
Lines 400 to 411 in 7695a6b
| # Decide whether LED or not (traffic light) | |
| for i in range(len(BlobsTL)): | |
| #rospy.loginfo('[%s] Detection of the traffic light' % (self.node_name)) | |
| # Detection | |
| detected, result,freq_identified, fft_peak_freq = self.detect_blob(BlobsTL[i],T,NIm,H,W,self.cropNormalizedTL,timestamps,result) | |
| # Take decision | |
| if detected: | |
| self.traffic_light = SignalsDetection.GO | |
| break | |
| else: | |
| self.traffic_light = SignalsDetection.STOP | |
When it should be compared to the frequencies stored in the protocol:
#changes proposed
if freq_identified == self.freqIdentify[5]:
self.traffic_light = SignalsDetection.GO
else:
self.traffic_light = SignalsDetection.STOPAnd in order to do that when loading the frequencies from the protocol the traffic light ones should be added:
# Get frequency to indentify
self.freqIdentify = [self.protocol['signals']['CAR_SIGNAL_A']['frequency'],
self.protocol['signals']['CAR_SIGNAL_B']['frequency'],
self.protocol['signals']['CAR_SIGNAL_C']['frequency'],
self.protocol['signals']['CAR_SIGNAL_PRIORITY']['frequency'],
self.protocol['signals']['CAR_SIGNAL_SACRIFICE_FOR_PRIORITY']['frequency'],
self.protocol['signals']['traffic_light_go']['frequency'],
self.protocol['signals']['traffic_light_stop']['frequency']]Metadata
Metadata
Assignees
Labels
No labels