AutoTestComposite.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: utf-8 -*-
00003 # -*- Python -*-
00004 
00005 import sys
00006 import time
00007 import socket
00008 
00009 from rtc_handle10_11 import *
00010 from CorbaNaming import *
00011 import RTM
00012 
00013 
00014 
00015 env = RtmEnv(sys.argv, ["localhost:2809"])
00016 
00017 ## Get Manager object reference
00018 mgr_name = socket.gethostname()+".host_cxt/manager.mgr"
00019 naming = CorbaNaming(env.orb, "localhost:2809")
00020 manager = naming.resolve(mgr_name)._narrow(RTM.Manager)
00021 
00022 listo = env.name_space["localhost:2809"].list_obj()
00023 env.name_space['localhost:2809'].rtc_handles.keys()
00024 
00025 ns = env.name_space['localhost:2809']
00026 
00027 comp = ns.rtc_handles["PeriodicECSharedComposite0.rtc"]
00028 config = comp.rtc_ref.get_configuration()
00029 configset = config.get_configuration_sets()
00030 config_data = configset[0].configuration_data
00031 
00032 
00033 time.sleep(1)
00034 
00035 
00036 motor = ns.rtc_handles["Motor0.rtc"]
00037 sensor = ns.rtc_handles["Sensor0.rtc"]
00038 controller = ns.rtc_handles["Controller0.rtc"]
00039 loop_count = 1000
00040 for i in range(loop_count):
00041   manager.create_component("PeriodicECSharedComposite?instance_name=aaa")
00042   env.name_space["localhost:2809"].list_obj()
00043   aaa=ns.rtc_handles[socket.gethostname()+".host_cxt/aaa.rtc"]
00044   org=aaa.rtc_ref.get_owned_organizations()[0]
00045   org.set_members ([motor.rtc_ref,sensor.rtc_ref,controller.rtc_ref])
00046   time.sleep(1)
00047   ret = org.remove_member("Motor0")
00048   ret = org.remove_member("Sensor0")
00049   ret = org.remove_member("Controller0")
00050   aaa.rtc_ref.exit()
00051   time.sleep(1)


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Aug 27 2015 14:17:28