当前位置: 首页>>代码示例>>Python>>正文


Python RosUtils.prefferJroscore方法代码示例

本文整理汇总了Python中nengoros.comm.rosutils.RosUtils.prefferJroscore方法的典型用法代码示例。如果您正苦于以下问题:Python RosUtils.prefferJroscore方法的具体用法?Python RosUtils.prefferJroscore怎么用?Python RosUtils.prefferJroscore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nengoros.comm.rosutils.RosUtils的用法示例。


在下文中一共展示了RosUtils.prefferJroscore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: old

# 需要导入模块: from nengoros.comm.rosutils import RosUtils [as 别名]
# 或者: from nengoros.comm.rosutils.RosUtils import prefferJroscore [as 别名]
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);
g2.addNC(turtlesim, "zelva", "native");  
开发者ID:jvitku,项目名称:nengo_1.4,代码行数:33,代码来源:twoTurtles.py

示例2: nengo

# 需要导入模块: from nengoros.comm.rosutils import RosUtils [as 别名]
# 或者: from nengoros.comm.rosutils.RosUtils import prefferJroscore [as 别名]
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
#from vivae.ros import Simulator as Simulator

# creates nef network and adds it to nengo (this must be first in the script) 
net=nef.Network('Vivae tests')
net.add_to_nengo()  # here: delete old (toplevel) network and replace it with the newly CREATED one

################################## 
################# setup the ROS utils (optional) 
#RosUtils.setAutorun(False)     # Do we want to autorun roscore and rxgraph? (tru by default)
RosUtils.prefferJroscore(False) # Turlte prefers roscore before jroscore (don't know why..) 

################################## 
################# define the group and start it
modem  = "nengoros.comm.nodeFactory.modem.impl.DefaultModem"; # custom modem here
# this is launch command which calls the RosRun with name of ControlsServer as parameter
#vvv = ["./sb/../../../../simulators/vivae/build/install/vivae/bin/vivae","vivae.ros.simulatorControlsServer.ControlsServer"]


vvv = "vivae.ros.simulatorControlsServer.ControlsServer"         # actual Vivae simulator, provies services

# create group of nodes
g = NodeGroup("vivae", True);               # create default group of nodes
g.addNC(vvv, "vivaeSimulator", "java");   # run the simulator..
g.addNC(modem,"modem","modem")              # add default modem..
g.startGroup()                              # start group normally
开发者ID:jvitku,项目名称:nengo_1.4,代码行数:33,代码来源:09vivae_reset.py


注:本文中的nengoros.comm.rosutils.RosUtils.prefferJroscore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。