$search
00001 00002 00003 /*************************************************************************** 00004 * publisher.cpp - Example: Node monitoring state publisher 00005 * 00006 * Created: Fri Apr 08 12:16:30 2011 00007 * Copyright 2011 Tim Niemueller [www.niemueller.de] 00008 * 2011 SRI International 00009 * 2011 Carnegie Mellon University 00010 * 2011 Intel Labs Pittsburgh 00011 * 2011 Columbia University in the City of New York 00012 * 00013 ****************************************************************************/ 00014 00015 /* This program is free software; you can redistribute it and/or modify 00016 * it under the terms of the 3-clase BSD License. 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU Library General Public License for more details. 00022 * 00023 * Read the full text in the LICENSE file in the root directory. 00024 */ 00025 00026 #include <ros/ros.h> 00027 #include <nodemon/state_publisher.h> 00028 00029 int 00030 main(int argc, char **argv) 00031 { 00032 ros::init(argc, argv, "nodemon_pubex"); 00033 ros::NodeHandle n; 00034 00035 NodeStatePublisher sp("nodemon_cpp", argv[0], n); 00036 sp.set_running(); 00037 00038 if (argc > 1) { 00039 if (strcmp(argv[1], "ERROR") == 0) { 00040 sp.set_error("broken", "Broken"); 00041 } else if (strcmp(argv[1], "FATAL") == 0) { 00042 sp.set_fatal("broken", "Broken"); 00043 } 00044 } 00045 00046 ros::spin(); 00047 }