console_tests.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
31 #include <nodelet/nodelet.h>
32 #include <ros/ros.h>
33 #include <std_msgs/Float64.h>
34 #include <stdio.h>
35 
36 
37 #include <math.h> //fabs
38 
39 namespace test_nodelet
40 {
41 
43 {
44 private:
45  virtual void onInit()
46  {
47  std::string suffix("logger_suffix");
48 
49  NODELET_DEBUG("DEBUG output");
50  NODELET_DEBUG_STREAM("DEBUG" << " output");
51  NODELET_DEBUG_ONCE("DEBUG output");
52  NODELET_DEBUG_STREAM_ONCE("DEBUG" << " output");
53  NODELET_DEBUG_COND(1 == 1, "DEBUG output");
54  NODELET_DEBUG_STREAM_COND(1 == 1, "DEBUG" << " output");
55  NODELET_DEBUG_COND(1 == 0, "DEBUG output unseen");
56  NODELET_DEBUG_STREAM_COND(1 == 0, "DEBUG" << " output unseen");
57  NODELET_DEBUG_THROTTLE(10.0, "DEBUG output");
58  NODELET_DEBUG_STREAM_THROTTLE(10.0, "DEBUG" << " output");
59  //TODO TEST FILTERS
60  //NODELET_DEBUG_FILTER(10.0, "DEBUG output");
61  //NODELET_DEBUG_STREAM_FILTER(10.0, "DEBUG" << " output");
62  NODELET_DEBUG_NAMED(suffix, "DEBUG output");
63  NODELET_DEBUG_STREAM_NAMED(suffix, "DEBUG" << " output");
64  NODELET_DEBUG_ONCE_NAMED(suffix, "DEBUG output");
65  NODELET_DEBUG_STREAM_ONCE_NAMED(suffix, "DEBUG" << " output");
66  NODELET_DEBUG_COND_NAMED(1 == 1, suffix, "DEBUG output");
67  NODELET_DEBUG_STREAM_COND_NAMED(1 == 1, suffix, "DEBUG" << " output");
68  NODELET_DEBUG_COND_NAMED(1 == 0, suffix, "DEBUG output unseen");
69  NODELET_DEBUG_STREAM_COND_NAMED(1 == 0, suffix, "DEBUG" << " output unseen");
70  NODELET_DEBUG_THROTTLE_NAMED(10.0, suffix, "DEBUG output");
71  NODELET_DEBUG_STREAM_THROTTLE_NAMED(10.0, suffix, "DEBUG" << " output");
72  //TODO TEST FILTERS
73  //NODELET_DEBUG_FILTER_NAMED(10.0, suffix, "DEBUG output");
74  //NODELET_DEBUG_STREAM_FILTER_NAMED(10.0, suffix, "DEBUG" << " output");
75 
76  NODELET_INFO("INFO output");
77  NODELET_INFO_STREAM("INFO" << " output");
78  NODELET_INFO_ONCE("INFO output");
79  NODELET_INFO_STREAM_ONCE("INFO" << " output");
80  NODELET_INFO_COND(1 == 1, "INFO output");
81  NODELET_INFO_STREAM_COND(1 == 1, "INFO" << " output");
82  NODELET_INFO_COND(1 == 0, "INFO output unseen");
83  NODELET_INFO_STREAM_COND(1 == 0, "INFO" << " output unseen");
84  NODELET_INFO_THROTTLE(10.0, "INFO output");
85  NODELET_INFO_STREAM_THROTTLE(10.0, "INFO" << " output");
86  //TODO TEST FILTERS
87  //NODELET_INFO_FILTER(10.0, "INFO output");
88  //NODELET_INFO_STREAM_FILTER(10.0, "INFO" << " output");
89  NODELET_INFO_NAMED(suffix, "INFO output");
90  NODELET_INFO_STREAM_NAMED(suffix, "INFO" << " output");
91  NODELET_INFO_ONCE_NAMED(suffix, "INFO output");
92  NODELET_INFO_STREAM_ONCE_NAMED(suffix, "INFO" << " output");
93  NODELET_INFO_COND_NAMED(1 == 1, suffix, "INFO output");
94  NODELET_INFO_STREAM_COND_NAMED(1 == 1, suffix, "INFO" << " output");
95  NODELET_INFO_COND_NAMED(1 == 0, suffix, "INFO output unseen");
96  NODELET_INFO_STREAM_COND_NAMED(1 == 0, suffix, "INFO" << " output unseen");
97  NODELET_INFO_THROTTLE_NAMED(10.0, suffix, "INFO output");
98  NODELET_INFO_STREAM_THROTTLE_NAMED(10.0, suffix, "INFO" << " output");
99  //TODO TEST FILTERS
100  //NODELET_INFO_FILTER_NAMED(10.0, suffix, "INFO output");
101  //NODELET_INFO_STREAM_FILTER_NAMED(10.0, suffix, "INFO" << " output");
102 
103  NODELET_WARN("WARN output");
104  NODELET_WARN_STREAM("WARN" << " output");
105  NODELET_WARN_ONCE("WARN output");
106  NODELET_WARN_STREAM_ONCE("WARN" << " output");
107  NODELET_WARN_COND(1 == 1, "WARN output");
108  NODELET_WARN_STREAM_COND(1 == 1, "WARN" << " output");
109  NODELET_WARN_COND(1 == 0, "WARN output unseen");
110  NODELET_WARN_STREAM_COND(1 == 0, "WARN" << " output unseen");
111  NODELET_WARN_THROTTLE(10.0, "WARN output");
112  NODELET_WARN_STREAM_THROTTLE(10.0, "WARN" << " output");
113  //TODO TEST FILTERS
114  //NODELET_WARN_FILTER(10.0, "WARN output");
115  //NODELET_WARN_STREAM_FILTER(10.0, "WARN" << " output");
116  NODELET_WARN_NAMED(suffix, "WARN output");
117  NODELET_WARN_STREAM_NAMED(suffix, "WARN" << " output");
118  NODELET_WARN_ONCE_NAMED(suffix, "WARN output");
119  NODELET_WARN_STREAM_ONCE_NAMED(suffix, "WARN" << " output");
120  NODELET_WARN_COND_NAMED(1 == 1, suffix, "WARN output");
121  NODELET_WARN_STREAM_COND_NAMED(1 == 1, suffix, "WARN" << " output");
122  NODELET_WARN_COND_NAMED(1 == 0, suffix, "WARN output unseen");
123  NODELET_WARN_STREAM_COND_NAMED(1 == 0, suffix, "WARN" << " output unseen");
124  NODELET_WARN_THROTTLE_NAMED(10.0, suffix, "WARN output");
125  NODELET_WARN_STREAM_THROTTLE_NAMED(10.0, suffix, "WARN" << " output");
126  //TODO TEST FILTERS
127  //NODELET_WARN_FILTER_NAMED(10.0, suffix, "WARN output");
128  //NODELET_WARN_STREAM_FILTER_NAMED(10.0, suffix, "WARN" << " output");
129 
130  NODELET_ERROR("ERROR output");
131  NODELET_ERROR_STREAM("ERROR" << " output");
132  NODELET_ERROR_ONCE("ERROR output");
133  NODELET_ERROR_STREAM_ONCE("ERROR" << " output");
134  NODELET_ERROR_COND(1 == 1, "ERROR output");
135  NODELET_ERROR_STREAM_COND(1 == 1, "ERROR" << " output");
136  NODELET_ERROR_COND(1 == 0, "ERROR output unseen");
137  NODELET_ERROR_STREAM_COND(1 == 0, "ERROR" << " output unseen");
138  NODELET_ERROR_THROTTLE(10.0, "ERROR output");
139  NODELET_ERROR_STREAM_THROTTLE(10.0, "ERROR" << " output");
140  //TODO TEST FILTERS
141  //NODELET_ERROR_FILTER(10.0, "ERROR output");
142  //NODELET_ERROR_STREAM_FILTER(10.0, "ERROR" << " output");
143  NODELET_ERROR_NAMED(suffix, "ERROR output");
144  NODELET_ERROR_STREAM_NAMED(suffix, "ERROR" << " output");
145  NODELET_ERROR_ONCE_NAMED(suffix, "ERROR output");
146  NODELET_ERROR_STREAM_ONCE_NAMED(suffix, "ERROR" << " output");
147  NODELET_ERROR_COND_NAMED(1 == 1, suffix, "ERROR output");
148  NODELET_ERROR_STREAM_COND_NAMED(1 == 1, suffix, "ERROR" << " output");
149  NODELET_ERROR_COND_NAMED(1 == 0, suffix, "ERROR output unseen");
150  NODELET_ERROR_STREAM_COND_NAMED(1 == 0, suffix, "ERROR" << " output unseen");
151  NODELET_ERROR_THROTTLE_NAMED(10.0, suffix, "ERROR output");
152  NODELET_ERROR_STREAM_THROTTLE_NAMED(10.0, suffix, "ERROR" << " output");
153  //TODO TEST FILTERS
154  //NODELET_ERROR_FILTER_NAMED(10.0, suffix, "ERROR output");
155  //NODELET_ERROR_STREAM_FILTER_NAMED(10.0, suffix, "ERROR" << " output");
156 
157  NODELET_FATAL("FATAL output");
158  NODELET_FATAL_STREAM("FATAL" << " output");
159  NODELET_FATAL_ONCE("FATAL output");
160  NODELET_FATAL_STREAM_ONCE("FATAL" << " output");
161  NODELET_FATAL_COND(1 == 1, "FATAL output");
162  NODELET_FATAL_STREAM_COND(1 == 1, "FATAL" << " output");
163  NODELET_FATAL_COND(1 == 0, "FATAL output unseen");
164  NODELET_FATAL_STREAM_COND(1 == 0, "FATAL" << " output unseen");
165  NODELET_FATAL_THROTTLE(10.0, "FATAL output");
166  NODELET_FATAL_STREAM_THROTTLE(10.0, "FATAL" << " output");
167  //TODO TEST FILTERS
168  //NODELET_FATAL_FILTER(10.0, "FATAL output");
169  //NODELET_FATAL_STREAM_FILTER(10.0, "FATAL" << " output");
170  NODELET_FATAL_NAMED(suffix, "FATAL output");
171  NODELET_FATAL_STREAM_NAMED(suffix, "FATAL" << " named output");
172  NODELET_FATAL_ONCE_NAMED(suffix, "FATAL named output");
173  NODELET_FATAL_STREAM_ONCE_NAMED(suffix, "FATAL" << " named output");
174  NODELET_FATAL_COND_NAMED(1 == 1, suffix, "FATAL named output");
175  NODELET_FATAL_STREAM_COND_NAMED(1 == 1, suffix, "FATAL" << " named output");
176  NODELET_FATAL_COND_NAMED(1 == 0, suffix, "FATAL named output unseen");
177  NODELET_FATAL_STREAM_COND_NAMED(1 == 0, suffix, "FATAL" << " named output unseen");
178  NODELET_FATAL_THROTTLE_NAMED(10.0, suffix, "FATAL named output");
179  NODELET_FATAL_STREAM_THROTTLE_NAMED(10.0, suffix, "FATAL" << " named output");
180  //TODO TEST FILTERS
181  //NODELET_FATAL_FILTER_NAMED(10.0, suffix, "FATAL named output");
182  //NODELET_FATAL_STREAM_FILTER_NAMED(10.0, suffix, "FATAL" << " named output");
183  }
184 
185 };
186 
188 }
#define NODELET_ERROR_STREAM_THROTTLE(rate,...)
#define NODELET_INFO_STREAM(...)
#define NODELET_WARN_STREAM_ONCE(...)
#define NODELET_INFO_ONCE(...)
#define NODELET_ERROR_STREAM_ONCE_NAMED(suffix,...)
#define NODELET_ERROR(...)
#define NODELET_WARN_STREAM_THROTTLE(rate,...)
#define NODELET_INFO_ONCE_NAMED(suffix,...)
#define NODELET_WARN(...)
#define NODELET_ERROR_STREAM_COND_NAMED(cond, suffix,...)
#define NODELET_DEBUG_STREAM_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_ERROR_THROTTLE(rate,...)
#define NODELET_DEBUG_STREAM_NAMED(suffix,...)
#define NODELET_DEBUG_STREAM_COND(cond,...)
#define NODELET_WARN_STREAM(...)
#define NODELET_WARN_STREAM_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_FATAL_STREAM_ONCE(...)
#define NODELET_ERROR_COND(cond,...)
#define NODELET_WARN_STREAM_NAMED(suffix,...)
#define NODELET_INFO_STREAM_COND_NAMED(cond, suffix,...)
#define NODELET_DEBUG_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_ERROR_STREAM_ONCE(...)
#define NODELET_DEBUG_THROTTLE(rate,...)
#define NODELET_FATAL_COND(cond,...)
#define NODELET_DEBUG_STREAM_ONCE_NAMED(suffix,...)
#define NODELET_WARN_STREAM_COND_NAMED(cond, suffix,...)
#define NODELET_DEBUG_COND(cond,...)
#define NODELET_ERROR_STREAM_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_ERROR_STREAM(...)
#define NODELET_DEBUG_STREAM_ONCE(...)
#define NODELET_WARN_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_FATAL_COND_NAMED(cond, suffix,...)
#define NODELET_INFO_COND_NAMED(cond, suffix,...)
#define NODELET_FATAL_STREAM_ONCE_NAMED(suffix,...)
#define NODELET_WARN_THROTTLE(rate,...)
#define NODELET_WARN_COND(cond,...)
#define NODELET_ERROR_STREAM_COND(cond,...)
#define NODELET_ERROR_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_WARN_COND_NAMED(cond, suffix,...)
#define NODELET_FATAL_STREAM_COND(cond,...)
#define NODELET_DEBUG_ONCE_NAMED(suffix,...)
#define NODELET_WARN_ONCE_NAMED(suffix,...)
#define NODELET_ERROR_ONCE(...)
#define NODELET_INFO_STREAM_THROTTLE(rate,...)
#define NODELET_ERROR_NAMED(suffix,...)
#define NODELET_INFO_STREAM_ONCE(...)
#define NODELET_ERROR_COND_NAMED(cond, suffix,...)
#define NODELET_INFO_STREAM_ONCE_NAMED(suffix,...)
#define NODELET_WARN_STREAM_COND(cond,...)
#define NODELET_WARN_ONCE(...)
#define NODELET_DEBUG_STREAM(...)
PLUGINLIB_EXPORT_CLASS(test_nodelet::NodehandleTest, nodelet::Nodelet)
#define NODELET_FATAL_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_DEBUG_ONCE(...)
#define NODELET_INFO_THROTTLE(rate,...)
#define NODELET_FATAL_STREAM_NAMED(suffix,...)
#define NODELET_INFO(...)
#define NODELET_INFO_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_FATAL_STREAM_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_INFO_COND(cond,...)
#define NODELET_FATAL_NAMED(suffix,...)
#define NODELET_DEBUG_NAMED(suffix,...)
#define NODELET_FATAL_STREAM(...)
#define NODELET_FATAL_THROTTLE(rate,...)
#define NODELET_FATAL_ONCE(...)
#define NODELET_INFO_STREAM_THROTTLE_NAMED(rate, suffix,...)
#define NODELET_DEBUG_STREAM_COND_NAMED(cond, suffix,...)
#define NODELET_DEBUG_STREAM_THROTTLE(rate,...)
#define NODELET_WARN_STREAM_ONCE_NAMED(suffix,...)
#define NODELET_ERROR_ONCE_NAMED(suffix,...)
#define NODELET_INFO_NAMED(suffix,...)
#define NODELET_FATAL(...)
#define NODELET_DEBUG_COND_NAMED(cond, suffix,...)
#define NODELET_FATAL_STREAM_THROTTLE(rate,...)
#define NODELET_INFO_STREAM_COND(cond,...)
#define NODELET_DEBUG(...)
#define NODELET_FATAL_STREAM_COND_NAMED(cond, suffix,...)
#define NODELET_FATAL_ONCE_NAMED(suffix,...)
#define NODELET_INFO_STREAM_NAMED(suffix,...)
#define NODELET_ERROR_STREAM_NAMED(suffix,...)
#define NODELET_WARN_NAMED(suffix,...)


test_nodelet
Author(s): Tully Foote
autogenerated on Sat Jul 18 2020 03:17:57