test-robot-hardware.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 PKG = 'hrpsys'
4 NAME = 'test_robothardware'
5 
6 from hrpsys import hrpsys_config
7 import OpenHRP
8 
9 import socket
10 import rtm
11 
12 import unittest
13 import rostest
14 import sys
15 
16 class TestHrpsysRobotHardware(unittest.TestCase):
17 
18  def test_rh_service(self):
19  try:
20  rh = rh_svc = None
21  rtm.nshost = 'localhost'
22  rtm.nsport = 2809
24  rh = rtm.findRTC("RobotHardware0")
25  rh_svc = rtm.narrow(rh.service("service0"), "RobotHardwareService")
26  print "RTC(RobotHardware0)={0}, {1}".format(rh,rh_svc)
27  self.assertTrue(rh and rh_svc)
28  rh.start()
29  self.assertTrue(rh.isActive())
30  self.assertTrue(rh_svc.getStatus())
31 
32  except Exception as e:
33  print "{0}, RTC(RobotHardware0)={1}, {2}".format(str(e),rh,rh_svc)
34  self.fail()
35  pass
36 
37 #unittest.main()
38 if __name__ == '__main__':
39  rostest.run(PKG, NAME, TestHrpsysRobotHardware, sys.argv)
def findRTC(name, rnc=None)
get RT component
Definition: jython/rtm.py:341
def narrow(ior, klass, package="OpenHRP")
narrow ior
Definition: jython/rtm.py:709
def initCORBA()
initialize ORB
Definition: jython/rtm.py:272


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:51