HRP4C.py
Go to the documentation of this file.
00001 import rtm
00002 
00003 from rtm import *
00004 from OpenHRP import *
00005 
00006 def connectComps():
00007     connectPorts(bridge.port("q"), seq.port("qInit"))
00008     #
00009     connectPorts(seq.port("qRef"), hgc.port("qIn"))
00010     #
00011 
00012 def activateComps():
00013     rtm.serializeComponents([bridge, seq])
00014     seq.start()
00015 
00016 def createComps():
00017     global bridge, seq, seq_svc, hgc
00018 
00019     bridge = findRTC("HRP4C(Robot)0")
00020 
00021     ms.load("SequencePlayer")
00022     seq = ms.create("SequencePlayer", "seq")
00023     seq_svc = narrow(seq.service("service0"),"SequencePlayerService")
00024 
00025     hgc = findRTC("HGcontroller0")
00026 
00027 def init():
00028     global ms
00029 
00030     ms = rtm.findRTCmanager()
00031 
00032     print "creating components"
00033     createComps()
00034       
00035     print "connecting components"
00036     connectComps()
00037 
00038     print "activating components"
00039     activateComps()
00040     print "initialized successfully"
00041 
00042 def loadPattern(basename, tm=1.0):
00043     seq_svc.loadPattern(basename, tm)
00044     seq_svc.waitInterpolation()
00045 
00046 if __name__ == '__main__':
00047     initCORBA()
00048     init()
00049     loadPattern("data/walk2m")
00050 


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Wed May 15 2019 05:02:18