Example #1
0
class Controller(Brain):
   def setup(self):
      self.translate = Slider("Translate", -1, 1)
      # you can swap the pos and neg sides, like this:
      self.rotate = Slider("Rotate", 1, -1)
      # this helps driving, because neg is to the right

   def step(self):
      self.robot.move(self.translate.getValue(), \
                      self.rotate.getValue() ) # to the left

   def destroy(self):
      self.translate.destroy()
      self.rotate.destroy()
Example #2
0
class Controller(Brain):
    def setup(self):
        self.translate = Slider("Translate", -1, 1)
        # you can swap the pos and neg sides, like this:
        self.rotate = Slider("Rotate", 1, -1)
        # this helps driving, because neg is to the right

    def step(self):
        self.robot.move(self.translate.getValue(), \
                        self.rotate.getValue() ) # to the left

    def destroy(self):
        self.translate.destroy()
        self.rotate.destroy()
Example #3
0
 def setup(self):
    self.translate = Slider("Translate", -1, 1)
    # you can swap the pos and neg sides, like this:
    self.rotate = Slider("Rotate", 1, -1)
Example #4
0
 def setup(self):
     self.translate = Slider("Translate", -1, 1)
     # you can swap the pos and neg sides, like this:
     self.rotate = Slider("Rotate", 1, -1)