本文整理匯總了Python中nengoros.comm.rosutils.RosUtils.setAutorun方法的典型用法代碼示例。如果您正苦於以下問題:Python RosUtils.setAutorun方法的具體用法?Python RosUtils.setAutorun怎麽用?Python RosUtils.setAutorun使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nengoros.comm.rosutils.RosUtils
的用法示例。
在下文中一共展示了RosUtils.setAutorun方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: old
# 需要導入模塊: from nengoros.comm.rosutils import RosUtils [as 別名]
# 或者: from nengoros.comm.rosutils.RosUtils import setAutorun [as 別名]
net=nef.Network('Random Turtle Control Demo')
net.add_to_nengo() # here: delete old (toplevel) network and replace it with the newly CREATED one
# some default imports copied from nef
from ca.nengo.util import VisiblyMutableUtils
import java
import inspect
import warnings
# import my custom classes here:
from nengoros.modules.impl import DefaultNeuralModule as NeuralModule
from nengoros.comm.nodeFactory import NodeGroup as NodeGroup
from nengoros.comm.rosutils import RosUtils as RosUtils
#####################################################################
# setup the ROS utils (optional, takes effect only if ROS found)
RosUtils.setAutorun(True)
RosUtils.prefferJroscore(False)
# define nodes I want to use
turtlesim = "../testnodes/turtlesim/turtlesim_node" # turtle under this project
act = "resender.turtle.Controller";
sense = "resender.turtle.PositionSensor";
# create group for turtle
g = NodeGroup("zelvicka", True); # True menas that group is independent, can be pushed into namespace
g.addNC(turtlesim, "zelva", "native");
g.addNC(act, "actuators", "java");
g.addNC(sense, "sensors", "java");
# create identical group for another turtle
g2 = NodeGroup("zelvicka", True);
示例2: TurnGenerator
# 需要導入模塊: from nengoros.comm.rosutils import RosUtils [as 別名]
# 或者: from nengoros.comm.rosutils.RosUtils import setAutorun [as 別名]
import nef
import time
import random
from ca.nengo.math.impl import FourierFunction
from ca.nengo.model.impl import FunctionInput
from ca.nengo.model import Units
from nengoros.modules.impl.vivae import VivaeNeuralModule as NeuralModule
from nengoros.comm.nodeFactory import NodeGroup as NodeGroup
from nengoros.comm.rosutils import RosUtils as RosUtils
from nengoros.modules.impl.vivae.impl import SimulationControls as Controls
import simplemodule
import util
from vivaeLauncher import oneAgent
RosUtils.setAutorun(False)
# this generates signal which turns the agent left
class TurnGenerator(simplemodule.SimpleModule):
# .......... 9 2 1 [all sensors, two speeds, turning duration]
def init(self,inputdims,outputdims,numpars):
self.inputdims = inputdims;
self.outputdims = outputdims;
self.numpars = numpars;
self.l = 0.1;
self.r = 0.38;
self.duration = 0;
self.maxdur = 30;