DebugHelper.hpp
Go to the documentation of this file.
1 
20 #pragma once
21 
22 #include <ros/ros.h>
23 #include <string>
24 #include <sstream>
25 #include <vector>
26 
27 namespace next_best_view {
28 
32 class DebugHelper {
33 
34 public:
35 
36  enum DebugLevel {
41  RATING = 16,
43  MAP = 64,
44  FILTER = 128,
45  IK_RATING = 256,
48  WORLD = 2048,
49  VOXEL_GRID = 4096
50  };
51 
52 private:
53 
58  static const int NONE = 0;
59 
61  unsigned int mLevels;
62 
63 public:
64 
66 
72  void write(const char * text, DebugLevel level);
73 
79  void write(const std::string &text, DebugLevel level);
80 
86  void write(const std::ostream &text, DebugLevel level);
87 
93  void writeNoticeably(const char * text, DebugLevel level);
94 
100  void writeNoticeably(const std::string &text, DebugLevel level);
101 
107  void writeNoticeably(const std::ostream &text, DebugLevel level);
108 
113  unsigned int getLevel();
114 
119  std::string getLevelString();
120 
121 
126  void setLevels(std::string levelsStr);
127 
131  void setLevels();
132 
133 private:
134 
135  DebugHelper();
136 
142  static int parseLevels(std::vector<std::string> levels);
143 
149  static void addToString(std::string& s, const std::string& add);
150 
157  bool checkLevel(DebugLevel level);
158 
159 };
160 
162 }
ros::NodeHandle mNodeHandle
Definition: DebugHelper.hpp:60
std::string getLevelString()
returns the debug levels that are set as string
Definition: DebugHelper.cpp:91
void write(const char *text, DebugLevel level)
writes the text to the console if it has a level that allows it
Definition: DebugHelper.cpp:40
bool checkLevel(DebugLevel level)
checks whether the given level is allowed
this namespace contains all generally usable classes.
void writeNoticeably(const char *text, DebugLevel level)
writes the text noticeably to the console if it has a level that allows it
Definition: DebugHelper.cpp:61
static boost::shared_ptr< DebugHelper > getInstance()
Definition: DebugHelper.cpp:29
void setLevels()
sets the allowed debug levels
The DebugHelper class is responsible for debug output.
Definition: DebugHelper.hpp:32
boost::shared_ptr< DebugHelper > DebugHelperPtr
static void addToString(std::string &s, const std::string &add)
adds a string to a given string s. Puts a comma between them if the string s has a size bigger than 0...
static boost::shared_ptr< DebugHelper > instancePtr
Definition: DebugHelper.hpp:54
unsigned int getLevel()
returns the debug level that is set
Definition: DebugHelper.cpp:86
static int parseLevels(std::vector< std::string > levels)
parses the level list to the corresponding integer


asr_next_best_view
Author(s): Aumann Florian, Borella Jocelyn, Heller Florian, Meißner Pascal, Schleicher Ralf, Stöckle Patrick, Stroh Daniel, Trautmann Jeremias, Walter Milena, Wittenbeck Valerij
autogenerated on Thu Jan 9 2020 07:20:18