AutoTestComposite.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # -*- Python -*-
4 
5 import sys
6 import time
7 import socket
8 
9 from rtc_handle10_11 import *
10 from CorbaNaming import *
11 import RTM
12 
13 
14 
15 env = RtmEnv(sys.argv, ["localhost:2809"])
16 
17 
18 mgr_name = socket.gethostname()+".host_cxt/manager.mgr"
19 naming = CorbaNaming(env.orb, "localhost:2809")
20 manager = naming.resolve(mgr_name)._narrow(RTM.Manager)
21 
22 listo = env.name_space["localhost:2809"].list_obj()
23 env.name_space['localhost:2809'].rtc_handles.keys()
24 
25 ns = env.name_space['localhost:2809']
26 
27 comp = ns.rtc_handles["PeriodicECSharedComposite0.rtc"]
28 config = comp.rtc_ref.get_configuration()
29 configset = config.get_configuration_sets()
30 config_data = configset[0].configuration_data
31 
32 
33 time.sleep(1)
34 
35 
36 motor = ns.rtc_handles["Motor0.rtc"]
37 sensor = ns.rtc_handles["Sensor0.rtc"]
38 controller = ns.rtc_handles["Controller0.rtc"]
39 loop_count = 1000
40 for i in range(loop_count):
41  manager.create_component("PeriodicECSharedComposite?instance_name=aaa")
42  env.name_space["localhost:2809"].list_obj()
43  aaa=ns.rtc_handles[socket.gethostname()+".host_cxt/aaa.rtc"]
44  org=aaa.rtc_ref.get_owned_organizations()[0]
45  org.set_members ([motor.rtc_ref,sensor.rtc_ref,controller.rtc_ref])
46  time.sleep(1)
47  ret = org.remove_member("Motor0")
48  ret = org.remove_member("Sensor0")
49  ret = org.remove_member("Controller0")
50  aaa.rtc_ref.exit()
51  time.sleep(1)


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Feb 28 2022 23:01:06