def __init__(self): # Storing the engines of this car self.__leftengine = Engine('A') self.__rightengine = Engine('B') self.__leftled = Light.Light('D') self.__rightled = Light.Light('C') self.__distance_sensor = DistanceSensor(17, 4) # Storing the distance between the centers of the cars # TODO measure width and gearratio self.__widthcar = 20. self.__gearratio = 1. / 3. # Storing the perimeter of the wheels (2*pi*r) self.__perimeter = 2 * math.pi * 2.579 print 'initing Controller' ControllerCommands.init(self.__leftengine, self.__rightengine, self.__distance_sensor, self.__perimeter, self.__gearratio, self.__widthcar, self.__leftled, self.__rightled) print 'Controller inited' # Storing a reference to a brickpi thread self.__io = IO_Thread([self.__leftengine, self.__rightengine], [self.__distance_sensor], [self.__leftled, self.__rightled]) self.__command_going = False self.__command_thread = None self.__parcours = None
def __init__(self): # Storing the engines of this car self.__leftengine = Engine("A") self.__rightengine = Engine("B") self.__engines = [self.__leftengine, self.__rightengine] # Storing the distance between the centers of the cars self.__widthcar = 2.6 + 11.1 - 0.2 self.__gearratio = 1.0 # Storing the perimeter of the wheels (2*pi*r) self.__perimeter = 2 * math.pi * 2.579 ControllerCommands.init( self.__leftengine, self.__rightengine, self.__perimeter, self.__gearratio, self.__widthcar ) # Storing a reference to a brickpi thread self.__brickpi = BrickPi_Thread(self.__engines) self.__command_going = False self.__command_thread = None self.__parcours = None
def __init__(self): # Storing the engines of this car self.__leftengine = Engine('A') self.__rightengine = Engine('B') self.__engines = [self.__leftengine, self.__rightengine] # Storing the distance between the centers of the cars self.__widthcar = 2.6 + 11.1 - .2 self.__gearratio = 1. # Storing the perimeter of the wheels (2*pi*r) self.__perimeter = 2 * math.pi * 2.579 ControllerCommands.init(self.__leftengine, self.__rightengine, self.__perimeter, self.__gearratio, self.__widthcar) # Storing a reference to a brickpi thread self.__brickpi = BrickPi_Thread(self.__engines) self.__command_going = False self.__command_thread = None self.__parcours = None
def __init__(self): # Storing the engines of this car self.__leftengine = Engine('A') self.__rightengine = Engine('B') self.__distance_sensor = DistanceSensor(17,4) # Storing the distance between the centers of the cars # TODO measure width and gearratio self.__widthcar = 20. self.__gearratio = 1./3. # Storing the perimeter of the wheels (2*pi*r) self.__perimeter = 2*math.pi* 2.579 print 'initing Controller' ControllerCommands.init(self.__leftengine,self.__rightengine,self.__distance_sensor,self.__perimeter,self.__gearratio,self.__widthcar) print 'Controller inited' # Storing a reference to a brickpi thread self.__io = IO_Thread([self.__leftengine,self.__rightengine],[self.__distance_sensor]) self.__command_going = False self.__command_thread = None self.__parcours = None