Robotis Manipulator  1.0.0
robotis_manipulator::log Namespace Reference

Functions

void print (STRING str, STRING color="DEFAULT")
 print More...
 
void print (STRING str, double data, uint8_t decimal_point=3, STRING color="DEFAULT")
 print More...
 
void print (const char *str, STRING color="DEFAULT")
 print More...
 
void print (const char *str, double data, uint8_t decimal_point=3, STRING color="DEFAULT")
 print More...
 
void println (STRING str, STRING color="DEFAULT")
 println More...
 
void println (STRING str, double data, uint8_t decimal_point=3, STRING color="DEFAULT")
 println More...
 
void println (const char *str, STRING color="DEFAULT")
 println More...
 
void println (const char *str, double data, uint8_t decimal_point=3, STRING color="DEFAULT")
 println More...
 
void info (STRING str)
 info More...
 
void info (STRING str, double data, uint8_t decimal_point=3)
 info More...
 
void info (const char *str)
 info More...
 
void info (const char *str, double data, uint8_t decimal_point=3)
 info More...
 
void warn (STRING str)
 warn More...
 
void warn (STRING str, double data, uint8_t decimal_point=3)
 warn More...
 
void warn (const char *str)
 warn More...
 
void warn (const char *str, double data, uint8_t decimal_point=3)
 warn More...
 
void error (STRING str)
 error More...
 
void error (STRING str, double data, uint8_t decimal_point=3)
 error More...
 
void error (const char *str)
 error More...
 
void error (const char *str, double data, uint8_t decimal_point=3)
 error More...
 
template<typename T >
void print_vector (std::vector< T > &vec, uint8_t decimal_point=3)
 print_vector More...
 
template<typename vector >
void print_vector (vector &vec, uint8_t decimal_point=3)
 print_vector More...
 
template<typename matrix >
void print_matrix (matrix &m, uint8_t decimal_point=3)
 print_matrix More...
 

Function Documentation

void robotis_manipulator::log::error ( STRING  str)

error

Parameters
str

Definition at line 239 of file robotis_manipulator_log.cpp.

240 {
241 #if defined(__OPENCR__)
242  DEBUG.print("[ERROR] ");
243  DEBUG.println(str);
244 #else
245  printf(ANSI_COLOR_RED);
246  printf("[ERROR] %s\n", str.c_str());
247  printf(ANSI_COLOR_RESET);
248 #endif
249 }
#define ANSI_COLOR_RED
#define ANSI_COLOR_RESET

Here is the caller graph for this function:

void robotis_manipulator::log::error ( STRING  str,
double  data,
uint8_t  decimal_point = 3 
)

error

Parameters
str
data
decimal_point

Definition at line 250 of file robotis_manipulator_log.cpp.

251 {
252 #if defined(__OPENCR__)
253  DEBUG.print("[ERROR] ");
254  DEBUG.print(str);
255  DEBUG.println(data, decimal_point);
256 #else
257  printf(ANSI_COLOR_RED);
258  printf("[ERROR] %s %.*lf\n", str.c_str(), decimal_point, data);
259  printf(ANSI_COLOR_RESET);
260 #endif
261 }
#define ANSI_COLOR_RED
#define ANSI_COLOR_RESET
void robotis_manipulator::log::error ( const char *  str)

error

Parameters
str

Definition at line 263 of file robotis_manipulator_log.cpp.

264 {
265 #if defined(__OPENCR__)
266  DEBUG.print("[ERROR] ");
267  DEBUG.println(str);
268 #else
269  printf(ANSI_COLOR_RED);
270  printf("[ERROR] %s\n", str);
271  printf(ANSI_COLOR_RESET);
272 #endif
273 }
#define ANSI_COLOR_RED
#define ANSI_COLOR_RESET
void robotis_manipulator::log::error ( const char *  str,
double  data,
uint8_t  decimal_point = 3 
)

error

Parameters
str
data
decimal_point

Definition at line 274 of file robotis_manipulator_log.cpp.

275 {
276 #if defined(__OPENCR__)
277  DEBUG.print("[ERROR] ");
278  DEBUG.print(str);
279  DEBUG.println(data, decimal_point);
280 #else
281  printf(ANSI_COLOR_RED);
282  printf("[ERROR] %s %.*lf\n", str, decimal_point, data);
283  printf(ANSI_COLOR_RESET);
284 #endif
285 }
#define ANSI_COLOR_RED
#define ANSI_COLOR_RESET
void robotis_manipulator::log::info ( STRING  str)

