7 #ifndef MRPT_BRIDGE_UTILS_H 8 #define MRPT_BRIDGE_UTILS_H 11 #include <mrpt/system/datetime.h> 12 #include <mrpt/poses/CPose3D.h> 13 #include <mrpt/version.h> 14 #include <log4cxx/logger.h> 16 #if MRPT_VERSION>=0x199 17 #include <mrpt/system/COutputLogger.h> 20 #include <mrpt/utils/COutputLogger.h> 32 using namespace log4cxx;
35 VerbosityLevel mrpt_lvl;
37 if (lvl == Level::getFatal() || lvl == Level::getError())
41 else if (lvl == Level::getWarn())
45 else if (lvl == Level::getInfo())
49 else if (lvl == Level::getDebug())
55 THROW_EXCEPTION(
"Unknown log4cxx::Level is given.");
70 const std::string& msg,
const VerbosityLevel level,
71 const std::string& loggerName,
const mrpt::system::TTimeStamp timestamp)
74 std::string tmsg = msg;
76 tmsg.compare(tmsg.length() - 1, tmsg.length(),
"\n") == 0)
78 tmsg.erase(tmsg.end() - 1);
81 if (level == LVL_DEBUG)
85 else if (level == LVL_INFO)
89 else if (level == LVL_WARN)
93 else if (level == LVL_ERROR)
99 const std::string& msg,
const VerbosityLevel level,
100 const std::string& loggerName,
const mrpt::system::TTimeStamp timestamp,
106 inline mrpt::math::TPose3D
p2t(
const mrpt::poses::CPose3D &p)
108 #if MRPT_VERSION>=0x199 117 #endif // MRPT_BRIDGE_UTILS_H
File includes methods for converting CNetworkOfPoses*DInf <=> NetworkOfPoses message types...
mrpt::math::TPose3D p2t(const mrpt::poses::CPose3D &p)
VerbosityLevel rosLoggerLvlToMRPTLoggerLvl(log4cxx::LevelPtr lvl)
function that converts ROS verbosity level log4cxx::Level to MRPT equivalent MRPT's VerbosityLevel ...
void mrptToROSLoggerCallback(const std::string &msg, const VerbosityLevel level, const std::string &loggerName, const mrpt::system::TTimeStamp timestamp)
callback that is called by MRPT mrpt::utils::COuputLogger to redirect log messages to ROS logger...
void mrptToROSLoggerCallback_mrpt_15(const std::string &msg, const VerbosityLevel level, const std::string &loggerName, const mrpt::system::TTimeStamp timestamp, void *userParam)