本文整理汇总了Python中OpenRTM_aist.toTypename方法的典型用法代码示例。如果您正苦于以下问题:Python OpenRTM_aist.toTypename方法的具体用法?Python OpenRTM_aist.toTypename怎么用?Python OpenRTM_aist.toTypename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenRTM_aist
的用法示例。
在下文中一共展示了OpenRTM_aist.toTypename方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_addRemoveSdoServiceConsumer
# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import toTypename [as 别名]
def test_addRemoveSdoServiceConsumer(self):
import MySdoServiceConsumer
OpenRTM_aist.Manager.instance().load("MySdoServiceConsumer.py",
"MySdoServiceConsumerInit")
rtobj = TestComp(self._orb, self._poa)
prof = SDOPackage.ServiceProfile(OpenRTM_aist.toTypename(OpenRTM.ComponentObserver),OpenRTM_aist.toTypename(OpenRTM.ComponentObserver),
[OpenRTM_aist.NVUtil.newNV("test","any")],
SDOPackage.SDOService._nil)
self.assertEqual(rtobj.addSdoServiceConsumer(prof),True)
self.assertEqual(rtobj.removeSdoServiceConsumer(OpenRTM_aist.toTypename(OpenRTM.ComponentObserver)),True)
return
示例2: main
# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import toTypename [as 别名]
def main():
orb = CORBA.ORB_init(sys.argv)
poa = orb.resolve_initial_references("RootPOA")
poa._get_the_POAManager().activate()
naming = OpenRTM_aist.CorbaNaming(orb, "localhost")
servant = ComponentObserver_i()
oid = poa.servant_to_id(servant)
provider = poa.id_to_reference(oid)
rtc = naming.resolve("ConsoleIn0.rtc")._narrow(RTC.RTObject)
config = rtc.get_configuration()
properties = [OpenRTM_aist.NVUtil.newNV("heartbeat.enable","YES"),
OpenRTM_aist.NVUtil.newNV("heartbeat.interval","10"),
OpenRTM_aist.NVUtil.newNV("observed_status","ALL")]
id = OpenRTM_aist.toTypename(servant)
sprof = SDOPackage.ServiceProfile("test_id", id,
properties, provider)
ret = config.add_service_profile(sprof)
flag = True
print "If you exit program, please input 'q'."
sys.stdin.readline()
ret = config.remove_service_profile("test_id")
print "test program end. ret : ", ret
return
示例3: __init__
# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import toTypename [as 别名]
def __init__(self, name, value, buffer=None,
read_block=False, write_block=False,
read_timeout=0, write_timeout = 0):
OpenRTM_aist.InPortBase.__init__(self, name, OpenRTM_aist.toTypename(value))
self._name = name
self._value = value
self._OnRead = None
self._OnReadConvert = None
示例4: __init__
# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import toTypename [as 别名]
def __init__(self, name, value, buffer=None):
OpenRTM_aist.OutPortBase.__init__(self, name, OpenRTM_aist.toTypename(value))
self._value = value
#self._timeoutTick = 1000 # timeout tick: 1ms
#self._writeBlock = False
#self._writeTimeout = 0
self._OnWrite = None
self._OnWriteConvert = None
示例5: setUp
# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import toTypename [as 别名]
def setUp(self):
#mgr=OpenRTM_aist.Manager.instance()
self._orb = CORBA.ORB_init(sys.argv)
self._poa = self._orb.resolve_initial_references("RootPOA")
self._poa._get_the_POAManager().activate()
self._inport = InPortMock("in", OpenRTM_aist.toTypename(RTC.TimedLong(RTC.Time(0,0), 0)))
self._outport = OpenRTM_aist.OutPort("out",RTC.TimedLong(RTC.Time(0,0), 0))
profile = self._outport.getPortProfile()
prop = OpenRTM_aist.NVUtil.toProperties(profile.properties)
self._outport.init(prop)
self._nvlist = [OpenRTM_aist.NVUtil.newNV("dataport.interface_type","corba_cdr"),
OpenRTM_aist.NVUtil.newNV("dataport.dataflow_type","push"),
OpenRTM_aist.NVUtil.newNV("dataport.subscription_type","flush")]
import time
time.sleep(0.05)
return
示例6: main
# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import toTypename [as 别名]
def main():
orb = CORBA.ORB_init(sys.argv)
poa = orb.resolve_initial_references("RootPOA")
poa._get_the_POAManager().activate()
servant = testService_i()
oid = poa.servant_to_id(servant)
provider = poa.id_to_reference(oid)
compname = "corbaname::localhost:2809/NameService#TestComp0.rtc"
robj = orb.string_to_object(compname)
rtc = robj._narrow(RTC.RTObject)
config = rtc.get_configuration()
properties = []
id = OpenRTM_aist.toTypename(servant)
sprof = SDOPackage.ServiceProfile("test_id", id,
properties, provider)
ret = config.add_service_profile(sprof)
sys.stdin.readline()
ret = config.remove_service_profile("test_id")
示例7: MySdoServiceConsumerInit
# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import toTypename [as 别名]
def MySdoServiceConsumerInit(manager):
factory = OpenRTM_aist.SdoServiceConsumerFactory.instance()
factory.addFactory(OpenRTM_aist.toTypename(OpenRTM.ComponentObserver), MySdoServiceConsumer, OpenRTM_aist.Delete)
return