本文整理汇总了Python中ctu.nengoros.comm.nodeFactory.NodeGroup.startGroup方法的典型用法代码示例。如果您正苦于以下问题:Python NodeGroup.startGroup方法的具体用法?Python NodeGroup.startGroup怎么用?Python NodeGroup.startGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctu.nengoros.comm.nodeFactory.NodeGroup
的用法示例。
在下文中一共展示了NodeGroup.startGroup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initVivae
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def initVivae(numsensors):
modem = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem";
server = "vivae.ros.simulator.server.SimulatorServer" # start the simulator server in own thread
# Or it is possible to call the Vivae as a standalone application in the similar way:
#server = ["./sb/../../../../simulators/vivae/build/install/vivae/bin/vivae","vivae.ros.simulatorControlsServer.ControlsServer"]
# create group of nodes
g = NodeGroup("vivae", True); # create default group of nodes
g.addNode(server, "SimulatorServer", "java"); # run the simulator..
g.addNode(modem,"modem","modem") # add default modem..
g.startGroup() # start group normally
#time.sleep(3) # if the process is native, it takes longer time to init the services !! TODO
simulator = NeuralModule('VivaeSimulator', g) # create NeuralModule which is able to add/remove agents
sc = simulator.getControls(); # this starts the control services..
sc.callSetVisibility(True); # make simulation window visible..
many=net.add(simulator) # add it to the Nengo network
sc.callLoadMap('data/scenarios/test/walls.svg')
#addAgent(name,numSensors, maxDistance, frictionSensor)
sc.addAgent('a',2*numsensors, 120 ,0)
sc.callStartSimulation()
return simulator;
示例2: initVivae
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def initVivae(numsensors):
modem = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem"; # custom modem here
server = "vivae.ros.simulatorControlsServer.ControlsServer" # call Vivae as a thread in Java from this process
# Call Vivae as an external process
#server = ["./sb/../../../../simulators/vivae/build/install/vivae/bin/vivae","vivae.ros.simulatorControlsServer.ControlsServer"]
# create group of nodes
g = NodeGroup("vivae", True); # create default group of nodes
g.addNode(server, "vivaeSimulator", "java"); # run the simulator..
g.addNode(modem,"modem","modem") # add default modem..
g.startGroup() # start group normally
#time.sleep(3) # if the process is native, it takes longer time to init the services !!
simulator = NeuralModule('VivaeSimulator', g) # create NeuralModule which is able to add/remove agents
vivae = simulator.getControls(); # this starts the control services..
vivae.setVisible(True); # make simulation window visible..
many=net.add(simulator) # add it to the Nengo network
vivae.loadMap('data/scenarios/test/walls.svg')
#addAgent(name,numSensors, maxDistance, frictionSensor)
vivae.addAgent('a',2*numsensors, 120 ,0)
vivae.start()
return simulator;
示例3: make
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def make(net,name='Vivae Simulator', mapName='arena1.svg', numSensors=4,maxdist=30,frictdist=50,independent=True, useQuick=True):
numSensors = numSensors*2
mn = 'data/scenarios/'+mapName
# note that simulator is started externally, since SVG loaded in vivae hanged otherwise from unknown reason..
modem = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem"; # custom modem here
server = "vivae.ros.simulatorControlsServer.ControlsServer" # call Vivae as a thread in Java from this process
vv = ["./sb/../../../../simulators/vivae/build/install/vivae/bin/vivae","vivae.ros.simulatorControlsServer.ControlsServer"]
vvj = ["vivae.ros.simulatorControlsServer.ControlsServer"]
# create group of nodes
g = NodeGroup("vivae", True); # if nameSpace not defined, create independent group
#g.addNode(server,"vivaeSimulator", "java"); # run the simulator..
#g.addNode(vv, "vivaeSimulator", "native"); # run the simulator..
g.addNode(vvj, "vivaeSimulator", "java"); # run the simulator..
g.addNode(modem,"modem","modem") # add default modem..
g.startGroup() # start group normally
#modem = g.getModem()
#time.sleep(3) # if the process is native, it takes longer time to init the services !!
simulator = NeuralModule('VivaeSimulator',g) # create NeuralModule which is able to add/remove agents
vivae = simulator.getControls(); # this starts the control services..
vivae.setVisible(True); # make simulation window visible..
many=net.add(simulator) # add it to the Nengo network
"""
vivae.loadMap('data/scenarios/test/walls.svg')
#addAgent(name,numSensors, maxDistance, frictionSensor)
vivae.addAgent('a',2*numsensors, 120 ,0)
vivae.start()
"""
print 'loaigin'
vivae.loadMap(mn)
agentNames = ['a','b','c','d','e','f','g','h','i','j','k','l','m']
# run as many agents as map can hold (up to a-m)
for i in range(0, len(agentNames)):
vivae.addAgent(agentNames[i], numSensors, maxdist, frictdist)
print 'starting'
vivae.start()
"""
vivae.loadMap(mn)
agentNames = ['a','b','c','d','e','f','g','h','i','j','k','l','m']
# run as many agents as map can hold (up to a-m)
for i in range(0, len(agentNames)):
Controls.addAgent(agentNames[i], numSensors, maxdist, frictdist)
"""
# vivae.start()
print 'Vivae is ready.'
示例4: init
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def init(net, mapName=Sim.Maps.DEFAULT, visible=False):
# create group of nodes
g = NodeGroup("vivae", True); # create default group of nodes
g.addNode(server, "SimulatorServer", "java"); # run the simulator..
g.addNode(modem,"modem","modem") # add default modem..
g.startGroup() # start group normally
simulator = NeuralModule('VivaeSimulator',g) # create NeuralModule which is able to add/remove agents
vivae = simulator.getControls(); # this starts the control services..
vivae.callSetVisibility(visible); # make simulation window visible..
result=net.add(simulator) # add it to the Nengo network
vivae.callLoadMap(mapName) # loads the map into the simulator and waits for start or agents
return simulator;
示例5: initVivae
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def initVivae(numsensors, visible=False):
modem = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem";
server = "vivae.ros.simulator.server.SimulatorServer" # start the simulator server in own thread
# create group of nodes
g = NodeGroup("vivae", True); # create default group of nodes
g.addNode(server, "SimulatorServer", "java"); # run the simulator..
g.addNode(modem,"modem","modem") # add default modem..
g.startGroup() # start group normally
simulator = NeuralModule('VivaeSimulator',g) # create NeuralModule which is able to add/remove agents
vivae = simulator.getControls(); # this starts the control services..
vivae.callSetVisibility(visible); # make simulation window visible..
many=net.add(simulator) # add it to the Nengo network
vivae.callLoadMap('data/scenarios/test/wallsII.svg')
#addAgent(name,numSensors, maxDistance, frictionSensor) (note that you will actually get numSensors+1 floats +(speed))
vivae.addAgent('a',2*numsensors, 120 ,0)
vivae.callStartSimulation()
return simulator;