SetBasicLayersFilter.cpp
Go to the documentation of this file.
1 /*
2  * SetBasicLayersFilters.cpp
3  *
4  * Created on: Aug 16, 2017
5  * Author: Peter Fankhauser
6  * Institute: ETH Zurich, ANYbotics
7  */
8 
9 #include "../include/grid_map_filters/SetBasicLayersFilter.hpp"
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  if (!FilterBase<T>::getParam(std::string("layers"), layers_)) {
32  ROS_ERROR("SetBasicLayersFilters did not find parameter 'layers'.");
33  return false;
34  }
35 
36  return true;
37 }
38 
39 template<typename T>
40 bool SetBasicLayersFilter<T>::update(const T& mapIn, T& mapOut)
41 {
42  mapOut = mapIn;
43  std::vector<std::string> layersChecked;
44 
45  for (const auto& layer : layers_) {
46  if (!mapOut.exists(layer)) {
47  ROS_WARN("Layer `%s` does not exist and is not set as basic layer.", layer.c_str());
48  continue;
49  }
50  layersChecked.push_back(layer);
51  }
52 
53  mapOut.setBasicLayers(layersChecked);
54  return true;
55 }
56 
57 } /* namespace */
58 
#define ROS_WARN(...)
#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