#FORMAT python # Multiple brains in a single program. from pyrobot.engine import Engine import time # Parameters for starting an engine: robotfile1 = "Player6665" brainfile1 = "ChaseRedProgram" simulator1 = "StageSimulator" brainargs1 = [] worldfile1 = "chase.cfg" devices1 = [] robotfile2 = "Player6666" brainfile2 = "ChaseGreenProgram" simulator2 = None brainargs2 = [] worldfile2 = "" devices2 = [] # Create the engines: eng1 = Engine(robotfile1, brainfile1, simulator1, brainargs1, {}, worldfile1, devices1) eng2 = Engine(robotfile2, brainfile2, simulator2, brainargs2, {}, worldfile2, devices2) # Wait for them to get initialized: # (this may not be needed with Pyro4) time.sleep(3) # Start them up: eng1.pleaseRun() eng2.pleaseRun() # Let them run for awhile: time.sleep(20) # stop them , and quit: eng1.pleaseStop() eng2.pleaseStop() eng1.shutdown() eng2.shutdown()