41 keyFrameThr_(
Parameters::defaultOdomKeyFrameThr()),
42 visKeyFrameThr_(
Parameters::defaultOdomVisKeyFrameThr()),
43 scanKeyFrameThr_(
Parameters::defaultOdomScanKeyFrameThr())
79 UERROR(
"Calibrated stereo camera required (multi-cameras not supported)");
85 UERROR(
"Calibrated camera required (multi-cameras not supported).");
89 bool addKeyFrame =
false;
102 float maxCorrespondenceDistance = 0.0f;
103 float outlierRatio = 0.0f;
110 maxCorrespondenceDistance = Parameters::defaultIcpMaxCorrespondenceDistance();
111 outlierRatio = Parameters::defaultIcpOutlierRatio();
128 if(maxCorrespondenceDistance>0.0
f)
142 UWARN(
"Failed to find a transformation with the provided guess (%s), trying again without a guess.", guess.
prettyPrint().c_str());
144 int visCorTypeBackup = Parameters::defaultVisCorType();
146 if(visCorTypeBackup == 1)
159 if(visCorTypeBackup == 1)
168 UWARN(
"Trial with no guess still fail.");
172 UWARN(
"Trial with no guess succeeded.");
178 std::list<std::pair<int, std::pair<int, int> > > pairs;
182 std::map<int, int> idToIndex;
184 for(std::list<std::pair<
int, std::pair<int, int> > >::iterator iter=pairs.begin();
190 idToIndex.insert(std::make_pair(iter->first, i));
203 for(std::multimap<int, int>::const_iterator iter=tmpRefFrame.
getWords().begin(); iter!=tmpRefFrame.
getWords().end(); ++iter)
211 for(std::multimap<int, int>::const_iterator iter=newFrame.
getWords().begin(); iter!=newFrame.
getWords().end(); ++iter)
213 info->
words.insert(std::make_pair(iter->first, newFrame.
getWordsKpts()[iter->second]));
227 regInfo.
covariance = cv::Mat::eye(6,6,CV_64FC1)*9999.0;
232 output = motionSinceLastKeyFrame.
inverse() * output;
242 UDEBUG(
"Update key frame");
281 if(features < registrationPipeline_->getMinVisualCorrespondences())
283 UWARN(
"Too low 2D features (%d), keeping last key frame...", features);
320 UINFO(
"Odom update time = %fs lost=%s inliers=%d, ref frame corners=%d, transform accepted=%s",
322 output.
isNull()?
"true":
"false",
325 !output.
isNull()?
"true":
"false");
static bool parse(const ParametersMap ¶meters, const std::string &key, bool &value)
int getMinVisualCorrespondences() const
Transform computeTransformationMod(Signature &from, Signature &to, Transform guess=Transform::getIdentity(), RegistrationInfo *info=0) const
std::vector< cv::Point2f > refCorners
cv::Point3f RTABMAP_EXP transformPoint(const cv::Point3f &pt, const Transform &transform)
const std::vector< cv::Point3f > & keypoints3D() const
void setLaserScan(const LaserScan &laserScan, bool clearPreviousData=true)
virtual void reset(const Transform &initialPose=Transform::getIdentity())
unsigned int framesProcessed() const
std::map< int, cv::Point3f > localMap
std::pair< std::string, std::string > ParametersPair
const cv::Mat & getWordsDescriptors() const
const std::vector< StereoCameraModel > & stereoCameraModels() const
std::map< std::string, std::string > ParametersMap
const std::vector< cv::KeyPoint > & keypoints() const
float getMinGeometryCorrespondencesRatio() const
const std::vector< cv::Point3f > & getWords3() const
std::vector< int > inliersIDs
Transform lastKeyFramePose_
RegistrationInfo copyWithoutData() const
GLM_FUNC_DECL bool isNull(detail::tmat2x2< T, P > const &m, T const &epsilon)
const std::vector< cv::KeyPoint > & getWordsKpts() const
#define UASSERT(condition)
Wrappers of STL for convenient functions.
bool isInfoDataFilled() const
const std::vector< CameraModel > & cameraModels() const
OdometryF2F(const rtabmap::ParametersMap ¶meters=rtabmap::ParametersMap())
bool isScanRequired() const
std::vector< int > cornerInliers
LaserScan RTABMAP_EXP transformLaserScan(const LaserScan &laserScan, const Transform &transform)
virtual void parseParameters(const ParametersMap ¶meters)
const cv::Mat & descriptors() const
bool isImageRequired() const
ParametersMap parameters_
static Registration * create(const ParametersMap ¶meters)
const LaserScan & laserScanRaw() 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.
std::vector< cv::Point2f > newCorners
const Transform & getPose() const
virtual Transform computeTransform(SensorData &image, const Transform &guess=Transform(), OdometryInfo *info=0)
std::string UTILITE_EXP uNumber2Str(unsigned int number)
Transform localTransform() const
void setFeatures(const std::vector< cv::KeyPoint > &keypoints, const std::vector< cv::Point3f > &keypoints3D, const cv::Mat &descriptors)
Registration * registrationPipeline_
virtual void reset(const Transform &initialPose=Transform::getIdentity())
const std::multimap< int, int > & getWords() const