Main Page
Namespaces
Classes
Files
File List
File Members
src
DeletionFilter.cpp
Go to the documentation of this file.
1
/*
2
* DeletionFilter.cpp
3
*
4
* Created on: Mar 19, 2015
5
* Author: Martin Wermelinger, Peter Fankhauser
6
* Institute: ETH Zurich, ANYbotics
7
*/
8
9
#include "
grid_map_filters/DeletionFilter.hpp
"
10
11
#include <
grid_map_core/GridMap.hpp
>
12
#include <
pluginlib/class_list_macros.h
>
13
14
using namespace
filters
;
15
16
namespace
grid_map
{
17
18
template
<
typename
T>
19
DeletionFilter<T>::DeletionFilter
()
20
{
21
}
22
23
template
<
typename
T>
24
DeletionFilter<T>::~DeletionFilter
()
25
{
26
}
27
28
template
<
typename
T>
29
bool
DeletionFilter<T>::configure
()
30
{
31
// Load Parameters
32
if
(!
FilterBase<T>::getParam
(std::string(
"layers"
), layers_)) {
33
ROS_ERROR
(
"DeletionFilter did not find parameter 'layers'."
);
34
return
false
;
35
}
36
37
return
true
;
38
}
39
40
template
<
typename
T>
41
bool
DeletionFilter<T>::update
(
const
T& mapIn, T& mapOut)
42
{
43
mapOut = mapIn;
44
45
for
(
const
auto
& layer : layers_) {
46
// Check if layer exists.
47
if
(!mapOut.exists(layer)) {
48
ROS_ERROR
(
"Check your deletion layers! Type %s does not exist."
,
49
layer.c_str());
50
continue
;
51
}
52
53
if
(!mapOut.erase(layer)) {
54
ROS_ERROR
(
"Could not remove type %s."
, layer.c_str());
55
}
56
}
57
58
return
true
;
59
}
60
61
}
/* namespace */
62
63
PLUGINLIB_EXPORT_CLASS
(
grid_map::DeletionFilter<grid_map::GridMap>
,
filters::FilterBase<grid_map::GridMap>
)
filters::FilterBase
GridMap.hpp
DeletionFilter.hpp
grid_map
grid_map::DeletionFilter
Definition:
DeletionFilter.hpp:22
class_list_macros.h
filters
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