41 keyFrameThr_(
Parameters::defaultOdomKeyFrameThr()),
42 visKeyFrameThr_(
Parameters::defaultOdomVisKeyFrameThr()),
43 scanKeyFrameThr_(
Parameters::defaultOdomScanKeyFrameThr())
78 UERROR(
"Calibrated stereo camera required");
84 UERROR(
"Calibrated camera required (multi-cameras not supported).");
88 bool addKeyFrame =
false;
101 float maxCorrespondenceDistance = 0.0f;
102 float pmOutlierRatio = 0.0f;
109 maxCorrespondenceDistance = Parameters::defaultIcpMaxCorrespondenceDistance();
110 pmOutlierRatio = Parameters::defaultIcpPMOutlierRatio();
127 if(maxCorrespondenceDistance>0.0
f)
141 UWARN(
"Failed to find a transformation with the provided guess (%s), trying again without a guess.", guess.
prettyPrint().c_str());
143 int visCorTypeBackup = Parameters::defaultVisCorType();
145 if(visCorTypeBackup == 1)
158 if(visCorTypeBackup == 1)
167 UWARN(
"Trial with no guess still fail.");
171 UWARN(
"Trial with no guess succeeded.");
177 std::list<std::pair<int, std::pair<int, int> > > pairs;
181 std::map<int, int> idToIndex;
183 for(std::list<std::pair<
int, std::pair<int, int> > >::iterator iter=pairs.begin();
189 idToIndex.insert(std::make_pair(iter->first, i));
202 for(std::multimap<int, int>::const_iterator iter=tmpRefFrame.
getWords().begin(); iter!=tmpRefFrame.
getWords().end(); ++iter)
210 for(std::multimap<int, int>::const_iterator iter=newFrame.
getWords().begin(); iter!=newFrame.
getWords().end(); ++iter)
212 info->
words.insert(std::make_pair(iter->first, newFrame.
getWordsKpts()[iter->second]));
226 regInfo.
covariance = cv::Mat::eye(6,6,CV_64FC1)*9999.0;
231 output = motionSinceLastKeyFrame.
inverse() * output;
241 UDEBUG(
"Update key frame");
276 if(features < registrationPipeline_->getMinVisualCorrespondences())
278 UWARN(
"Too low 2D features (%d), keeping last key frame...", features);
314 UINFO(
"Odom update time = %fs lost=%s inliers=%d, ref frame corners=%d, transform accepted=%s",
316 output.
isNull()?
"true":
"false",
319 !output.
isNull()?
"true":
"false");
static bool parse(const ParametersMap ¶meters, const std::string &key, bool &value)
int getMinVisualCorrespondences() const
std::vector< cv::Point2f > refCorners
unsigned int framesProcessed() const
cv::Point3f RTABMAP_EXP transformPoint(const cv::Point3f &pt, const Transform &transform)
float getMinGeometryCorrespondencesRatio() const
bool isInfoDataFilled() const
virtual void reset(const Transform &initialPose=Transform::getIdentity())
Transform computeTransformationMod(Signature &from, Signature &to, Transform guess=Transform::getIdentity(), RegistrationInfo *info=0) const
std::map< int, cv::Point3f > localMap
std::pair< std::string, std::string > ParametersPair
const cv::Mat & descriptors() const
std::map< std::string, std::string > ParametersMap
const std::vector< cv::KeyPoint > & keypoints() const
const Transform & getPose() const
std::vector< int > inliersIDs
Transform lastKeyFramePose_
const LaserScan & laserScanRaw() const
const std::vector< cv::KeyPoint > & getWordsKpts() const
GLM_FUNC_DECL bool isNull(detail::tmat2x2< T, P > const &m, T const &epsilon)
#define UASSERT(condition)
Wrappers of STL for convenient functions.
bool isValidForProjection() const
const std::multimap< int, int > & getWords() const
OdometryF2F(const rtabmap::ParametersMap ¶meters=rtabmap::ParametersMap())
std::vector< int > cornerInliers
LaserScan RTABMAP_EXP transformLaserScan(const LaserScan &laserScan, const Transform &transform)
bool isScanRequired() const
virtual void parseParameters(const ParametersMap ¶meters)
const cv::Mat & getWordsDescriptors() const
Transform localTransform() const
ParametersMap parameters_
const std::vector< CameraModel > & cameraModels() const
static Registration * create(const ParametersMap ¶meters)
const std::vector< cv::Point3f > & getWords3() const
std::multimap< int, cv::KeyPoint > words
SensorData & sensorData()
static int findPairsUnique(const std::multimap< int, T > &wordsA, const std::multimap< int, T > &wordsB, std::list< std::pair< int, std::pair< T, T > > > &pairs, bool ignoreNegativeIds=true)
ULogger class and convenient macros.
const StereoCameraModel & stereoCameraModel() const
bool isImageRequired() const
std::vector< cv::Point2f > newCorners
virtual Transform computeTransform(SensorData &image, const Transform &guess=Transform(), OdometryInfo *info=0)
std::string UTILITE_EXP uNumber2Str(unsigned int number)
void setFeatures(const std::vector< cv::KeyPoint > &keypoints, const std::vector< cv::Point3f > &keypoints3D, const cv::Mat &descriptors)
const std::vector< cv::Point3f > & keypoints3D() const
Registration * registrationPipeline_
RegistrationInfo copyWithoutData() const
virtual void reset(const Transform &initialPose=Transform::getIdentity())