def main():
    '''
    Creates and runs the ROS node
    '''
    # setup the loglevel
    try:
        log_level = getattr(
            rospy, rospy.get_param('/%s/log_level' % PROCESS_NAME, "INFO"))
    except Exception as e:
        print "Error while set the log level: %s\n->INFO level will be used!" % e
        log_level = rospy.INFO
    rospy.init_node(PROCESS_NAME, log_level=log_level)
    set_terminal_name(PROCESS_NAME)
    set_process_name(PROCESS_NAME)
    try:
        default_cfg = DefaultCfg()
        default_cfg.load()
    except:
        # on load error the process will be killed to notify user in node_manager
        # about error
        rospy.logwarn("%s", traceback.format_exc())
        sys.stdout.write(traceback.format_exc())
        sys.stdout.flush()
        os.kill(os.getpid(), signal.SIGKILL)
    rospy.spin()
示例#2
0
def main():
  '''
  Creates and runs the ROS node
  '''
  # setup the loglevel
  try:
    log_level = getattr(rospy, rospy.get_param('/%s/log_level'%PROCESS_NAME, "INFO"))
  except Exception as e:
    print "Error while set the log level: %s\n->INFO level will be used!"%e
    log_level = rospy.INFO
  rospy.init_node(PROCESS_NAME, log_level=log_level)
  setTerminalName(PROCESS_NAME)
  setProcessName(PROCESS_NAME)
  try:
    default_cfg = DefaultCfg()
    default_cfg.load()
  except:
    # on load error the process will be killed to notify user in node_manager
    # about error
    import traceback
    rospy.logwarn("%s", traceback.format_exc())
    sys.stdout.write(traceback.format_exc())
    sys.stdout.flush()
    import os, signal
    os.kill(os.getpid(), signal.SIGKILL)
  rospy.spin()
示例#3
0
def main():
    '''
  Creates and runs the ROS node
  '''
    setTerminalName(NODE_NAME)
    setProcessName(NODE_NAME)
    rospy.init_node(NODE_NAME, log_level=rospy.DEBUG)
    launch_file = rospy.get_param('~launch_file', '')
    package = rospy.get_param('~package', '')
    argv = rospy.get_param('~argv', '')
    default_cfg = DefaultCfg()
    try:
        default_cfg.load(package, launch_file, argv)
    except:
        import traceback
        traceback.print_exc()
        print "No configuration loaded! Use ~load service to load a configuration!"
    rospy.spin()
示例#4
0
def main():
    """
  Creates and runs the ROS node
  """
    setTerminalName(NODE_NAME)
    setProcessName(NODE_NAME)
    rospy.init_node(NODE_NAME, log_level=rospy.DEBUG)
    launch_file = rospy.get_param("~launch_file", "")
    package = rospy.get_param("~package", "")
    argv = rospy.get_param("~argv", "")
    default_cfg = DefaultCfg()
    try:
        default_cfg.load(package, launch_file, argv)
    except:
        import traceback

        traceback.print_exc()
        print "No configuration loaded! Use ~load service to load a configuration!"
    rospy.spin()
示例#5
0
def main():
    '''
  Creates and runs the ROS node
  '''
    rospy.init_node(NODE_NAME, log_level=rospy.DEBUG)
    setTerminalName(rospy.get_name())
    setProcessName(rospy.get_name())
    try:
        default_cfg = DefaultCfg()
        default_cfg.load()
    except:
        # on load error the process will be killed to notify user in node_manager
        # about error
        import traceback
        rospy.logwarn("%s", traceback.format_exc())
        sys.stdout.write(traceback.format_exc())
        sys.stdout.flush()
        import os, signal
        os.kill(os.getpid(), signal.SIGKILL)
    rospy.spin()
示例#6
0
def main():
  '''
  Creates and runs the ROS node
  '''
  rospy.init_node(NODE_NAME, log_level=rospy.DEBUG)
  setTerminalName(rospy.get_name())
  setProcessName(rospy.get_name())
  launch_file = rospy.get_param('~launch_file', '')
  package = rospy.get_param('~package', '')
  default_cfg = DefaultCfg()
  try:
    default_cfg.load(package, launch_file, sys.argv)
  except:
    # on load error the process will be killed to notify user in node_manager
    # about error
    import traceback
    print traceback.format_exc()
    import os, signal
    os.kill(os.getpid(), signal.SIGKILL)
    import time
    time.sleep(10)
  rospy.spin()