Exemplo n.º 1
0
    def __init__(self, parent):
        self._init_ctrls(parent)
        psyco.full()
        self.laserscanner = HokuyoLaserScanner()
        self.localisation = Localisation(400)
        self.naofinder = NAOFinder(self.localisation)
        self.network = Network()

        ## control variables
        self.control = numpy.zeros(3)
        # automatic
        self.state = 'init'  # states: init, chase, position, lost
        self.statecount = 0
        self.targetnumber = 0
        #self.targets = [[250, -100], [250, 100], [50, 100], [50, -100]]
        #self.targets = [[275, -10], [275, 10], [50, 10], [50, -10]]
        self.targets = [[275, 0], [50, 0]]

        # manual
        self.up = False  # set these to true when the key is pressed!
        self.down = False
        self.left = False
        self.right = False

        self.distance = 0
        self.bearing = 0
        self.orientation = 0

        self.CartesianPanel.setNaoFinder(self.naofinder)
        self.NaoPanel.setNaoFinder(self.naofinder)
        self.NaoPanel.setLocalisation(self.localisation)
        self.closed = False