sample.py
Go to the documentation of this file.
00001 hostname='hiro014' # you need to add this host/ip information to /etc/hosts
00002 
00003 from java.lang import System
00004 System.setProperty('NS_OPT', '-ORBInitRef NameService=corbaloc:iiop:'+hostname+':2809/NameService')
00005 
00006 import rtm
00007 from rtm import *
00008 from OpenHRP import *
00009 
00010 def createComps():
00011     global seq, seq_svc
00012 
00013     ms.load("SequencePlayer")
00014     print ms
00015     seq = findRTC("seq")
00016     print seq
00017     seq_svc = SequencePlayerServiceHelper.narrow(seq.service("service0"))
00018     print ms,seq,seq_svc
00019     print dir(seq_svc)
00020 
00021 def init():
00022     global ms, hostname
00023 
00024     ms = rtm.findRTCmanager(hostname=hostname)
00025 
00026     print "creating components"
00027     createComps()
00028     print "initialized successfully"
00029 
00030 def playPattern(tm=10.0):
00031     seq_svc.playPattern([[0,    0,    0,
00032                          -0.0,  0, -1.75,  0.26,  0.16,  0.5,
00033                           0.0,  0, -1.75, -0.26,  0.16, -0.5]], [], [], [tm])
00034     seq_svc.playPattern([[0,    0,    0,
00035                          -0.0,  0, -1.95,  0.26,  0.16,  0.5,
00036                           0.0,  0, -1.75, -0.26,  0.16, -0.5],
00037                          [0,    0,    0,
00038                          -0.0,  0, -1.75,  0.26,  0.16,  0.5,
00039                           0.0,  0, -1.75, -0.26,  0.16, -0.5],
00040                          ], [], [], [2,4])
00041     seq_svc.waitInterpolation()
00042 
00043 init()
00044 playPattern()
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


hironx_ros_bridge
Author(s): k-okada
autogenerated on Thu Jun 27 2013 14:58:35