Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic light detection error #37

Open
juan11iguel opened this issue Nov 30, 2019 · 1 comment
Open

Traffic light detection error #37

juan11iguel opened this issue Nov 30, 2019 · 1 comment

Comments

@juan11iguel
Copy link

For the traffic light "detected" is used to decide whether it's green or not:

# 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.STOP

And 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']]
@AleksandarPetrov
Copy link
Contributor

@surirohit @aquamin9, This might be of interest to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants