Exemple #1
0
    def __init__(self, points):
        """

        :return:
        """
        Notifier.__init__(self)

        self.points = points
Exemple #2
0
    def __init__(self, connection=None):
        Notifier.__init__(self)

        # Data connection to robot.
        self.connection = connection

        self.x = 0  # In meters.
        self.y = 0
        self.heading = 1.57

        # List of visited points.
        self.trail = []

        # Physical dimensions in meters.
        self.width = 0.18
        self.length = 0.23

        # State string.
        self.state = ""

        # Size of the cells we are operating in.
        self.cell_size = 0.15
Exemple #3
0
    def __init__(self, robot, grid_size, cell_size, file=None):
        """

        :param robot:
        :param grid_size:
        :param cell_size:
        :return:
        """
        Notifier.__init__(self)

        self.robot = robot                                                  # The robot traversing this map.
        self.grid_size = grid_size                                          # Size in meters down either side.
        self.cell_size = cell_size                                          # Cell size in meters.
        self.grid = []                                                      # Contains a list of columns, treated like a 2D array.
        self.path = Path([])                                                      # Calculated path to follow.
        self.file = file
        self.cells_square = 0

        if self.file is not None:
            self.open()
        else:
            self.cells_square = int(round(self.grid_size / self.cell_size, 0))  # Number of cells down either side of the grid.
            self.goal = Goal(self.cells_square - 2 ,self.cells_square - 2)      # Goal position.
            self.populate_grid()