Пример #1
0
 def transition(self):
     """
     Resample around current point, taking into account whatever we know about the robot's capacity for movement.
     """
     self.x, self.y = robot.new_robot_coordinates(self.x, self.y)
     #self.x, self.y = robot.undirected_new_robot_coordinates(self.x, self.y)
     return
Пример #2
0
    def generate_coordinates(self, count):
        """Generate beacon coordinates based on random movement of robot."""
        coordinates = []

        actual_x = random.normalvariate(0, 1)
        actual_y = random.normalvariate(0, 1)

        x = y = 0.0
        for i in range(count):
            # move the robot and generate new beacon readings with random
            # offsets from actual robot coordinates (to simulate noise)
            beacon_x, beacon_y = robot.beacon_readings(actual_x, actual_y)
            coordinates.append([actual_x, actual_y, beacon_x, beacon_y])
            actual_x, actual_y = robot.new_robot_coordinates(actual_x, actual_y)

        return coordinates