Beispiel #1
0
 def _bindrobot(self):
     self.robotindex = dict()
     self.robot2parking = dict()
     # self.parking2robot = dict()
     for i in self.robotdict.keys():
         robot = Robot(i, self.imports)
         self.robotindex[i] = robot
         self.robot2parking[i] = None
Beispiel #2
0
 def __init__(self):
     self.scene = Scene()
     self.robot = Robot()
     self.obstacles = []
     self.path = Path()
     self.sampler = Sampler(self.LENGTHS)
     self.validator = Validator()
     self.configs = []
     self.path_found = False
     self.super_path = SuperPath()
     self.safety = True
     self.all_paths_found = False
    def __init__(self):
        self.fig = plt.figure()
        self.ax = self.fig.add_subplot(111)
        # self.fig, self.ax = plt.subplots()
        self.robot = Robot()
        self.obstacles = []
        self.goals = []
        self.pucks = []

        self.endPoints = None
        self.elbowPoints = None
        self.pathPoints = None
        self.paths = []

        self.pathColour = 'black'
        self.goalColour = 'cyan'
        self.puckColour = 'gray'
        self.obstacleColour = 'red'
        self.workspaceFeatures = []
        self.workspaceColour = 'green'
        self.armColour = 'black'
Beispiel #4
0
    def getstate(self):
        print("MapSize:{}x{}, Parking Number:{}".format(
            self.Height, self.Width, len(self.parkingdict)))


if __name__ == '__main__':

    from env.robot import Robot

    vision = Vision()
    vision.initwindows()
    vision.initrobot(2)
    vision.setrobot(1, 1)

    path = vision.astar(vision.imports, (0, 12))
    robot = Robot(0, vision.imports)
    robot.setpath(path)

    while not robot.IsArrive:
        step = robot.move()
        if tuple(step) == (0, 0):
            break
        vision.moverobot(1, step)

        vision.updatesim(0.5)

    stop = input('stop Y/n : ')
    if stop == 'y':
        vision.destroy()

    vision.mainloop()