コード例 #1
0
    def __init__(self, robotPoints, geom=None):
        self.windowHeight = 220
        self.windowWidth = 350
        self.robotScale = 100
        self.robotPos = (self.windowWidth/2.0, self.windowHeight*5.0/6.0)
        def mapPoints(coordinates):
            (x,y) = coordinates
            return (x*self.robotScale + self.robotPos[0],
                    -y*self.robotScale + self.robotPos[1])
        self.points = list(map(mapPoints, robotPoints))
#        self.robotPose = Pose(self.windowWidth/2.0, self.windowWidth/2.0,
#                              math.pi)
        self.robotPose = Pose(0.0, 0.0, -math.pi/2.0)
        self.maxReading = 1.5
        self.window = None
        # just pay attention to the position part (not the size, since
        # the canvas is a fixed size)
        self.geom = None
        if geom:
            self.geom = geom[geom.find('+'):]
コード例 #2
0
    def __init__(self, robotPoints, geom=None):
        self.windowHeight = 350  # 220
        self.windowWidth = 450  # 350
        self.robotScale = 200  #Changed from 100 for Amigobot
        self.robotPos = (self.windowWidth / 2.0, self.windowHeight * 3.0 / 6.0)

        def mapPoints((x, y)):
            return (x * self.robotScale + self.robotPos[0],
                    -y * self.robotScale + self.robotPos[1])

        self.points = map(mapPoints, robotPoints)
        #        self.robotPose = Pose(self.windowWidth/2.0, self.windowWidth/2.0,
        #                              math.pi)
        self.robotPose = Pose(0.0, 0.0, -math.pi / 2.0)
        self.maxReading = 1.5
        self.window = None
        # just pay attention to the position part (not the size, since
        # the canvas is a fixed size)
        self.geom = None
        if geom:
            self.geom = geom[geom.find('+'):]