def init_echo_dialog(prog_name, masteruri, topic_name, topic_type, hz=False, use_ssh=False): ''' Intialize the environment to start an echo window. ''' # start ROS-Master, if not currently running # StartHandler._prepareROSMaster(masteruri) name = '%s_echo' % prog_name rospy.init_node(name, anonymous=True, log_level=rospy.INFO) set_terminal_name(name) set_process_name(name) from node_manager_fkie.echo_dialog import EchoDialog global _SSH_HANDLER _SSH_HANDLER = SSHhandler() return EchoDialog(topic_name, topic_type, hz, masteruri, use_ssh=use_ssh)
def init_globals(masteruri): ''' :return: True if the masteruri referred to localhost :rtype: bool ''' # initialize the global handler global _SSH_HANDLER global _SCREEN_HANDLER global _START_HANDLER global _NAME_RESOLUTION global _HISTORY global _FILE_WATCHER global _FILE_WATCHER_PARAM _SSH_HANDLER = SSHhandler() _SCREEN_HANDLER = ScreenHandler() _START_HANDLER = StartHandler() _NAME_RESOLUTION = NameResolution() _HISTORY = History() _FILE_WATCHER = FileWatcher() _FILE_WATCHER_PARAM = FileWatcher() # test where the roscore is running (local or remote) __is_local('localhost') # fill cache return __is_local(get_hostname(masteruri)) # fill cache