Main Page
Namespaces
Classes
Files
File List
File Members
src
MockFilter.cpp
Go to the documentation of this file.
1
/*
2
* MockFilter.cpp
3
*
4
* Created on: Sep 24, 2020
5
* Author: Magnus Gärtner
6
* Institute: ETH Zurich, ANYbotics
7
*/
8
9
#include <
grid_map_core/GridMap.hpp
>
10
#include <
pluginlib/class_list_macros.h
>
11
#include <thread>
12
#include <chrono>
13
14
#include "
grid_map_filters/MockFilter.hpp
"
15
16
using namespace
filters
;
17
18
namespace
grid_map
{
19
20
template
<
typename
T>
21
MockFilter<T>::MockFilter
()
22
{
23
}
24
25
template
<
typename
T>
26
MockFilter<T>::~MockFilter
()
27
{
28
}
29
30
template
<
typename
T>
31
bool
MockFilter<T>::configure
()
32
{
33
if
(!
FilterBase<T>::getParam
(std::string(
"processing_time"
), processingTime_)) {
34
ROS_ERROR
(
"MockFilter did not find parameter 'processing_time'."
);
35
return
false
;
36
}
37
38
if
(!
FilterBase<T>::getParam
(std::string(
"print_name"
), printName_)) {
39
ROS_INFO
(
"MockFilter did not find parameter 'print_name'. Not printing the name. "
);
40
printName_ =
false
;
41
}
42
43
return
true
;
44
}
45
46
template
<
typename
T>
47
bool
MockFilter<T>::update
(
const
T& mapIn, T& mapOut)
48
{
49
mapOut = mapIn;
50
if
(printName_){
51
ROS_INFO_STREAM
(this->
getName
()<<
": update()"
);
52
}
53
std::this_thread::sleep_for(std::chrono::milliseconds(processingTime_));
54
return
true
;
55
}
56
57
}
/* namespace */
58
59
PLUGINLIB_EXPORT_CLASS
(
grid_map::MockFilter<grid_map::GridMap>
,
filters::FilterBase<grid_map::GridMap>
)
filters::FilterBase
grid_map::MockFilter
Definition:
MockFilter.hpp:21
getName
std::string getName(void *handle)
GridMap.hpp
grid_map
class_list_macros.h
ROS_INFO
#define ROS_INFO(...)
MockFilter.hpp
filters
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
ROS_ERROR
#define ROS_ERROR(...)
grid_map_filters
Author(s): Péter Fankhauser
, Martin Wermelinger
autogenerated on Tue Jun 1 2021 02:13:38