SimpleIO/run.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # -*- Python -*-
4 
5 #
6 # @file run.py
7 # @brief ExtTrigger example startup script
8 # @date $Date: 2007/10/26 $
9 #
10 # Copyright (c) 2003-2007 Noriaki Ando <n-ando@aist.go.jp> and Shinji Kurihara
11 # Task-intelligence Research Group,
12 # Intelligent System Research Institute,
13 # National Institute of Industrial Science (AIST), Japan
14 # All rights reserved.
15 #
16 
17 import sys,os,platform
18 import time
19 import commands
20 
21 nsport="2809"
22 sysinfo = platform.uname()
23 hostname= sysinfo[1]
24 plat=sys.platform
25 
26 def main():
27  if plat == "win32":
28  os.system("start python ..\\..\\..\\bin\\rtm-naming.py")
29  os.system("start python ConsoleIn.py")
30  os.system("start python Consoleout.py")
31  time.sleep(3)
32  os.system("python Connector.py")
33 
34  else:
35  status,term=commands.getstatusoutput("which xterm")
36  term += " -e"
37  if status != 0:
38  status,term=commands.getstatusoutput("which kterm")
39  term += " -e"
40 
41  if status != 0:
42  status,term=commands.getstatusoutput("which uxterm")
43  term += " -e"
44 
45  if status != 0:
46  status,term=commands.getstatusoutput("which gnome-terminal")
47  term += " -x"
48 
49  if status != 0:
50  print "No terminal program (kterm/xterm/gnome-terminal) exists."
51  sys.exit(0)
52 
53  path = None
54  for p in sys.path:
55  if os.path.exists(os.path.join(p,"OpenRTM_aist")):
56  path = os.path.join(p,"OpenRTM_aist","utils","rtm-naming")
57  break
58  if path is None:
59  print "rtm-naming directory not exist."
60  sys.exit(0)
61 
62  os.system('python %s/rtm-naming.py &'%path)
63  os.system('%s python ConsoleIn.py &'%term)
64  os.system('%s python ConsoleOut.py &'%term)
65  time.sleep(3)
66  os.system("python Connector.py")
67 
68  return
69 
70 if __name__ == "__main__":
71  main()


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:34