Exemplo n.º 1
0
 def init_random (self):
     self.data = class_param_t ()
     self.left_img = self.init_image_from_file ('left_img_sample.png')
     self.right_img = self.init_image_from_file ('right_img_sample.png')
     self.data.utime = 0
     self.data.mode = 0
     self.data.orientation = [0.2, 1.]
     self.data.progress = .64
     self.data.translation_speed = 1.2
     self.data.rotation_speed = 0.3
     self.data.nodeid_now = 25
     self.data.nodeid_next = 26
     self.data.nodeid_end = 129
     self.data.path_size = 10
     self.data.path = [25, 26, 27, 123, 124, 125, 126, 127, 128, 129]
     self.data.confidence = .78
     self.data.eta_secs = 70
     self.data.eta_meters = 95
     self.data.psi_distance = 0
     self.data.psi_distance_thresh = 0
     self.data.map_filename = "2009-08-31.00.map"
     self.data.pdf_size = 0
     self.data.pdfind = None
     self.data.pdfval = None
     self.data.next_direction = class_param_t.MOTION_TYPE_RIGHT
     self.data.next_direction_meters = 20
     self.data.mission_success = 0
     self.data.wrong_way = 0
     self.future_direction[0] = class_param_t.MOTION_TYPE_RIGHT
     self.future_direction[1] = class_param_t.MOTION_TYPE_FORWARD
     self.future_direction[2] = class_param_t.MOTION_TYPE_UP
Exemplo n.º 2
0
 def init_random(self):
     self.data = class_param_t()
     self.left_img = self.init_image_from_file('left_img_sample.png')
     self.right_img = self.init_image_from_file('right_img_sample.png')
     self.data.utime = 0
     self.data.mode = 0
     self.data.orientation = [0.2, 1.]
     self.data.progress = .64
     self.data.translation_speed = 1.2
     self.data.rotation_speed = 0.3
     self.data.nodeid_now = 25
     self.data.nodeid_next = 26
     self.data.nodeid_end = 129
     self.data.path_size = 10
     self.data.path = [25, 26, 27, 123, 124, 125, 126, 127, 128, 129]
     self.data.confidence = .78
     self.data.eta_secs = 70
     self.data.eta_meters = 95
     self.data.psi_distance = 0
     self.data.psi_distance_thresh = 0
     self.data.map_filename = "2009-08-31.00.map"
     self.data.pdf_size = 0
     self.data.pdfind = None
     self.data.pdfval = None
     self.data.next_direction = class_param_t.MOTION_TYPE_RIGHT
     self.data.next_direction_meters = 20
     self.data.mission_success = 0
     self.data.wrong_way = 0
     self.future_direction[0] = class_param_t.MOTION_TYPE_RIGHT
     self.future_direction[1] = class_param_t.MOTION_TYPE_FORWARD
     self.future_direction[2] = class_param_t.MOTION_TYPE_UP
Exemplo n.º 3
0
    def init_random(self):
        random.seed()
        n_nodes = 10
        self.data = ui_map_t()
        self.data.n_nodes = 0
        self.data.nodes = []
        self.data.n_edges = 0
        self.data.edges = []

        for i in range(0, n_nodes):
            nd = ui_map_node_t()
            nd.x = random.random()
            nd.y = random.random()
            nd.label = "node %d" % i
            nd.id = i

            self.data.nodes.append(nd)
            self.data.n_nodes += 1

        for i in range(0, n_nodes - 1):
            ed = ui_map_edge_t()
            ed.motion_type = int(random.random() * 5) - 1
            ed.id1 = i
            ed.id2 = i + 1

            self.data.edges.append(ed)
            self.data.n_edges += 1

        self.class_param = class_param_t()
        self.class_param.nodeid_now = n_nodes / 5
        self.class_param.nodeid_end = 4 * n_nodes / 5

        self.update_hash()

        self.path = []
        for i in range(self.class_param.nodeid_now,
                       self.class_param.nodeid_end + 1):
            self.path.append(i)
Exemplo n.º 4
0
    def init_random (self):
        random.seed ()
        n_nodes = 10
        self.data = ui_map_t ()
        self.data.n_nodes = 0
        self.data.nodes = []
        self.data.n_edges = 0
        self.data.edges = []

        for i in range(0,n_nodes):
            nd = ui_map_node_t ()
            nd.x = random.random ()
            nd.y = random.random ()
            nd.label = "node %d" % i
            nd.id = i
            
            self.data.nodes.append (nd)
            self.data.n_nodes += 1

        for i in range (0, n_nodes-1):
            ed = ui_map_edge_t ()
            ed.motion_type = int (random.random()*5)-1
            ed.id1 = i
            ed.id2 = i+1

            self.data.edges.append (ed)
            self.data.n_edges += 1

        self.class_param = class_param_t ()
        self.class_param.nodeid_now = n_nodes/5
        self.class_param.nodeid_end = 4*n_nodes/5

        self.update_hash ()

        self.path = []
        for i in range (self.class_param.nodeid_now, self.class_param.nodeid_end+1):
            self.path.append (i)