當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。