{"action":"opened","issue":{"url":"https://api.github.com/repos/asmodehn/pyros/issues/100","repository_url":"https://api.github.com/repos/asmodehn/pyros","labels_url":"https://api.github.com/repos/asmodehn/pyros/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/asmodehn/pyros/issues/100/comments","events_url":"https://api.github.com/repos/asmodehn/pyros/issues/100/events","html_url":"https://github.com/asmodehn/pyros/issues/100","id":183341117,"number":100,"title":"Topic_extract in pyros_client does not working after rosinstance reinit.","user":{"login":"dhirajdhule","id":10280687,"avatar_url":"https://avatars.githubusercontent.com/u/10280687?v=3","gravatar_id":"","url":"https://api.github.com/users/dhirajdhule","html_url":"https://github.com/dhirajdhule","followers_url":"https://api.github.com/users/dhirajdhule/followers","following_url":"https://api.github.com/users/dhirajdhule/following{/other_user}","gists_url":"https://api.github.com/users/dhirajdhule/gists{/gist_id}","starred_url":"https://api.github.com/users/dhirajdhule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhirajdhule/subscriptions","organizations_url":"https://api.github.com/users/dhirajdhule/orgs","repos_url":"https://api.github.com/users/dhirajdhule/repos","events_url":"https://api.github.com/users/dhirajdhule/events{/privacy}","received_events_url":"https://api.github.com/users/dhirajdhule/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-17T07:07:56Z","updated_at":"2016-10-17T07:07:56Z","closed_at":null,"body":"I am trying to dynamically configure the topics, services list passed to pyros instance using [setup method.](https://github.com/asmodehn/pyros/blob/master/pyros/pyros_ros.py#L146). But the new instance is not able to [extract topics](https://github.com/asmodehn/pyros/blob/master/pyros/pyros_client.py#L139). Call to services works with this renewed configuration.\r\n\r\nHere is my piece of code which initializes a pyros_ros instance:\r\n```\r\nclass PyrosClientOnROS(object, ):\r\n    #TODO find out a way to get namespace without rospy preferably\r\n    def __init__(self, enable_cache=False):\r\n        #lets set minimum rosinstnace to get global namespace\r\n        # self.rosInstance = PyrosROS(kwargs={'topics':['/abc'],'services':['/get_global_namespace'],'params':['/def'],'enable_cache': enable_cache})  # careful assuming the topic fullname here\r\n        self.rosInstance = PyrosROS(kwargs={'topics':['/chatter','/.*'],'services':['/get_global_namespace'],'params':['/def'],'enable_cache': enable_cache})  # careful assuming the topic fullname here\r\n        # setting up ros instance\r\n        # TODO: Catch exceptions here\r\n        cmd_conn = self.rosInstance.start()\r\n        self.client = PyrosClient(cmd_conn)\r\n        #wait for the client to come up\r\n        time.sleep(3)\r\n        self.__namespace() #sets up self.ros_ns to namespace \r\n        #prepend namespace to all topics from flyt\r\n        #TODO how about adding non flyt stuff here\r\n        #TOPICS, SERVICES, PARAMS are lists imported from config.py\r\n        Topics = [self.ros_ns+x for x in TOPICS]\r\n        Services = [self.ros_ns+x for x in SERVICES]\r\n        Params = [self.ros_ns+x for x in PARAMS]\r\n\r\n        #Reinitialize rosinterface with list of services and topics prepended with namespace\r\n        self.rosInstance.setup(topics= Topics, services=Services , params= Params, enable_cache= enable_cache)  # careful assuming the topic fullname here\r\n        cmd_conn = self.rosInstance.start()\r\n        self.client = PyrosClient(cmd_conn)\r\n``` \r\nWe had discussed this earlier and I was using setup method until I realized this issue. Now I have moved on to regular expressions as you had suggested earlier like '/.*/servicename' to pass a topics/services with dynamic namespace. \r\n\r\nWe also had discussed about passing '/.*/' in topics list so that everything is exposed from ros. But when I tried this with some ~20 ros topics running, the rosinterface got stuck in creating rosinterface topics. @asmodehn have you tested this approach? \r\n\r\n"}}
{"actor":{"display_login":"dhirajdhule"}}