def updateParams(self, _event):
        old_verbose = self.verbose
        self.verbose = rospy.get_param('~verbose', True)
        #self.loginfo('verbose = %r' % self.verbose)
        #if self.verbose != old_verbose:
        #self.loginfo('Verbose is now %r' % self.verbose)

        self.image_size = rospy.get_param('~img_size')
        self.top_cutoff = rospy.get_param('~top_cutoff')
        #self.loginfo('verbose = %d' % self.top_cutoff)

        if self.detector is None:
            c = rospy.get_param('~detector')
            assert isinstance(c, list) and len(c) == 2, c

            self.loginfo('new detector config: %s' % str(c))

            self.detector = instantiate(c[0], c[1])

        if self.detector3 is None:
            c = rospy.get_param('~detector')
            assert isinstance(c, list) and len(c) == 2, c

            self.loginfo('new detector3 config: %s' % str(c))

            self.detector3 = instantiate(c[0], c[1])

        if self.verbose and self.pub_edge is None:
            self.pub_edge = rospy.Publisher("~parkingedge",
                                            Image,
                                            queue_size=1)
            self.pub_colorSegment = rospy.Publisher("~parkingcolorSegment",
                                                    Image,
                                                    queue_size=1)
    def updateParams(self, event):
        if self.filter is None:
            c = rospy.get_param('~filter')
            assert isinstance(c, list) and len(c) == 2, c

            self.loginfo('new filter config: %s' % str(c))
            self.filter = instantiate(c[0], c[1])
    def updateParams(self, _event):
        old_verbose = self.verbose
        self.verbose = rospy.get_param('~verbose', True)
        # self.loginfo('verbose = %r' % self.verbose)
        if self.verbose != old_verbose:
            self.loginfo('Verbose is now %r' % self.verbose)

        self.image_size = rospy.get_param('~img_size')
        self.top_cutoff = rospy.get_param('~top_cutoff')

        if self.detector is None:
            c = rospy.get_param('~detector')
            assert isinstance(c, list) and len(c) == 2, c

#         if str(self.detector_config) != str(c):
            self.loginfo('new detector config: %s' % str(c))


            self.detector = LineDetectorHSV(c[1]['configuration'])#instantiate(c[0], c[1])
#             self.detector_config = c
            self.detector_used = self.detector

        if self.detector_intersection is None:
            c = rospy.get_param('~detector_intersection')
            assert isinstance(c, list) and len(c) == 2, c

#         if str(self.detector_config) != str(c):
            self.loginfo('new detector_intersection config: %s' % str(c))

            self.detector_intersection = instantiate(c[0], c[1])
#             self.detector_config = c

        if self.verbose and self.pub_edge is None:
            self.pub_edge = rospy.Publisher("~edge", Image, queue_size=1)
            self.pub_colorSegment = rospy.Publisher("~colorSegment", Image, queue_size=1)
Пример #4
0
def parse_reg_test():
    x = yaml_load(s)
    if isinstance(x['description'], unicode):
        msg = 'I do not expect Unicode'
        msg += '\n' + x.__repr__()
        raise ValueError(msg)
    _ = instantiate(x['constructor'], x['parameters'])
Пример #5
0
    def updateParams(self, event):
        if self.filter is None:
            c = rospy.get_param('~filter')
            assert isinstance(c, list) and len(c) == 2, c

            self.loginfo('new filter config: %s' % str(c))
            self.filter = instantiate(c[0], c[1])

#        old_matrix_delta_d = self.matrix_delta_d
#        old_matrix_delta_phi = self.matrix_delta_phi
        old_matrix_mesh_size = self.matrix_mesh_size

        #updating lane_offset
        self.lane_offset = rospy.get_param('~lane_offset', True)

        #updating matrix parameter delta_d and delta_phi
        self.matrix_mesh_size = rospy.get_param('~matrix_mesh_size', True)
#        self.matrix_delta_d = rospy.get_param('~matrix_delta_d', True)
#        self.matrix_delta_phi = rospy.get_param('~matrix_delta_phi', True)
        # self.loginfo('verbose = %r' % self.verbose)

        #changing the size of belief and masurement likelihood matrix
 #       if self.matrix_delta_d != old_matrix_delta_d or self.matrix_delta_phi != old_matrix_delta_phi:
 #           self.filter.update_matrix(self.matrix_delta_d, self.matrix_delta_phi)
 #           self.loginfo('matrix_delta_d %r' % self.matrix_delta_d)

        #changing the size of belief and masurement likelihood matrix
        if self.matrix_mesh_size != old_matrix_mesh_size:
            self.filter.update_matrix(self.matrix_mesh_size)
            self.loginfo('matrix_mesh_size %r' % self.matrix_mesh_size)
Пример #6
0
def parse_reg_fail():
    x = yaml_load(s_fail)
    print x.__repr__()
    try:
        _ = instantiate(x['constructor'], x['parameters'])
    except RTParseError:
        pass
    else:
        raise Exception('Expected failure')
    def updateParams(self,s):

        self.image_size = rospy.get_param('~img_size')
        self.top_cutoff = rospy.get_param('~top_cutoff')
        print("img_size", self.image_size[0], self.image_size[1],"cut_off",self.top_cutoff )
        #self.loginfo('top_cutoff = %d' % self.top_cutoff)

        if self.detector is None:
            c = rospy.get_param('~detector')
            assert isinstance(c, list) and len(c) == 2, c

            self.loginfo('new detector config: %s' % str(c))
            self.detector = instantiate(c[0], c[1])

        if self.detector2 is None:
            c2 = rospy.get_param('~detector2')
            assert isinstance(c2, list) and len(c2) == 2, c2

            self.loginfo('new detector2 config: %s' % str(c2))
            self.detector2 = instantiate(c2[0], c2[1])
Пример #8
0
    def updateParams(self, _event):
        old_verbose = self.verbose
        self.verbose = rospy.get_param('~verbose', True)
        # self.loginfo('verbose = %r' % self.verbose)
        if self.verbose != old_verbose:
            self.loginfo('Verbose is now %r' % self.verbose)

        self.image_size = rospy.get_param('~img_size')
        self.top_cutoff = rospy.get_param('~top_cutoff')

        if self.detector is None:
            c = rospy.get_param('~detector')
            assert isinstance(c, list) and len(c) == 2, c
        
#         if str(self.detector_config) != str(c):
            self.loginfo('new detector config: %s' % str(c))

            self.detector = instantiate(c[0], c[1])
Пример #9
0
 def LineDetectorClass():
     return instantiate(detector[0], detector[1])
Пример #10
0
 def LineDetectorClass():
     return instantiate(detector[0], detector[1])