00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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>
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
00058
00059
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
00072
00073
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
00086
00087
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
00100
00101
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
00114
00115
00116
00117
00118 }
00119
00120 };
00121
00122 PLUGINLIB_DECLARE_CLASS(test_nodelet, ConsoleTest, test_nodelet::ConsoleTest, nodelet::Nodelet);
00123 }