Skip to content

Traffic light detection error #37

@juan11iguel

Description

@juan11iguel

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']]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions