00001 /* 00002 * NormalVectorsFilter.hpp 00003 * 00004 * Created on: May 05, 2015 00005 * Author: Peter Fankhauser, Martin Wermelinger 00006 * Institute: ETH Zurich, Robotic Systems Lab 00007 */ 00008 00009 #pragma once 00010 00011 #include <filters/filter_base.h> 00012 #include <grid_map_core/grid_map_core.hpp> 00013 00014 #include <Eigen/Core> 00015 #include <string> 00016 00017 namespace grid_map { 00018 00022 template<typename T> 00023 class NormalVectorsFilter : public filters::FilterBase<T> 00024 { 00025 00026 public: 00030 NormalVectorsFilter(); 00031 00035 virtual ~NormalVectorsFilter(); 00036 00040 virtual bool configure(); 00041 00048 virtual bool update(const T& mapIn, T& mapOut); 00049 00050 private: 00051 00052 void computeWithArea(GridMap& map, const std::string& inputLayer, const std::string& outputLayersPrefix); 00053 void computeWithRaster(GridMap& map, const std::string& inputLayer, const std::string& outputLayersPrefix); 00054 00055 enum class Method { 00056 Area, 00057 Raster 00058 }; 00059 00060 Method method_; 00061 00063 double estimationRadius_; 00064 00066 Eigen::Vector3d normalVectorPositiveAxis_; 00067 00069 std::string inputLayer_; 00070 00072 std::string outputLayersPrefix_; 00073 }; 00074 00075 } /* namespace */