duckietown / dt-core

This is the code that runs the core stack on the Duckiebot in ROS
Other
1 stars 17 forks source link

Traffic light detection error #37

Open juan11iguel opened 5 years ago

juan11iguel commented 5 years ago

For the traffic light "detected" is used to decide whether it's green or not: https://github.com/duckietown/dt-core/blob/7695a6b71f5e65281101758af387f9bbd4e38c89/packages/led_detection/src/led_detector_node.py#L400-L411

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 commented 5 years ago

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