SpiralIterator.hpp
Go to the documentation of this file.
00001 /*
00002  * SpiralIterator.hpp
00003  *
00004  *  Created on: Jul 7, 2015
00005  *      Author: Martin Wermelinger
00006  *   Institute: ETH Zurich, ANYbotics
00007  */
00008 
00009 #pragma once
00010 
00011 #include "grid_map_core/GridMap.hpp"
00012 
00013 #include <Eigen/Core>
00014 #include <memory>
00015 #include <vector>
00016 
00017 namespace grid_map {
00018 
00022 class SpiralIterator
00023 {
00024 public:
00025 
00032   SpiralIterator(const grid_map::GridMap& gridMap, const Eigen::Vector2d& center, const double radius);
00033 
00039   SpiralIterator& operator =(const SpiralIterator& other);
00040 
00045   bool operator !=(const SpiralIterator& other) const;
00046 
00051   const Eigen::Array2i& operator *() const;
00052 
00057   SpiralIterator& operator ++();
00058 
00063   bool isPastEnd() const;
00064 
00069   double getCurrentRadius() const;
00070 
00071 private:
00072 
00077   bool isInside(const Index index) const;
00078 
00083   void generateRing();
00084 
00085   int signum(const int val) {
00086       return (0 < val) - (val < 0);
00087   }
00088 
00090   Position center_;
00091   Index indexCenter_;
00092 
00093 
00095   double radius_;
00096 
00098   double radiusSquare_;
00099 
00101   unsigned int nRings_;
00102   unsigned int distance_;
00103   std::vector<Index> pointsRing_;
00104 
00106   Length mapLength_;
00107   Position mapPosition_;
00108   double resolution_;
00109   Size bufferSize_;
00110 
00111  public:
00112   EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00113 };
00114 
00115 } /* namespace */


grid_map_core
Author(s): P├ęter Fankhauser
autogenerated on Tue Jul 9 2019 05:06:13