MapRepSingleMap.h
Go to the documentation of this file.
1 //=================================================================================================
2 // Copyright (c) 2011, Stefan Kohlbrecher, TU Darmstadt
3 // All rights reserved.
4 
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 // * Neither the name of the Simulation, Systems Optimization and Robotics
13 // group, TU Darmstadt nor the names of its contributors may be used to
14 // endorse or promote products derived from this software without
15 // specific prior written permission.
16 
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //=================================================================================================
28 
29 #ifndef _hectormaprepsinglemap_h__
30 #define _hectormaprepsinglemap_h__
31 
33 
34 #include "../map/GridMap.h"
35 #include "../map/OccGridMapUtilConfig.h"
36 #include "../matcher/ScanMatcher.h"
37 
38 #include "../util/DrawInterface.h"
39 #include "../util/HectorDebugInfoInterface.h"
40 
41 namespace hectorslam{
42 
44 {
45 
46 public:
47  MapRepSingleMap(float mapResolution, DrawInterface* drawInterfaceIn, HectorDebugInfoInterface* debugInterfaceIn)
48  {
49  gridMap = new hectorslam::GridMap(mapResolution,Eigen::Vector2i(1024,1024), Eigen::Vector2f(20.0f, 20.0f));
51  scanMatcher = new hectorslam::ScanMatcher<OccGridMapUtilConfig<GridMap> >(drawInterfaceIn, debugInterfaceIn);
52  }
53 
54  virtual ~MapRepSingleMap()
55  {
56  delete gridMap;
57  delete gridMapUtil;
58  delete scanMatcher;
59  }
60 
61  virtual void reset()
62  {
63  gridMap->reset();
64  gridMapUtil->resetCachedData();
65  }
66 
67  virtual float getScaleToMap() const { return gridMap->getScaleToMap(); };
68 
69  virtual int getMapLevels() const { return 1; };
70  virtual const GridMap& getGridMap(int mapLevel) const { return *gridMap; };
71 
72  virtual void onMapUpdated()
73  {
74  gridMapUtil->resetCachedData();
75  }
76 
77  virtual Eigen::Vector3f matchData(const Eigen::Vector3f& beginEstimateWorld, const DataContainer& dataContainer, Eigen::Matrix3f& covMatrix)
78  {
79  return scanMatcher->matchData(beginEstimateWorld, *gridMapUtil, dataContainer, covMatrix, 20);
80  }
81 
82  virtual void updateByScan(const DataContainer& dataContainer, const Eigen::Vector3f& robotPoseWorld)
83  {
84  gridMap->updateByScan(dataContainer, robotPoseWorld);
85  }
86 
87 protected:
91 };
92 
93 }
94 
95 #endif
96 
97 
void updateByScan(const DataContainer &dataContainer, const Eigen::Vector3f &robotPoseWorld)
f
float getScaleToMap() const
Definition: GridMapBase.h:287
MapRepSingleMap(float mapResolution, DrawInterface *drawInterfaceIn, HectorDebugInfoInterface *debugInterfaceIn)
virtual void reset()
Definition: GridMapBase.h:69
virtual float getScaleToMap() const
OccGridMapUtilConfig< GridMap > * gridMapUtil
virtual Eigen::Vector3f matchData(const Eigen::Vector3f &beginEstimateWorld, const DataContainer &dataContainer, Eigen::Matrix3f &covMatrix)
virtual void updateByScan(const DataContainer &dataContainer, const Eigen::Vector3f &robotPoseWorld)
OccGridMapBase< LogOddsCell, GridMapLogOddsFunctions > GridMap
Definition: GridMap.h:39
ScanMatcher< OccGridMapUtilConfig< GridMap > > * scanMatcher
virtual const GridMap & getGridMap(int mapLevel) const
virtual int getMapLevels() const


hector_mapping
Author(s): Stefan Kohlbrecher
autogenerated on Sun Nov 3 2019 03:18:33