Registration.h
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007     * Redistributions of source code must retain the above copyright
00008       notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright
00010       notice, this list of conditions and the following disclaimer in the
00011       documentation and/or other materials provided with the distribution.
00012     * Neither the name of the Universite de Sherbrooke nor the
00013       names of its contributors may be used to endorse or promote products
00014       derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 
00028 #ifndef RTABMAP_REGISTRATION_H_
00029 #define RTABMAP_REGISTRATION_H_
00030 
00031 #include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
00032 
00033 #include <rtabmap/core/Parameters.h>
00034 #include <rtabmap/core/Signature.h>
00035 #include <rtabmap/core/RegistrationInfo.h>
00036 
00037 namespace rtabmap {
00038 
00039 class RTABMAP_EXP Registration
00040 {
00041 public:
00042         enum Type {
00043                 kTypeUndef = -1,
00044                 kTypeVis = 0,
00045                 kTypeIcp = 1,
00046                 kTypeVisIcp = 2
00047         };
00048         static double COVARIANCE_EPSILON;
00049 
00050 public:
00051         static Registration * create(const ParametersMap & parameters);
00052         static Registration * create(Type & type, const ParametersMap & parameters = ParametersMap());
00053 
00054 public:
00055         virtual ~Registration();
00056         virtual void parseParameters(const ParametersMap & parameters);
00057 
00058         bool isImageRequired() const;
00059         bool isScanRequired() const;
00060         bool isUserDataRequired() const;
00061 
00062         bool canUseGuess() const;
00063 
00064         int getMinVisualCorrespondences() const;
00065         float getMinGeometryCorrespondencesRatio() const;
00066 
00067         bool repeatOnce() const {return repeatOnce_;}
00068         bool force3DoF() const {return force3DoF_;}
00069 
00070         // take ownership!
00071         void setChildRegistration(Registration * child);
00072 
00073         Transform computeTransformation(
00074                         const Signature & from,
00075                         const Signature & to,
00076                         Transform guess = Transform::getIdentity(),
00077                         RegistrationInfo * info = 0) const;
00078         Transform computeTransformation(
00079                         const SensorData & from,
00080                         const SensorData & to,
00081                         Transform guess = Transform::getIdentity(),
00082                         RegistrationInfo * info = 0) const;
00083 
00084         Transform computeTransformationMod(
00085                         Signature & from,
00086                         Signature & to,
00087                         Transform guess = Transform::getIdentity(),
00088                         RegistrationInfo * info = 0) const;
00089 
00090 protected:
00091         // take ownership of child
00092         Registration(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
00093 
00094         // It is safe to modify the signatures in the implementation, if so, the
00095         // child registration will use these modifications.
00096         virtual Transform computeTransformationImpl(
00097                         Signature & from,
00098                         Signature & to,
00099                         Transform guess,
00100                         RegistrationInfo & info) const = 0;
00101 
00102         virtual bool isImageRequiredImpl() const {return false;}
00103         virtual bool isScanRequiredImpl() const {return false;}
00104         virtual bool isUserDataRequiredImpl() const {return false;}
00105         virtual bool canUseGuessImpl() const {return false;}
00106         virtual int getMinVisualCorrespondencesImpl() const {return 0;}
00107         virtual float getMinGeometryCorrespondencesRatioImpl() const {return 0.0f;}
00108 
00109 private:
00110         bool repeatOnce_;
00111         bool force3DoF_;
00112         Registration * child_;
00113 
00114 };
00115 
00116 }
00117 
00118 #endif /* RTABMAP_REGISTRATION_H_ */


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 21:59:21