SLAMScanWrapper.hpp
Go to the documentation of this file.
1 
34 #ifndef SLAMSCANWRAPPER_HPP_
35 #define SLAMSCANWRAPPER_HPP_
36 
37 #include "lvr2/types/ScanTypes.hpp"
38 
39 #include <Eigen/Dense>
40 #include <vector>
41 
42 namespace lvr2
43 {
44 
48 enum class FrameUse
49 {
51  INVALID = 0,
53  UPDATED = 1,
55  UNUSED = 2,
57  GRAPHSLAM = 3,
59  LOOPCLOSE = 4,
60 };
61 
66 {
67 public:
74 
75  virtual ~SLAMScanWrapper() = default;
76 
82  ScanPtr innerScan();
83 
84 
92  virtual void transform(const Transformd& transform, bool writeFrame = true, FrameUse use = FrameUse::UPDATED);
93 
99  void addFrame(FrameUse use = FrameUse::UNUSED);
100 
101 
110  void reduce(double voxelSize, int maxLeafSize);
111 
119  void setMinDistance(double minDistance);
120 
128  void setMaxDistance(double maxDistance);
129 
133  void trim();
134 
135 
142  virtual Vector3d point(size_t index) const;
143 
150  const Vector3f& rawPoint(size_t index) const;
151 
157  size_t numPoints() const;
158 
159 
165  const Transformd& pose() const;
166 
172  const Transformd& deltaPose() const;
173 
179  const Transformd& initialPose() const;
180 
186  Vector3d getPosition() const;
187 
193  size_t frameCount() const;
194 
201  const std::pair<Transformd, FrameUse>& frame(size_t index) const;
202 
208  void writeFrames(std::string path) const;
209 
210 protected:
212 
213  std::vector<Vector3f> m_points;
214  size_t m_numPoints;
215 
217 
218  std::vector<std::pair<Transformd, FrameUse>> m_frames;
219 };
220 
221 using SLAMScanPtr = std::shared_ptr<SLAMScanWrapper>;
222 
223 } /* namespace lvr2 */
224 
225 #endif /* SLAMSCANWRAPPER_HPP_ */
The Scan did not change since the last Frame.
The Scan was part of a GraphSLAM Iteration.
The Scan changed since the last Frame.
Eigen::Vector3d Vector3d
Eigen 3D vector, double precision.
std::shared_ptr< Scan > ScanPtr
Shared pointer to scans.
Definition: ScanTypes.hpp:98
Transform< double > Transformd
4x4 double precision transformation matrix
Definition: MatrixTypes.hpp:71
The Scan has not been registered yet.
std::vector< Vector3f > m_points
Eigen::Vector3f Vector3f
Eigen 3D vector, single precision.
A Wrapper around Scan to allow for SLAM usage.
The Scan was part of a Loopclose Iteration.
std::shared_ptr< SLAMScanWrapper > SLAMScanPtr
void writeFrame(const Transform< T > &transform, const boost::filesystem::path &framesOut)
Writes a Eigen transformation into a .frames file.
std::vector< std::pair< Transformd, FrameUse > > m_frames
PointBufferPtr transform(PointBufferPtr pc_in, const Transformd &T)
Definition: qttf.cpp:32
FrameUse
Annotates the use of a Scan when creating an slam6D .frames file.


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:09