Files
rtabmap/corelib/include/rtabmap/core/RegistrationIcp.h
T

123 lines
4.3 KiB
C++
Raw Normal View History

/*
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Universite de Sherbrooke nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef REGISTRATIONICP_H_
#define REGISTRATIONICP_H_
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
2016-01-05 15:29:29 -05:00
#include <rtabmap/core/Registration.h>
#include <rtabmap/core/Signature.h>
namespace rtabmap {
// Geometrical registration
class RTABMAP_CORE_EXPORT RegistrationIcp : public Registration
{
public:
2026-08-06 13:32:20 -07:00
enum IcpStrategy {
kIcpUndef = -1, /**< Undefined / invalid type. */
kIcpPCL = 0, /**< Point Cloud Library. */
kIcpPointMatcher = 1, /**< libpointmatcher. */
kIcpCCCoreLib = 2, /**< CCCoreLib (Cloud Compare). */
kIcpEnd = 3 /**< Sentinel: always keep last. Used to iterate through strategies. */
};
public:
/**
* @brief Returns true if @p strategy is built into this rtabmap binary.
*
* @ref kIcpPCL is always available; @ref kIcpPointMatcher requires the
* RTABMAP_POINTMATCHER build flag; @ref kIcpCCCoreLib requires
* RTABMAP_CCCORELIB.
*/
static bool available(IcpStrategy strategy);
/**
* @brief Human-readable name for @p strategy ("PCL", "libpointmatcher",
* "CCCoreLib", or "Unknown").
*/
static const char * strategyName(IcpStrategy strategy);
// take ownership of child
RegistrationIcp(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
2026-08-06 13:32:20 -07:00
RegistrationIcp(IcpStrategy strategy, const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
2017-08-22 16:20:49 -04:00
virtual ~RegistrationIcp();
virtual void parseParameters(const ParametersMap & parameters);
protected:
virtual Transform computeTransformationImpl(
Signature & from,
Signature & to,
Transform guess,
RegistrationInfo & info) const;
virtual bool isScanRequiredImpl() const {return true;}
2018-02-01 22:17:46 -05:00
virtual bool canUseGuessImpl() const {return true;}
2016-01-07 13:59:21 -05:00
virtual float getMinGeometryCorrespondencesRatioImpl() const {return _correspondenceRatio;}
private:
2026-08-06 13:32:20 -07:00
IcpStrategy _strategy;
float _maxTranslation;
float _maxRotation;
float _voxelSize;
int _downsamplingStep;
float _rangeMin;
float _rangeMax;
float _maxCorrespondenceDistance;
bool _reciprocalCorrespondences;
int _maxIterations;
float _epsilon;
float _correspondenceRatio;
bool _force4DoF;
int _filtersEnabled;
bool _pointToPlane;
int _pointToPlaneK;
float _pointToPlaneRadius;
float _pointToPlaneGroundNormalsUp;
float _pointToPlaneMinComplexity;
2026-08-06 13:32:20 -07:00
bool _pointToPlaneComplexityCentered;
int _pointToPlaneLowComplexityStrategy;
2017-08-22 16:20:49 -04:00
std::string _libpointmatcherConfig;
int _libpointmatcherKnn;
float _libpointmatcherEpsilon;
bool _libpointmatcherIntensity;
float _outlierRatio;
unsigned int _ccSamplingLimit;
bool _ccFilterOutFarthestPoints;
double _ccMaxFinalRMS;
2021-06-26 16:06:25 -04:00
std::string _debugExportFormat;
std::string _workingDir;
2017-08-22 16:20:49 -04:00
void * _libpointmatcherICP;
void * _libpointmatcherICPFilters;
};
}
#endif /* REGISTRATIONICP_H_ */