info

Parameters
str

Definition at line 155 of file robotis_manipulator_log.cpp.

156 {
157 #if defined(__OPENCR__)
158  DEBUG.print("[INFO] ");
159  DEBUG.println(str);
160 #else
161  printf("[INFO] %s\n", str.c_str());
162 #endif
163 }
void robotis_manipulator::log::info ( STRING  str,
double  data,
uint8_t  decimal_point = 3 
)

info

Parameters
str
data
decimal_point

Definition at line 164 of file robotis_manipulator_log.cpp.

165 {
166 #if defined(__OPENCR__)
167  DEBUG.print("[INFO] ");
168  DEBUG.print(str);
169  DEBUG.println(data, decimal_point);
170 #else
171  printf("[INFO] %s %.*lf\n", str.c_str(), decimal_point, data);
172 #endif
173 }
void robotis_manipulator::log::info ( const char *  str)

info

Parameters
str

Definition at line 174 of file robotis_manipulator_log.cpp.

175 {
176 #if defined(__OPENCR__)
177  DEBUG.print("[INFO] ");
178  DEBUG.println(str);
179 #else
180  printf("[INFO] %s\n", str);
181 #endif
182 }
void robotis_manipulator::log::info ( const char *  str,
double  data,
uint8_t  decimal_point = 3 
)

info

Parameters
str
data
decimal_point

Definition at line 183 of file robotis_manipulator_log.cpp.

184 {
185 #if defined(__OPENCR__)
186  DEBUG.print("[INFO] ");
187  DEBUG.print(str);
188  DEBUG.println(data, decimal_point);
189 #else
190  printf("[INFO] %s %.*lf\n", str, decimal_point, data);
191 #endif
192 }
void robotis_manipulator::log::print ( STRING  str,
STRING  color = "DEFAULT" 
)

print

Parameters
str
color

Definition at line 28 of file robotis_manipulator_log.cpp.

