console_tests.cpp
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2009, Willow Garage, Inc.
00003  * All rights reserved.
00004  * 
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  * 
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Neither the name of the Willow Garage, Inc. nor the names of its
00014  *       contributors may be used to endorse or promote products derived from
00015  *       this software without specific prior written permission.
00016  * 
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00027  * POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 
00030 #include <pluginlib/class_list_macros.h>
00031 #include <nodelet/nodelet.h>
00032 #include <ros/ros.h>
00033 #include <std_msgs/Float64.h>
00034 #include <stdio.h>
00035 
00036 
00037 #include <math.h> //fabs
00038 
00039 namespace test_nodelet
00040 {
00041 
00042 class ConsoleTest : public nodelet::Nodelet
00043 {
00044 private:
00045   virtual void onInit()
00046   {
00047     NODELET_DEBUG("DEBUG output");
00048     NODELET_DEBUG_STREAM("DEBUG" << " output");
00049     NODELET_DEBUG_ONCE("DEBUG output");
00050     NODELET_DEBUG_STREAM_ONCE("DEBUG" << " output");
00051     NODELET_DEBUG_COND(1 == 1, "DEBUG output");
00052     NODELET_DEBUG_STREAM_COND(1 == 1, "DEBUG" << " output");
00053     NODELET_DEBUG_COND(1 == 0, "DEBUG output unseen");
00054     NODELET_DEBUG_STREAM_COND(1 == 0, "DEBUG" << " output unseen");
00055     NODELET_DEBUG_THROTTLE(10.0, "DEBUG output");
00056     NODELET_DEBUG_STREAM_THROTTLE(10.0, "DEBUG" << " output");
00057     //TODO TEST FILTERS
00058     //NODELET_DEBUG_FILTER(10.0, "DEBUG output");
00059     //NODELET_DEBUG_STREAM_FILTER(10.0, "DEBUG" << " output");
00060 
00061     NODELET_INFO("INFO output");
00062     NODELET_INFO_STREAM("INFO" << " output");
00063     NODELET_INFO_ONCE("INFO output");
00064     NODELET_INFO_STREAM_ONCE("INFO" << " output");
00065     NODELET_INFO_COND(1 == 1, "INFO output");
00066     NODELET_INFO_STREAM_COND(1 == 1, "INFO" << " output");
00067     NODELET_INFO_COND(1 == 0, "INFO output unseen");
00068     NODELET_INFO_STREAM_COND(1 == 0, "INFO" << " output unseen");
00069     NODELET_INFO_THROTTLE(10.0, "INFO output");
00070     NODELET_INFO_STREAM_THROTTLE(10.0, "INFO" << " output");
00071     //TODO TEST FILTERS
00072     //NODELET_INFO_FILTER(10.0, "INFO output");
00073     //NODELET_INFO_STREAM_FILTER(10.0, "INFO" << " output");
00074 
00075     NODELET_WARN("WARN output");
00076     NODELET_WARN_STREAM("WARN" << " output");
00077     NODELET_WARN_ONCE("WARN output");
00078     NODELET_WARN_STREAM_ONCE("WARN" << " output");
00079     NODELET_WARN_COND(1 == 1, "WARN output");
00080     NODELET_WARN_STREAM_COND(1 == 1, "WARN" << " output");
00081     NODELET_WARN_COND(1 == 0, "WARN output unseen");
00082     NODELET_WARN_STREAM_COND(1 == 0, "WARN" << " output unseen");
00083     NODELET_WARN_THROTTLE(10.0, "WARN output");
00084     NODELET_WARN_STREAM_THROTTLE(10.0, "WARN" << " output");
00085     //TODO TEST FILTERS
00086     //NODELET_WARN_FILTER(10.0, "WARN output");
00087     //NODELET_WARN_STREAM_FILTER(10.0, "WARN" << " output");
00088 
00089     NODELET_ERROR("ERROR output");
00090     NODELET_ERROR_STREAM("ERROR" << " output");
00091     NODELET_ERROR_ONCE("ERROR output");
00092     NODELET_ERROR_STREAM_ONCE("ERROR" << " output");
00093     NODELET_ERROR_COND(1 == 1, "ERROR output");
00094     NODELET_ERROR_STREAM_COND(1 == 1, "ERROR" << " output");
00095     NODELET_ERROR_COND(1 == 0, "ERROR output unseen");
00096     NODELET_ERROR_STREAM_COND(1 == 0, "ERROR" << " output unseen");
00097     NODELET_ERROR_THROTTLE(10.0, "ERROR output");
00098     NODELET_ERROR_STREAM_THROTTLE(10.0, "ERROR" << " output");
00099     //TODO TEST FILTERS
00100     //NODELET_ERROR_FILTER(10.0, "ERROR output");
00101     //NODELET_ERROR_STREAM_FILTER(10.0, "ERROR" << " output");
00102 
00103     NODELET_FATAL("FATAL output");
00104     NODELET_FATAL_STREAM("FATAL" << " output");
00105     NODELET_FATAL_ONCE("FATAL output");
00106     NODELET_FATAL_STREAM_ONCE("FATAL" << " output");
00107     NODELET_FATAL_COND(1 == 1, "FATAL output");
00108     NODELET_FATAL_STREAM_COND(1 == 1, "FATAL" << " output");
00109     NODELET_FATAL_COND(1 == 0, "FATAL output unseen");
00110     NODELET_FATAL_STREAM_COND(1 == 0, "FATAL" << " output unseen");
00111     NODELET_FATAL_THROTTLE(10.0, "FATAL output");
00112     NODELET_FATAL_STREAM_THROTTLE(10.0, "FATAL" << " output");
00113     //TODO TEST FILTERS
00114     //NODELET_FATAL_FILTER(10.0, "FATAL output");
00115     //NODELET_FATAL_STREAM_FILTER(10.0, "FATAL" << " output");
00116 
00117     
00118   }
00119 
00120 };
00121 
00122 PLUGINLIB_DECLARE_CLASS(test_nodelet, ConsoleTest, test_nodelet::ConsoleTest, nodelet::Nodelet);
00123 }


test_nodelet
Author(s): Tully Foote
autogenerated on Mon Oct 6 2014 02:52:34