RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
Registration.h
1/*
2Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, 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 Universite de Sherbrooke nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef RTABMAP_REGISTRATION_H_
29#define RTABMAP_REGISTRATION_H_
30
31#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
32
33#include <rtabmap/core/Parameters.h>
34#include <rtabmap/core/Signature.h>
35#include <rtabmap/core/RegistrationInfo.h>
36
37namespace rtabmap {
38
60class RTABMAP_CORE_EXPORT Registration
61{
62public:
64 enum Type {
65 kTypeUndef = -1,
66 kTypeVis = 0,
67 kTypeIcp = 1,
68 kTypeVisIcp = 2
69 };
74
75public:
77 static Registration * create(const ParametersMap & parameters);
79 static Registration * create(Type & type, const ParametersMap & parameters = ParametersMap());
80
81public:
82 virtual ~Registration();
84 virtual void parseParameters(const ParametersMap & parameters);
85
87 bool isImageRequired() const;
89 bool isScanRequired() const;
91 bool isUserDataRequired() const;
92
94 bool canUseGuess() const;
95
100
102 bool repeatOnce() const {return repeatOnce_;}
104 bool force3DoF() const {return force3DoF_;}
105
108
111 const Signature & from,
112 const Signature & to,
113 Transform guess = Transform::getIdentity(),
114 RegistrationInfo * info = 0) const;
117 const SensorData & from,
118 const SensorData & to,
119 Transform guess = Transform::getIdentity(),
120 RegistrationInfo * info = 0) const;
121
124 Signature & from,
125 Signature & to,
126 Transform guess = Transform::getIdentity(),
127 RegistrationInfo * info = 0) const;
128
129protected:
131 Registration(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
132
139 Signature & from,
140 Signature & to,
141 Transform guess,
142 RegistrationInfo & info) const = 0;
143
144 virtual bool isImageRequiredImpl() const {return false;}
145 virtual bool isScanRequiredImpl() const {return false;}
146 virtual bool isUserDataRequiredImpl() const {return false;}
147 virtual bool canUseGuessImpl() const {return false;}
148 virtual int getMinVisualCorrespondencesImpl() const {return 0;}
149 virtual float getMinGeometryCorrespondencesRatioImpl() const {return 0.0f;}
150
151private:
152 bool repeatOnce_;
153 bool force3DoF_;
154 Registration * child_;
155
156};
157
158}
159
160#endif /* RTABMAP_REGISTRATION_H_ */
Statistics and diagnostics returned by Registration.
Abstract base for registering two observations (visual, ICP, or both).
virtual void parseParameters(const ParametersMap &parameters)
Parses Reg/RepeatOnce, Reg/Force3DoF and forwards to the child registration if set.
static Registration * create(Type &type, const ParametersMap &parameters=ParametersMap())
Creates a registration of type (may be adjusted, e.g. to kTypeVis). Caller owns the pointer.
virtual Transform computeTransformationImpl(Signature &from, Signature &to, Transform guess, RegistrationInfo &info) const =0
Strategy-specific registration.
bool isUserDataRequired() const
True if user data is needed (parent or child).
Transform computeTransformation(const SensorData &from, const SensorData &to, Transform guess=Transform::getIdentity(), RegistrationInfo *info=0) const
Registers two SensorData observations (wrapped as signatures).
Transform computeTransformationMod(Signature &from, Signature &to, Transform guess=Transform::getIdentity(), RegistrationInfo *info=0) const
Registers from to to; signatures may be modified by the implementation.
static Registration * create(const ParametersMap &parameters)
Creates a registration from Reg/Strategy in parameters. Caller owns the pointer.
bool repeatOnce() const
static double COVARIANCE_LINEAR_EPSILON
Minimum diagonal value for linear covariance (m²).
Registration(const ParametersMap &parameters=ParametersMap(), Registration *child=0)
child is owned and deleted in the destructor.
bool isScanRequired() const
True if laser scans are needed (parent or child).
Transform computeTransformation(const Signature &from, const Signature &to, Transform guess=Transform::getIdentity(), RegistrationInfo *info=0) const
Registers from to to using immutable signatures (copied internally).
bool canUseGuess() const
True if the strategy can refine an initial guess (parent or child).
int getMinVisualCorrespondences() const
Minimum visual inliers required (max of parent and child thresholds).
void setChildRegistration(Registration *child)
Replaces the current child registration; takes ownership of child.
float getMinGeometryCorrespondencesRatio() const
Minimum geometry inlier ratio required (max of parent and child thresholds).
bool isImageRequired() const
True if images are needed (parent or child).
static double COVARIANCE_ANGULAR_EPSILON
Minimum diagonal value for angular covariance (rad²).
Type
Registration strategy selected by Reg/Strategy.
Container class for all sensor data captured at a specific time.
Definition SensorData.h:97
Represents a node in RTAB-Map's pose graph.
Definition Signature.h:84
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53
std::map< std::string, std::string > ParametersMap
Parameter keys mapped to their values, as used by every configurable class (see Parameters).
Definition Parameters.h:44