PointMatcher.h
Go to the documentation of this file.
1 // kate: replace-tabs off; indent-width 4; indent-mode normal
2 // vim: ts=4:sw=4:noexpandtab
3 /*
4 
5 Copyright (c) 2010--2012,
6 Francois Pomerleau and Stephane Magnenat, ASL, ETHZ, Switzerland
7 You can contact the authors at <f dot pomerleau at gmail dot com> and
8 <stephane at magnenat dot net>
9 
10 All rights reserved.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright
15  notice, this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright
17  notice, this list of conditions and the following disclaimer in the
18  documentation and/or other materials provided with the distribution.
19  * Neither the name of the <organization> nor the
20  names of its contributors may be used to endorse or promote products
21  derived from this software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 DISCLAIMED. IN NO EVENT SHALL ETH-ASL BE LIABLE FOR ANY
27 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #ifndef __POINTMATCHER_CORE_H
37 #define __POINTMATCHER_CORE_H
38 
39 #ifndef EIGEN_USE_NEW_STDVECTOR
40 #define EIGEN_USE_NEW_STDVECTOR
41 #endif // EIGEN_USE_NEW_STDVECTOR
42 //#define EIGEN2_SUPPORT
43 
44 //TODO: investigate if that causes more problems down the road
45 #define EIGEN_NO_DEBUG
46 
47 #include "Eigen/StdVector"
48 #include "Eigen/Core"
49 #include "Eigen/Geometry"
50 
51 
52 #include <boost/thread/mutex.hpp>
53 
54 #include <stdexcept>
55 #include <limits>
56 #include <iostream>
57 #include <ostream>
58 #include <memory>
59 //#include <cstdint>
60 #include <boost/cstdint.hpp>
61 
62 #include "DeprecationWarnings.h"
63 #include "Parametrizable.h"
64 #include "Registrar.h"
65 
72 #define POINTMATCHER_VERSION "1.3.1"
74 #define POINTMATCHER_VERSION_INT 10301
76 
78 namespace PointMatcherSupport
79 {
80  // TODO: gather all exceptions
81 
83  struct InvalidModuleType: std::runtime_error
84  {
85  InvalidModuleType(const std::string& reason);
86  };
87 
89  struct TransformationError: std::runtime_error
90  {
92  TransformationError(const std::string& reason);
93  };
94 
96  struct ConfigurationError: std::runtime_error
97  {
99  ConfigurationError(const std::string& reason);
100  };
101 
102 
104  struct Logger: public Parametrizable
105  {
106  Logger();
107  Logger(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
108 
109  virtual ~Logger();
110  virtual bool hasInfoChannel() const;
111  virtual void beginInfoEntry(const char *file, unsigned line, const char *func);
112  virtual std::ostream* infoStream();
113  virtual void finishInfoEntry(const char *file, unsigned line, const char *func);
114  virtual bool hasWarningChannel() const;
115  virtual void beginWarningEntry(const char *file, unsigned line, const char *func);
116  virtual std::ostream* warningStream();
117  virtual void finishWarningEntry(const char *file, unsigned line, const char *func);
118  };
119 
120  void setLogger(std::shared_ptr<Logger> newLogger);
121 
122  void validateFile(const std::string& fileName);
123 
125  typedef std::map<std::string, std::vector<std::string> > CsvElements;
126 }
127 
129 template<typename T>
131 {
132  // ---------------------------------
133  // macros for constants
134  // ---------------------------------
135 
137  #define ZERO_PLUS_EPS (0. + std::numeric_limits<double>::epsilon())
138  #define ONE_MINUS_EPS (1. - std::numeric_limits<double>::epsilon())
140 
141  // ---------------------------------
142  // exceptions
143  // ---------------------------------
144 
145  //TODO: gather exceptions here and in Exceptions.cpp
146 
148  struct ConvergenceError: std::runtime_error
149  {
150  ConvergenceError(const std::string& reason);
151  };
152 
153 
154  // ---------------------------------
155  // eigen and nabo-based types
156  // ---------------------------------
157 
159  typedef T ScalarType;
161  typedef typename Eigen::Matrix<T, Eigen::Dynamic, 1> Vector;
163  typedef std::vector<Vector, Eigen::aligned_allocator<Vector> > VectorVector;
165  typedef typename Eigen::Quaternion<T> Quaternion;
167  typedef std::vector<Quaternion, Eigen::aligned_allocator<Quaternion> > QuaternionVector;
169  typedef typename Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> Matrix;
171  typedef typename Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> IntMatrix;
173  typedef typename Eigen::Matrix<std::int64_t, Eigen::Dynamic, Eigen::Dynamic> Int64Matrix;
175  typedef typename Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic> Array;
176 
177 
179 
182  typedef Matrix TransformationParameters;
183 
184  // alias for scope reasons
190 
191  // ---------------------------------
192  // input types
193  // ---------------------------------
194 
196 
207  struct DataPoints
208  {
210  typedef Eigen::Block<Matrix> View;
212  typedef Eigen::Block<Int64Matrix> TimeView;
214  typedef const Eigen::Block<const Matrix> ConstView;
216  typedef const Eigen::Block<const Int64Matrix> TimeConstView;
218  typedef typename Matrix::Index Index;
219 
221  struct Label
222  {
224  size_t span;
225  Label(const std::string& text = "", const size_t span = 0);
226  bool operator ==(const Label& that) const;
227  };
229  struct Labels: std::vector<Label>
230  {
231  typedef typename std::vector<Label>::const_iterator const_iterator;
232  Labels();
233  Labels(const Label& label);
234  bool contains(const std::string& text) const;
235  size_t totalDim() const;
236  friend std::ostream& operator<< (std::ostream& stream, const Labels& labels)
237  {
238  for(size_t i=0; i<labels.size(); i++)
239  {
240  stream << labels[i].text;
241  if(i != (labels.size() -1))
242  stream << ", ";
243  }
244 
245  return stream;
246  };
247  };
248 
250  struct InvalidField: std::runtime_error
251  {
252  InvalidField(const std::string& reason);
253  };
254 
255  // Constructors from descriptions (reserve memory)
256  DataPoints();
257  DataPoints(const Labels& featureLabels, const Labels& descriptorLabels, const size_t pointCount);
258  DataPoints(const Labels& featureLabels, const Labels& descriptorLabels, const Labels& timeLabels, const size_t pointCount);
259 
260  // Copy constructors from partial data
261  DataPoints(const Matrix& features, const Labels& featureLabels);
262  DataPoints(const Matrix& features, const Labels& featureLabels, const Matrix& descriptors, const Labels& descriptorLabels);
263  DataPoints(const Matrix& features, const Labels& featureLabels, const Matrix& descriptors, const Labels& descriptorLabels, const Int64Matrix& times, const Labels& timeLabels);
264 
265  bool operator ==(const DataPoints& that) const;
266 
267  unsigned getNbPoints() const;
268  unsigned getEuclideanDim() const;
269  unsigned getHomogeneousDim() const;
270  unsigned getNbGroupedDescriptors() const;
271  unsigned getDescriptorDim() const;
272  unsigned getTimeDim() const;
273 
274  void save(const std::string& fileName, bool binary = false) const;
275  static DataPoints load(const std::string& fileName);
276 
277  void concatenate(const DataPoints& dp);
278  void conservativeResize(Index pointCount);
279  DataPoints createSimilarEmpty() const;
280  DataPoints createSimilarEmpty(Index pointCount) const;
281  void setColFrom(Index thisCol, const DataPoints& that, Index thatCol);
282  void swapCols(Index iCol,Index jCol);
283 
284  // methods related to features
285  void allocateFeature(const std::string& name, const unsigned dim);
286  void allocateFeatures(const Labels& newLabels);
287  void addFeature(const std::string& name, const Matrix& newFeature);
288  void removeFeature(const std::string& name);
289  Matrix getFeatureCopyByName(const std::string& name) const;
290  ConstView getFeatureViewByName(const std::string& name) const;
291  View getFeatureViewByName(const std::string& name);
292  ConstView getFeatureRowViewByName(const std::string& name, const unsigned row) const;
293  View getFeatureRowViewByName(const std::string& name, const unsigned row);
294  bool featureExists(const std::string& name) const;
295  bool featureExists(const std::string& name, const unsigned dim) const;
296  unsigned getFeatureDimension(const std::string& name) const;
297  unsigned getFeatureStartingRow(const std::string& name) const;
298 
299  // methods related to descriptors
300  void allocateDescriptor(const std::string& name, const unsigned dim);
301  void allocateDescriptors(const Labels& newLabels);
302  void addDescriptor(const std::string& name, const Matrix& newDescriptor);
303  void removeDescriptor(const std::string& name);
304  Matrix getDescriptorCopyByName(const std::string& name) const;
305  ConstView getDescriptorViewByName(const std::string& name) const;
306  View getDescriptorViewByName(const std::string& name);
307  ConstView getDescriptorRowViewByName(const std::string& name, const unsigned row) const;
308  View getDescriptorRowViewByName(const std::string& name, const unsigned row);
309  bool descriptorExists(const std::string& name) const;
310  bool descriptorExists(const std::string& name, const unsigned dim) const;
311  unsigned getDescriptorDimension(const std::string& name) const;
312  unsigned getDescriptorStartingRow(const std::string& name) const;
313  void assertDescriptorConsistency() const;
314 
315  // methods related to times
316  void allocateTime(const std::string& name, const unsigned dim);
317  void allocateTimes(const Labels& newLabels);
318  void addTime(const std::string& name, const Int64Matrix& newTime);
319  void removeTime(const std::string& name);
320  Int64Matrix getTimeCopyByName(const std::string& name) const;
321  TimeConstView getTimeViewByName(const std::string& name) const;
322  TimeView getTimeViewByName(const std::string& name);
323  TimeConstView getTimeRowViewByName(const std::string& name, const unsigned row) const;
324  TimeView getTimeRowViewByName(const std::string& name, const unsigned row);
325  bool timeExists(const std::string& name) const;
326  bool timeExists(const std::string& name, const unsigned dim) const;
327  unsigned getTimeDimension(const std::string& name) const;
328  unsigned getTimeStartingRow(const std::string& name) const;
329  void assertTimesConsistency() const;
330 
331  Matrix features;
333  Matrix descriptors;
335  Int64Matrix times;
337 
338  private:
339  void assertConsistency(const std::string& dataName, const int dataRows, const int dataCols, const Labels& labels) const;
340  template<typename MatrixType>
341  void allocateFields(const Labels& newLabels, Labels& labels, MatrixType& data) const;
342  template<typename MatrixType>
343  void allocateField(const std::string& name, const unsigned dim, Labels& labels, MatrixType& data) const;
344  template<typename MatrixType>
345  void addField(const std::string& name, const MatrixType& newField, Labels& labels, MatrixType& data) const;
346  template<typename MatrixType>
347  void removeField(const std::string& name, Labels& labels, MatrixType& data) const;
348  template<typename MatrixType>
349  const Eigen::Block<const MatrixType> getConstViewByName(const std::string& name, const Labels& labels, const MatrixType& data, const int viewRow = -1) const;
350  template<typename MatrixType>
351  Eigen::Block<MatrixType> getViewByName(const std::string& name, const Labels& labels, MatrixType& data, const int viewRow = -1) const;
352  bool fieldExists(const std::string& name, const unsigned dim, const Labels& labels) const;
353  unsigned getFieldDimension(const std::string& name, const Labels& labels) const;
354  unsigned getFieldStartingRow(const std::string& name, const Labels& labels) const;
355 
356  template<typename MatrixType>
357  void concatenateLabelledMatrix(Labels* labels, MatrixType* data, const Labels extraLabels, const MatrixType extraData);
358  };
359 
360  static void swapDataPoints(DataPoints& a, DataPoints& b);
361 
362  // ---------------------------------
363  // intermediate types
364  // ---------------------------------
365 
367 
371  struct Matches
372  {
373  typedef Matrix Dists;
374  typedef IntMatrix Ids;
375 
376 
377  static constexpr int InvalidId = -1;
378  static constexpr T InvalidDist = std::numeric_limits<T>::infinity();
379 
380  Matches();
381  Matches(const Dists& dists, const Ids ids);
382  Matches(const int knn, const int pointsCount);
383 
384  Dists dists;
385  Ids ids;
386 
387  T getDistsQuantile(const T quantile) const;
388  T getMedianAbsDeviation() const;
389  T getStandardDeviation() const;
390 
391  };
392 
394 
397  typedef Matrix OutlierWeights;
398 
399  // ---------------------------------
400  // types of processing bricks
401  // ---------------------------------
402 
404  struct Transformation: public Parametrizable
405  {
406  Transformation();
407  Transformation(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
408  virtual ~Transformation();
409 
411  virtual DataPoints compute(const DataPoints& input, const TransformationParameters& parameters) const = 0;
412 
414  virtual void inPlaceCompute(const TransformationParameters& parameters, DataPoints& cloud) const = 0;
415 
417  virtual bool checkParameters(const TransformationParameters& parameters) const = 0;
418 
420  virtual TransformationParameters correctParameters(const TransformationParameters& parameters) const = 0;
421 
422  };
423 
425  struct Transformations: public std::vector<std::shared_ptr<Transformation> >
426  {
427  void apply(DataPoints& cloud, const TransformationParameters& parameters) const;
428  };
429  typedef typename Transformations::iterator TransformationsIt;
430  typedef typename Transformations::const_iterator TransformationsConstIt;
431 
433 
434  // ---------------------------------
435 
436 
437 
440  struct DataPointsFilter: public Parametrizable
441  {
443  DataPointsFilter(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
444  virtual ~DataPointsFilter();
445  virtual void init();
446 
448  virtual DataPoints filter(const DataPoints& input) = 0;
449 
451  virtual void inPlaceFilter(DataPoints& cloud) = 0;
452  };
453 
455  struct DataPointsFilters: public std::vector<std::shared_ptr<DataPointsFilter> >
456  {
458  DataPointsFilters(std::istream& in);
459  void init();
460  void apply(DataPoints& cloud);
461  };
462  typedef typename DataPointsFilters::iterator DataPointsFiltersIt;
463  typedef typename DataPointsFilters::const_iterator DataPointsFiltersConstIt;
464 
466 
467  // ---------------------------------
468 
469 
470 
473  struct Matcher: public Parametrizable
474  {
475  unsigned long visitCounter;
476 
477  Matcher();
478  Matcher(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
479  virtual ~Matcher();
480 
481  void resetVisitCount();
482  unsigned long getVisitCount() const;
483 
485  virtual void init(const DataPoints& filteredReference) = 0;
487  virtual Matches findClosests(const DataPoints& filteredReading) = 0;
488  };
489 
491 
492  // ---------------------------------
493 
494 
495 
499  struct OutlierFilter: public Parametrizable
500  {
501  OutlierFilter();
502  OutlierFilter(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
503 
504  virtual ~OutlierFilter();
505 
507  virtual OutlierWeights compute(const DataPoints& filteredReading, const DataPoints& filteredReference, const Matches& input) = 0;
508  };
509 
510 
512  struct OutlierFilters: public std::vector<std::shared_ptr<OutlierFilter> >
513  {
514 
515  OutlierWeights compute(const DataPoints& filteredReading, const DataPoints& filteredReference, const Matches& input);
516 
517  };
518 
519  typedef typename OutlierFilters::const_iterator OutlierFiltersConstIt;
520  typedef typename OutlierFilters::iterator OutlierFiltersIt;
521 
523 
524  // ---------------------------------
525 
526 
527 
530  struct ErrorMinimizer: public Parametrizable
531  {
534  {
537  OutlierWeights weights;
543 
544  ErrorElements();
545  ErrorElements(const DataPoints& requestedPts, const DataPoints& sourcePts, const OutlierWeights& outlierWeights, const Matches& matches);
546  };
547 
548  ErrorMinimizer();
549  ErrorMinimizer(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
550  virtual ~ErrorMinimizer();
551 
552  T getPointUsedRatio() const;
553  T getWeightedPointUsedRatio() const;
554  ErrorElements getErrorElements() const; //TODO: ensure that is return a usable value
555  virtual T getOverlap() const;
556  virtual Matrix getCovariance() const;
557  virtual T getResidualError(const DataPoints& filteredReading, const DataPoints& filteredReference, const OutlierWeights& outlierWeights, const Matches& matches) const;
558 
560  virtual TransformationParameters compute(const DataPoints& filteredReading, const DataPoints& filteredReference, const OutlierWeights& outlierWeights, const Matches& matches);
562  virtual TransformationParameters compute(const ErrorElements& matchedPoints) = 0;
563 
564  // helper functions
565  static Matrix crossProduct(const Matrix& A, const Matrix& B);//TODO: this might go in pointmatcher_support namespace
566 
567  protected:
568  //T pointUsedRatio; //!< the ratio of how many points were used for error minimization
569  //T weightedPointUsedRatio; //!< the ratio of how many points were used (with weight) for error minimization
570  //TODO: standardize the use of this variable
572  };
573 
575 
576  // ---------------------------------
577 
578 
579 
583  struct TransformationChecker: public Parametrizable
584  {
585  protected:
586  typedef std::vector<std::string> StringVector;
587  Vector limits;
589  StringVector limitNames;
590  StringVector conditionVariableNames;
591 
592  public:
594  TransformationChecker(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
595  virtual ~TransformationChecker();
597  virtual void init(const TransformationParameters& parameters, bool& iterate) = 0;
599  virtual void check(const TransformationParameters& parameters, bool& iterate) = 0;
600 
601  const Vector& getLimits() const;
602  const Vector& getConditionVariables() const;
603  const StringVector& getLimitNames() const;
604  const StringVector& getConditionVariableNames() const;
605 
606  protected:
607  static Vector matrixToAngles(const TransformationParameters& parameters);
608  };
609 
611  struct TransformationCheckers: public std::vector<std::shared_ptr<TransformationChecker> >
612  {
613  void init(const TransformationParameters& parameters, bool& iterate);
614  void check(const TransformationParameters& parameters, bool& iterate);
615  };
616  typedef typename TransformationCheckers::iterator TransformationCheckersIt;
617  typedef typename TransformationCheckers::const_iterator TransformationCheckersConstIt;
618 
620 
621  // ---------------------------------
622 
623 
624  struct Inspector: public Parametrizable
625  {
626 
627  Inspector();
628  Inspector(const std::string& className, const ParametersDoc paramsDoc, const Parameters& params);
629 
630  //
631  virtual ~Inspector();
632  virtual void init();
633 
634  // performance statistics
635  virtual void addStat(const std::string& name, double data);
636  virtual void dumpStats(std::ostream& stream);
637  virtual void dumpStatsHeader(std::ostream& stream);
638 
639  // data statistics
640  virtual void dumpIteration(const size_t iterationNumber, const TransformationParameters& parameters, const DataPoints& filteredReference, const DataPoints& reading, const Matches& matches, const OutlierWeights& outlierWeights, const TransformationCheckers& transformationCheckers);
641  virtual void finish(const size_t iterationCount);
642  };
643 
645 
646  // ---------------------------------
647 
649 
650  // ---------------------------------
651 
652  // algorithms
653 
654 
656  {
657  public:
662  std::shared_ptr<Matcher> matcher;
664  std::shared_ptr<ErrorMinimizer> errorMinimizer;
666  std::shared_ptr<Inspector> inspector;
667 
668  virtual ~ICPChainBase();
669 
670  virtual void setDefault();
671 
672  virtual void loadFromYaml(std::istream& in);
673  unsigned getPrefilteredReadingPtsCount() const;
674  unsigned getPrefilteredReferencePtsCount() const;
675 
676  bool getMaxNumIterationsReached() const;
677 
678  protected:
682 
683  ICPChainBase();
684 
685  void cleanup();
686 
687  virtual void loadAdditionalYAMLContent(PointMatcherSupport::YAML::Node& doc);
688 
690  template<typename R>
691  const std::string& createModulesFromRegistrar(const std::string& regName, const PointMatcherSupport::YAML::Node& doc, const R& registrar, std::vector<std::shared_ptr<typename R::TargetType> >& modules);
692 
694  template<typename R>
695  const std::string& createModuleFromRegistrar(const std::string& regName, const PointMatcherSupport::YAML::Node& doc, const R& registrar, std::shared_ptr<typename R::TargetType>& module);
696 
698  std::string nodeVal(const std::string& regName, const PointMatcherSupport::YAML::Node& doc);
699  };
700 
703  {
704  TransformationParameters operator()(
705  const DataPoints& readingIn,
706  const DataPoints& referenceIn);
707 
708  TransformationParameters operator()(
709  const DataPoints& readingIn,
710  const DataPoints& referenceIn,
711  const TransformationParameters& initialTransformationParameters);
712 
713  TransformationParameters compute(
714  const DataPoints& readingIn,
715  const DataPoints& referenceIn,
716  const TransformationParameters& initialTransformationParameters);
717 
719  const DataPoints& getReadingFiltered() const { return readingFiltered; }
720 
721  protected:
722  TransformationParameters computeWithTransformedReference(
723  const DataPoints& readingIn,
724  const DataPoints& reference,
725  const TransformationParameters& T_refIn_refMean,
726  const TransformationParameters& initialTransformationParameters);
727 
729  };
730 
733  struct ICPSequence: public ICP
734  {
735  TransformationParameters operator()(
736  const DataPoints& cloudIn);
737  TransformationParameters operator()(
738  const DataPoints& cloudIn,
739  const TransformationParameters& initialTransformationParameters);
740  TransformationParameters compute(
741  const DataPoints& cloudIn,
742  const TransformationParameters& initialTransformationParameters);
743 
744  bool hasMap() const;
745  bool setMap(const DataPoints& map);
746  void clearMap();
747  virtual void setDefault();
748  virtual void loadFromYaml(std::istream& in);
749  PM_DEPRECATED("Use getPrefilteredInternalMap instead. "
750  "Function now always returns map with filter chain applied. "
751  "This may have altered your program behavior."
752  "Reasons for this stated here and in associated PR: "
753  "https://github.com/ethz-asl/libpointmatcher/issues/209.")
754  const DataPoints& getInternalMap() const;
755  const DataPoints& getPrefilteredInternalMap() const;
756  PM_DEPRECATED("Use getPrefilteredMap instead. "
757  "Function now always returns map with filter chain applied. "
758  "This may have altered your program behavior."
759  "Reasons for this stated here and in associated PR: "
760  "https://github.com/ethz-asl/libpointmatcher/issues/209")
761  const DataPoints getMap() const;
762  const DataPoints getPrefilteredMap() const;
763 
764  protected:
767  };
768 
769  // ---------------------------------
770  // Instance-related functions
771  // ---------------------------------
772 
773  PointMatcher();
774 
775  static const PointMatcher& get();
776 
777 
778 }; // PointMatcher<T>
779 
780 #endif // __POINTMATCHER_CORE_H
781 
Matrix OutlierWeights
Weights of the associations between the points in Matches and the points in the reference.
Definition: PointMatcher.h:397
std::vector< Vector, Eigen::aligned_allocator< Vector > > VectorVector
A vector of vector over ScalarType, not a matrix.
Definition: PointMatcher.h:163
PM::Transformation Transformation
A chain of Transformation.
Definition: PointMatcher.h:425
A matcher links points in the reading to points in the reference.
Definition: PointMatcher.h:473
const Eigen::Block< const Int64Matrix > TimeConstView
a view on a const time
Definition: PointMatcher.h:216
Parametrizable::ParametersDoc ParametersDoc
alias
Definition: PointMatcher.h:188
A structure holding data ready for minimization. The data are "normalized", for instance there are no...
Definition: PointMatcher.h:533
std::vector< std::string > StringVector
a vector of strings
Definition: PointMatcher.h:586
DataPointsFilters::const_iterator DataPointsFiltersConstIt
alias
Definition: PointMatcher.h:463
DataPoints::Label Label
The logger interface, used to output warnings and informations.
Definition: PointMatcher.h:104
Matrix descriptors
descriptors of points in the cloud, might be empty
Definition: PointMatcher.h:333
Eigen::Block< Int64Matrix > TimeView
A view on a time.
Definition: PointMatcher.h:212
Vector conditionVariables
values of variables involved in conditions to stop ICP loop
Definition: PointMatcher.h:588
InvalidModuleType(const std::string &reason)
Construct an invalid–module-type exception.
Definition: ICP.cpp:59
void setLogger(std::shared_ptr< Logger > newLogger)
Set a new logger, protected by a mutex.
Definition: Logger.cpp:98
Point matcher did not converge.
Definition: PointMatcher.h:148
Matrix::Index Index
An index to a row or a column.
Definition: PointMatcher.h:218
Eigen::Quaternion< T > Quaternion
A quaternion over ScalarType.
Definition: PointMatcher.h:165
PM::DataPoints DataPoints
void validateFile(const std::string &fileName)
Throw a runtime_error exception if fileName cannot be opened.
::std::string string
Definition: gtest.h:1979
PointMatcherSupport::Parametrizable Parametrizable
alias
Definition: PointMatcher.h:185
TransformationCheckers::iterator TransformationCheckersIt
alias
Definition: PointMatcher.h:616
data
Definition: icp.py:50
PM::Inspector Inspector
DataPointsFilters referenceDataPointsFilters
filters for reference
Definition: PointMatcher.h:660
Vector limits
values of limits involved in conditions to stop ICP loop
Definition: PointMatcher.h:587
T weightedPointUsedRatio
the ratio of how many points were used (with weight) for error minimization
Definition: PointMatcher.h:542
Matrix Dists
Squared distances to closest points, dense matrix of ScalarType.
Definition: PointMatcher.h:373
bool maxNumIterationsReached
store if we reached the maximum number of iterations last time compute was called ...
Definition: PointMatcher.h:681
Labels featureLabels
labels of features
Definition: PointMatcher.h:332
TransformationCheckers transformationCheckers
transformation checkers
Definition: PointMatcher.h:665
DataPoints reference
reference point cloud
Definition: PointMatcher.h:536
DataPoints mapPointCloud
point cloud of the map, always in global frame (frame of first point cloud)
Definition: PointMatcher.h:765
std::ostream & operator<<(std::ostream &o, const Parametrizable::ParameterDoc &p)
Dump the documentation of this parameter to a stream.
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic > IntMatrix
A dense integer matrix.
Definition: PointMatcher.h:171
#define DEF_REGISTRAR_IFACE(name, ifaceName)
Definition: Registrar.h:222
An error minimizer will compute a transformation matrix such as to minimize the error between the rea...
Definition: PointMatcher.h:530
TransformationCheckers::const_iterator TransformationCheckersConstIt
alias
Definition: PointMatcher.h:617
unsigned long visitCounter
number of points visited
Definition: PointMatcher.h:475
Labels timeLabels
labels of times.
Definition: PointMatcher.h:336
The name for a certain number of dim.
Definition: PointMatcher.h:221
A function that transforms points and their descriptors given a transformation matrix.
Definition: PointMatcher.h:404
PM::ErrorMinimizer ErrorMinimizer
std::map< std::string, std::vector< std::string > > CsvElements
Data from a CSV file.
Definition: PointMatcher.h:125
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dense matrix over ScalarType.
Definition: PointMatcher.h:169
int nbRejectedPoints
number of points with all matches set to zero weights
Definition: PointMatcher.h:540
StringVector limitNames
names of limits involved in conditions to stop ICP loop
Definition: PointMatcher.h:589
Parametrizable::Parameters Parameters
alias
Definition: PointMatcher.h:186
DataPointsFilters readingDataPointsFilters
filters for reading, applied once
Definition: PointMatcher.h:658
std::map< std::string, Parameter > Parameters
Parameters stored as a map of string->string.
DataPoints readingFiltered
reading point cloud after the filters were applied
Definition: PointMatcher.h:728
OutlierWeights weights
weights for every association
Definition: PointMatcher.h:537
int nbRejectedMatches
number of matches with zero weights
Definition: PointMatcher.h:539
T ScalarType
The scalar type.
Definition: PointMatcher.h:159
Functions and classes that are not dependant on scalar type are defined in this namespace.
Parametrizable::ParameterDoc ParameterDoc
alias
Definition: PointMatcher.h:187
An inspector allows to log data at the different steps, for analysis.
Definition: PointMatcher.h:624
An exception thrown when one tries to use a module type that does not exist.
Definition: PointMatcher.h:83
const Eigen::Block< const Matrix > ConstView
A view on a const feature or const descriptor.
Definition: PointMatcher.h:214
bool contains(const M &m, const typename M::key_type &k)
DataPoints::Labels Labels
Functions and classes that are dependant on scalar type are defined in this templatized class...
Definition: PointMatcher.h:130
Transformations::const_iterator TransformationsConstIt
alias
Definition: PointMatcher.h:430
OutlierFilters outlierFilters
outlier filters
Definition: PointMatcher.h:663
pms::Logger Logger
const DataPoints & getReadingFiltered() const
Return the filtered point cloud reading used in the ICP chain.
Definition: PointMatcher.h:719
Result of the data-association step (Matcher::findClosests), before outlier rejection.
Definition: PointMatcher.h:371
std::vector< Quaternion, Eigen::aligned_allocator< Quaternion > > QuaternionVector
A vector of quaternions over ScalarType.
Definition: PointMatcher.h:167
bool operator==(const GTEST_10_TUPLE_(T)&t, const GTEST_10_TUPLE_(U)&u)
Definition: gtest.h:1607
A data filter takes a point cloud as input, transforms it, and produces another point cloud as output...
Definition: PointMatcher.h:440
StringVector conditionVariableNames
names of variables involved in conditions to stop ICP loop
Definition: PointMatcher.h:590
#define DEF_REGISTRAR(name)
Definition: Registrar.h:221
std::shared_ptr< ErrorMinimizer > errorMinimizer
error minimizer
Definition: PointMatcher.h:664
An outlier filter removes or weights links between points in reading and their matched points in refe...
Definition: PointMatcher.h:499
Eigen::Matrix< std::int64_t, Eigen::Dynamic, Eigen::Dynamic > Int64Matrix
A dense signed 64-bits matrix.
Definition: PointMatcher.h:173
The documentation of a parameter.
A chain of DataPointsFilter.
Definition: PointMatcher.h:455
A chain of TransformationChecker.
Definition: PointMatcher.h:611
Parametrizable::InvalidParameter InvalidParameter
alias
Definition: PointMatcher.h:189
PM::TransformationChecker TransformationChecker
The superclass of classes that are constructed using generic parameters. This class provides the para...
An exception thrown when one tries to fetch the value of an unexisting parameter. ...
Transformations::iterator TransformationsIt
alias
Definition: PointMatcher.h:429
#define PM_DEPRECATED(msg)
std::vector< ParameterDoc > ParametersDoc
The documentation of all parameters.
A chain of OutlierFilter.
Definition: PointMatcher.h:512
std::shared_ptr< Matcher > matcher
matcher
Definition: PointMatcher.h:662
IntMatrix Ids
Identifiers of closest points, dense matrix of integers.
Definition: PointMatcher.h:374
DataPointsFilters::iterator DataPointsFiltersIt
alias
Definition: PointMatcher.h:462
size_t span
number of data dimensions the label spans
Definition: PointMatcher.h:224
TransformationParameters T_refIn_refMean
offset for centered map
Definition: PointMatcher.h:766
ErrorElements lastErrorElements
memory of the last computed error
Definition: PointMatcher.h:571
std::shared_ptr< Inspector > inspector
inspector
Definition: PointMatcher.h:666
Eigen::Block< Matrix > View
A view on a feature or descriptor.
Definition: PointMatcher.h:210
A transformation checker can stop the iteration depending on some conditions.
Definition: PointMatcher.h:583
Transformations transformations
transformations
Definition: PointMatcher.h:661
unsigned prefilteredReadingPtsCount
remaining number of points after prefiltering but before the iterative process
Definition: PointMatcher.h:679
An exception thrown when one tries to access features or descriptors unexisting or of wrong dimension...
Definition: PointMatcher.h:250
T pointUsedRatio
the ratio of how many points were used for error minimization
Definition: PointMatcher.h:541
file
Definition: setup.py:28
Int64Matrix times
time associated to each points, might be empty
Definition: PointMatcher.h:335
Dists dists
squared distances to closest points
Definition: PointMatcher.h:384
std::vector< Label >::const_iterator const_iterator
alias
Definition: PointMatcher.h:231
An expection thrown when a transformation has invalid parameters.
Definition: PointMatcher.h:89
Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic > Array
A dense array over ScalarType.
Definition: PointMatcher.h:175
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector over ScalarType.
Definition: PointMatcher.h:161
OutlierFilters::iterator OutlierFiltersIt
alias
Definition: PointMatcher.h:520
NearestNeighbourSearch< T >::Matrix load(const char *fileName)
Ids ids
identifiers of closest points
Definition: PointMatcher.h:385
Matrix features
features of points in the cloud
Definition: PointMatcher.h:331
DataPointsFilters readingStepDataPointsFilters
filters for reading, applied at each step
Definition: PointMatcher.h:659
PM::Matches Matches
PM::DataPointsFilter DataPointsFilter
Stuff common to all ICP algorithms.
Definition: PointMatcher.h:655
OutlierFilters::const_iterator OutlierFiltersConstIt
alias
Definition: PointMatcher.h:519
ICP algorithm.
Definition: PointMatcher.h:702
DataPoints reading
reading point cloud
Definition: PointMatcher.h:535
std::string text
name of the label
Definition: PointMatcher.h:223
Matrix TransformationParameters
A matrix holding the parameters a transformation.
Definition: PointMatcher.h:182
PM::OutlierFilter OutlierFilter
An expception thrown when the yaml config file contains invalid configuration (e.g., mutually exclusive settings)
Definition: PointMatcher.h:96
unsigned prefilteredReferencePtsCount
remaining number of points after prefiltering but before the iterative process
Definition: PointMatcher.h:680
Labels descriptorLabels
labels of descriptors
Definition: PointMatcher.h:334
PM::Matcher Matcher
PM::DataPointsFilters DataPointsFilters
ErrorMinimizer::ErrorElements ErrorElements


libpointmatcher
Author(s):
autogenerated on Sat May 27 2023 02:38:03