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 
11 #include <thread>
12 #include <chrono>
13 
15 
16 using namespace filters;
17 
18 namespace grid_map {
19 
20 template<typename T>
22 {
23 }
24 
25 template<typename T>
27 {
28 }
29 
30 template<typename T>
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 
std::string getName(void *handle)
#define ROS_INFO(...)
#define ROS_INFO_STREAM(args)
#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