def __init__(self): Detector.__init__(self) rospy.Subscriber('/vehicle/traffic_lights', TrafficLightArray, self.traffic_cb, queue_size=1) self.tl_map = {} self.tl_map_filled = False self.classifier_initialized = True
def __init__(self): Detector.__init__(self) #----------------------------------------------------------------------- # Subscribe to the image feed and initialize other stuff #----------------------------------------------------------------------- self.listener = tf.TransformListener() self.field_of_view = math.pi / 4 self.state_count = 0 self.state = Classifier.UNKNOWN self.bridge = CvBridge() self.classifier_initialized = False self.classifier_broken = False self.classifier = None rospy.Subscriber('/image_color', Image, self.image_cb, queue_size=1)
def __init__(self): Detector.__init__(self) self.bridge = CvBridge() self.light_classifier = TLClassifier() self.state = TrafficLight.UNKNOWN self.state_count = 0 self.dbw_enabled = False # the number of waypoints car brake but over the stopline self.brake_buffer = rospy.get_param('~brake_buffer', 5) rospy.Subscriber('/image_color', Image, self.image_cb, queue_size=1, buff_size=5760000) # subscribe the dbw_enabled to check car's position and orientation and set correct direction rospy.Subscriber('/vehicle/dbw_enabled', Bool, self.dbw_enabled_cb) self.upcoming_red_light_pub.publish(-1) rospy.spin()
def __init__(self): Detector.__init__(self) #----------------------------------------------------------------------- # Create the classifier and download the models #----------------------------------------------------------------------- self.classifier = Classifier(rospkg.get_ros_home()) if self.classifier.need_models(): rospy.logwarn('Need to download models, it may take a while.') self.classifier.download_models() rospy.logwarn('Finished downloading!') self.classifier.initialize() rospy.logwarn('Classifier initialized!') #----------------------------------------------------------------------- # Subscribe to the image feed and initialize other stuff #----------------------------------------------------------------------- rospy.Subscriber('/image_color', Image, self.image_cb, queue_size=1) self.listener = tf.TransformListener() self.field_of_view = math.pi / 4 self.state_count = 0 self.state = Classifier.UNKNOWN self.bridge = CvBridge()
def __init__(self): Detector.__init__(self) rospy.Subscriber('/vehicle/traffic_lights', TrafficLightArray, self.traffic_cb) self.upcoming_red_light_pub.publish(self.last_wp) rospy.spin()
def __init__(self): Detector.__init__(self) self.videoReader = VideoReader() self.detectedObjects = []