29 {
30 #if defined(__OPENCR__)
31  DEBUG.print(str);
32 #else
33  if(color == "RED") printf(ANSI_COLOR_RED);
34  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
35  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
36  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
37  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
38  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
39  printf("%s", str.c_str());
40  printf(ANSI_COLOR_RESET);
41 #endif
42 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE

Here is the caller graph for this function:

void robotis_manipulator::log::print ( STRING  str,
double  data,
uint8_t  decimal_point = 3,
STRING  color = "DEFAULT" 
)

print

Parameters
str
data
decimal_point
color

Definition at line 43 of file robotis_manipulator_log.cpp.

44 {
45 #if defined(__OPENCR__)
46  DEBUG.print(str);
47  DEBUG.print(data, decimal_point);
48 #else
49  if(color == "RED") printf(ANSI_COLOR_RED);
50  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
51  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
52  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
53  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
54  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
55  printf("%s %.*lf", str.c_str(), decimal_point, data);
56  printf(ANSI_COLOR_RESET);
57 #endif
58 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE
void robotis_manipulator::log::print ( const char *  str,
STRING  color = "DEFAULT" 
)

print

Parameters
str
color

Definition at line 59 of file robotis_manipulator_log.cpp.

60 {
61 #if defined(__OPENCR__)
62  DEBUG.print(str);
63 #else
64  if(color == "RED") printf(ANSI_COLOR_RED);
65  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
66  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
67  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
68  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
69  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
70  printf("%s", str);
71  printf(ANSI_COLOR_RESET);
72 #endif
73 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE
void robotis_manipulator::log::print ( const char *  str,
double  data,
uint8_t  decimal_point = 3,
STRING  color = "DEFAULT" 
)

print

Parameters
str
data
decimal_point
color

Definition at line 74 of file robotis_manipulator_log.cpp.

75 {
76 #if defined(__OPENCR__)
77  DEBUG.print(str);
78  DEBUG.print(data, decimal_point);
79 #else
80  if(color == "RED") printf(ANSI_COLOR_RED);
81  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
82  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
83  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
84  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
85  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
86  printf("%s %.*lf", str, decimal_point, data);
87  printf(ANSI_COLOR_RESET);
88 #endif
89 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE
template<typename matrix >
void robotis_manipulator::log::print_matrix ( matrix &  m,
uint8_t  decimal_point = 3 
)

print_matrix

Parameters
m
decimal_point

Definition at line 256 of file robotis_manipulator_log.h.

257  {
258  #if defined(__OPENCR__)
259 
260  for (uint8_t i = 0; i < m.rows(); i++)
261  {
262  if(i == 0)
263  DEBUG.print("(");
264  else
265  DEBUG.print(" ");
266  for (uint8_t j = 0; j < m.cols(); j++)
267  {
268  DEBUG.print(m(i, j), decimal_point);
269  if(j != m.cols()-1)
270  DEBUG.print(", ");
271  }
272  if(i != m.rows()-1)
273  DEBUG.println("");
274  else
275  DEBUG.println(")");
276  }
277  #else
278 
279  for (uint8_t i = 0; i < m.rows(); i++)
280  {
281  if(i == 0)
282  printf("(");
283  else
284  printf(" ");
285  for (uint8_t j = 0; j < m.cols(); j++)
286  {
287  printf("%.*lf", decimal_point, m(i, j));
288  if(j != m.cols()-1)
289  printf(", ");
290  }
291  if(i != m.rows()-1)
292  printf("\n");
293  else
294  printf(")\n");
295  }
296  #endif
297  }

Here is the caller graph for this function:

template<typename T >
void robotis_manipulator::log::print_vector ( std::vector< T > &  vec,
uint8_t  decimal_point = 3 
)

print_vector

Parameters
vec
decimal_point

Definition at line 196 of file robotis_manipulator_log.h.

197  {
198  #if defined(__OPENCR__)
199  DEBUG.print("(");
200  for (uint8_t i = 0; i < vec.size(); i++)
201  {
202  DEBUG.print(vec.at(i), decimal_point);
203  if(i != vec.size()-1)
204  DEBUG.print(", ");
205  else
206  DEBUG.println(")");
207  }
208  #else
209  printf("(");
210  for (uint8_t i = 0; i < vec.size(); i++)
211  {
212  printf("%.*lf", decimal_point, vec.at(i));
213  if(i != vec.size()-1)
214  printf(", ");
215  else
216  printf(")\n");
217  }
218  #endif
219  }

Here is the caller graph for this function:

template<typename vector >
void robotis_manipulator::log::print_vector ( vector &  vec,
uint8_t  decimal_point = 3 
)

print_vector

Parameters
vec
decimal_point

Definition at line 226 of file robotis_manipulator_log.h.

227  {
228  #if defined(__OPENCR__)
229  DEBUG.print("(");
230  for (uint8_t i = 0; i < vec.size(); i++)
231  {
232  DEBUG.print(vec(i), decimal_point);
233  if(i != vec.size()-1)
234  DEBUG.print(", ");
235  else
236  DEBUG.println(")");
237  }
238  #else
239  printf("(");
240  for (uint8_t i = 0; i < vec.size(); i++)
241  {
242  printf("%.*lf", decimal_point, vec(i));
243  if(i != vec.size()-1)
244  printf(", ");
245  else
246  printf(")\n");
247  }
248  #endif
249  }
void robotis_manipulator::log::println ( STRING  str,
STRING  color = "DEFAULT" 
)

println

Parameters
str
color

Definition at line 92 of file robotis_manipulator_log.cpp.

93 {
94 #if defined(__OPENCR__)
95  DEBUG.println(str);
96 #else
97  if(color == "RED") printf(ANSI_COLOR_RED);
98  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
99  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
100  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
101  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
102  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
103  printf("%s\n", str.c_str());
104  printf(ANSI_COLOR_RESET);
105 #endif
106 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE

Here is the caller graph for this function:

void robotis_manipulator::log::println ( STRING  str,
double  data,
uint8_t  decimal_point = 3,
STRING  color = "DEFAULT" 
)

println

Parameters
str
data
decimal_point
color

Definition at line 107 of file robotis_manipulator_log.cpp.

108 {
109 #if defined(__OPENCR__)
110  DEBUG.print(str);
111  DEBUG.println(data, decimal_point);
112 #else
113  if(color == "RED") printf(ANSI_COLOR_RED);
114  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
115  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
116  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
117  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
118  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
119  printf("%s %.*lf\n", str.c_str(), decimal_point, data);
120  printf(ANSI_COLOR_RESET);
121 #endif
122 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE
void robotis_manipulator::log::println ( const char *  str,
STRING  color = "DEFAULT" 
)

println

Parameters
str
color

Definition at line 123 of file robotis_manipulator_log.cpp.

124 {
125 #if defined(__OPENCR__)
126  DEBUG.println(str);
127 #else
128  if(color == "RED") printf(ANSI_COLOR_RED);
129  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
130  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
131  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
132  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
133  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
134  printf("%s\n", str);
135  printf(ANSI_COLOR_RESET);
136 #endif
137 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE
void robotis_manipulator::log::println ( const char *  str,
double  data,
uint8_t  decimal_point = 3,
STRING  color = "DEFAULT" 
)

println

Parameters
str
data
decimal_point
color

Definition at line 138 of file robotis_manipulator_log.cpp.

139 {
140 #if defined(__OPENCR__)
141  DEBUG.print(str);
142  DEBUG.println(data, decimal_point);
143 #else
144  if(color == "RED") printf(ANSI_COLOR_RED);
145  else if(color == "GREEN") printf(ANSI_COLOR_GREEN);
146  else if(color == "YELLOW") printf(ANSI_COLOR_YELLOW);
147  else if(color == "BLUE") printf(ANSI_COLOR_BLUE);
148  else if(color == "MAGENTA") printf(ANSI_COLOR_MAGENTA);
149  else if(color == "CYAN") printf(ANSI_COLOR_CYAN);
150  printf("%s %.*lf\n", str, decimal_point, data);
151  printf(ANSI_COLOR_RESET);
152 #endif
153 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RED
#define ANSI_COLOR_GREEN
#define ANSI_COLOR_CYAN
#define ANSI_COLOR_RESET
#define ANSI_COLOR_MAGENTA
#define ANSI_COLOR_BLUE
void robotis_manipulator::log::warn ( STRING  str)

warn

Parameters
str

Definition at line 193 of file robotis_manipulator_log.cpp.

194 {
195 #if defined(__OPENCR__)
196  DEBUG.print("[WARN] ");
197  DEBUG.println(str);
198 #else
199  printf(ANSI_COLOR_YELLOW);
200  printf("[WARN] %s\n", str.c_str());
201  printf(ANSI_COLOR_RESET);
202 #endif
203 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RESET
void robotis_manipulator::log::warn ( STRING  str,
double  data,
uint8_t  decimal_point = 3 
)

warn

Parameters
str
data
decimal_point

Definition at line 204 of file robotis_manipulator_log.cpp.

205 {
206 #if defined(__OPENCR__)
207  DEBUG.print("[WARN] ");
208  DEBUG.print(str);
209  DEBUG.println(data, decimal_point);
210 #else
211  printf(ANSI_COLOR_YELLOW);
212  printf("[WARN] %s %.*lf\n",str.c_str(), decimal_point, data);
213  printf(ANSI_COLOR_RESET);
214 #endif
215 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RESET
void robotis_manipulator::log::warn ( const char *  str)

warn

Parameters
str

Definition at line 216 of file robotis_manipulator_log.cpp.

217 {
218 #if defined(__OPENCR__)
219  DEBUG.print("[WARN] ");
220  DEBUG.println(str);
221 #else
222  printf(ANSI_COLOR_YELLOW);
223  printf("[WARN] %s\n", str);
224  printf(ANSI_COLOR_RESET);
225 #endif
226 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RESET
void robotis_manipulator::log::warn ( const char *  str,
double  data,
uint8_t  decimal_point = 3 
)

warn

Parameters
str
data
decimal_point

Definition at line 227 of file robotis_manipulator_log.cpp.

228 {
229 #if defined(__OPENCR__)
230  DEBUG.print("[WARN] ");
231  DEBUG.print(str);
232  DEBUG.println(data, decimal_point);
233 #else
234  printf(ANSI_COLOR_YELLOW);
235  printf("[WARN] %s %.*lf\n", str, decimal_point, data);
236  printf(ANSI_COLOR_RESET);
237 #endif
238 }
#define ANSI_COLOR_YELLOW
#define ANSI_COLOR_RESET