include
rtabmap_ros
ULogToRosout.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2010-2022, Mathieu Labbe
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
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright
10
notice, this list of conditions and the following disclaimer in the
11
documentation and/or other materials provided with the distribution.
12
* Neither the names of its contributors may be used to endorse or promote products
13
derived from this software without specific prior written permission.
14
15
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
19
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
*/
26
27
#include <
ros/ros.h
>
28
#include <
rtabmap/utilite/UEventsHandler.h
>
29
30
namespace
rtabmap_ros
{
31
32
class
ULogToRosout
:
public
UEventsHandler
33
{
34
public
:
35
ULogToRosout
()
36
{
37
registerToEventsManager
();
38
}
39
virtual
~ULogToRosout
()
40
{
41
unregisterFromEventsManager
();
42
}
43
protected
:
44
virtual
bool
handleEvent
(
UEvent
* event)
45
{
46
if
(event->
getClassName
().compare(
"ULogEvent"
) == 0)
47
{
48
ULogEvent
* logEvent = (
ULogEvent
*)event;
49
if
(logEvent->
getCode
() ==
ULogger::kDebug
)
50
{
51
ROS_DEBUG
(
"%s"
, logEvent->
getMsg
().c_str());
52
}
53
else
if
(logEvent->
getCode
() ==
ULogger::kInfo
)
54
{
55
ROS_INFO
(
"%s"
, logEvent->
getMsg
().c_str());
56
}
57
else
if
(logEvent->
getCode
() ==
ULogger::kWarning
)
58
{
59
ROS_WARN
(
"%s"
, logEvent->
getMsg
().c_str());
60
}
61
else
if
(logEvent->
getCode
() ==
ULogger::kError
)
62
{
63
ROS_ERROR
(
"%s"
, logEvent->
getMsg
().c_str());
64
}
65
else
if
(logEvent->
getCode
() ==
ULogger::kFatal
)
66
{
67
ROS_FATAL
(
"%s"
, logEvent->
getMsg
().c_str());
68
}
69
return
true
;
70
}
71
return
false
;
72
}
73
};
74
75
}
ROS_FATAL
#define ROS_FATAL(...)
ULogger::kInfo
kInfo
UEvent
rtabmap_ros::ULogToRosout
Definition:
ULogToRosout.h:32
ULogger::kFatal
kFatal
rtabmap_ros
Definition:
CommonDataSubscriber.h:57
ROS_WARN
#define ROS_WARN(...)
UEvent::getCode
int getCode() const
UEventsHandler.h
UEventsHandler
UEvent::getClassName
virtual std::string getClassName() const=0
ULogEvent::getMsg
const std::string & getMsg() const
ROS_INFO
#define ROS_INFO(...)
ULogger::kError
kError
rtabmap_ros::ULogToRosout::~ULogToRosout
virtual ~ULogToRosout()
Definition:
ULogToRosout.h:39
rtabmap_ros::ULogToRosout::handleEvent
virtual bool handleEvent(UEvent *event)
Definition:
ULogToRosout.h:44
ULogger::kDebug
kDebug
UEventsHandler::registerToEventsManager
void registerToEventsManager()
ros.h
ULogEvent
UEventsHandler::unregisterFromEventsManager
void unregisterFromEventsManager()
ROS_ERROR
#define ROS_ERROR(...)
ULogger::kWarning
kWarning
ROS_DEBUG
#define ROS_DEBUG(...)
rtabmap_ros::ULogToRosout::ULogToRosout
ULogToRosout()
Definition:
ULogToRosout.h:35
rtabmap_ros
Author(s): Mathieu Labbe
autogenerated on Tue Jan 24 2023 04:04:40