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 
10 
13 
14 using namespace filters;
15 
16 namespace grid_map {
17 
18 template<typename T>
20 {
21 }
22 
23 template<typename T>
25 {
26 }
27 
28 template<typename T>
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 
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
#define ROS_ERROR(...)


grid_map_filters
Author(s): P├ęter Fankhauser , Martin Wermelinger
autogenerated on Fri Feb 19 2021 03:15:18