2014-12-14 16:42:10 -05:00
|
|
|
/*
|
2016-07-17 21:57:10 -04:00
|
|
|
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
2014-12-14 16:42:10 -05:00
|
|
|
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 ODOMETRYINFO_H_
|
|
|
|
|
#define ODOMETRYINFO_H_
|
|
|
|
|
|
2015-06-18 23:00:46 -04:00
|
|
|
#include <map>
|
2016-02-22 16:13:14 -05:00
|
|
|
#include "rtabmap/core/Transform.h"
|
2016-02-23 11:06:24 -05:00
|
|
|
#include <opencv2/features2d/features2d.hpp>
|
2015-06-18 23:00:46 -04:00
|
|
|
|
2014-12-14 16:42:10 -05:00
|
|
|
namespace rtabmap {
|
|
|
|
|
|
|
|
|
|
class OdometryInfo
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
OdometryInfo() :
|
|
|
|
|
lost(true),
|
2016-01-08 19:15:49 -05:00
|
|
|
matches(0),
|
|
|
|
|
inliers(0),
|
|
|
|
|
icpInliersRatio(0.0f),
|
|
|
|
|
features(0),
|
|
|
|
|
localMapSize(0),
|
2016-03-06 15:11:09 -05:00
|
|
|
localScanMapSize(0),
|
2017-01-03 21:05:00 -05:00
|
|
|
localKeyFrames(0),
|
|
|
|
|
localBundleOutliers(0),
|
|
|
|
|
localBundleConstraints(0),
|
|
|
|
|
localBundleTime(0),
|
|
|
|
|
keyFrameAdded(false),
|
2016-01-08 19:15:49 -05:00
|
|
|
timeEstimation(0.0f),
|
|
|
|
|
timeParticleFiltering(0.0f),
|
2015-06-11 16:57:16 -04:00
|
|
|
stamp(0),
|
|
|
|
|
interval(0),
|
2016-01-08 19:15:49 -05:00
|
|
|
distanceTravelled(0.0f),
|
|
|
|
|
type(0)
|
2014-12-14 16:42:10 -05:00
|
|
|
{}
|
2016-03-01 17:33:27 -05:00
|
|
|
|
|
|
|
|
OdometryInfo copyWithoutData() const
|
|
|
|
|
{
|
|
|
|
|
OdometryInfo output;
|
|
|
|
|
output.lost = lost;
|
|
|
|
|
output.matches = matches;
|
|
|
|
|
output.inliers = inliers;
|
|
|
|
|
output.icpInliersRatio = icpInliersRatio;
|
2017-05-04 16:13:45 -04:00
|
|
|
output.covariance = covariance.clone();
|
2016-03-01 17:33:27 -05:00
|
|
|
output.features = features;
|
|
|
|
|
output.localMapSize = localMapSize;
|
2016-03-06 15:11:09 -05:00
|
|
|
output.localScanMapSize = localScanMapSize;
|
2017-01-03 21:05:00 -05:00
|
|
|
output.localKeyFrames = localKeyFrames;
|
|
|
|
|
output.localBundleOutliers = localBundleOutliers;
|
|
|
|
|
output.localBundleConstraints = localBundleConstraints;
|
|
|
|
|
output.localBundleTime = localBundleTime;
|
|
|
|
|
output.keyFrameAdded = keyFrameAdded;
|
2016-03-01 17:33:27 -05:00
|
|
|
output.timeEstimation = timeEstimation;
|
|
|
|
|
output.timeParticleFiltering = timeParticleFiltering;
|
|
|
|
|
output.stamp = stamp;
|
2017-05-04 16:13:45 -04:00
|
|
|
output.interval = interval;
|
2016-03-01 17:33:27 -05:00
|
|
|
output.transform = transform;
|
|
|
|
|
output.transformFiltered = transformFiltered;
|
|
|
|
|
output.transformGroundTruth = transformGroundTruth;
|
|
|
|
|
output.distanceTravelled = distanceTravelled;
|
2016-08-08 14:35:39 -04:00
|
|
|
output.type = type;
|
2016-03-01 17:33:27 -05:00
|
|
|
return output;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-14 16:42:10 -05:00
|
|
|
bool lost;
|
|
|
|
|
int matches;
|
|
|
|
|
int inliers;
|
2016-01-12 11:37:50 -05:00
|
|
|
float icpInliersRatio;
|
2017-05-04 16:13:45 -04:00
|
|
|
cv::Mat covariance;
|
2014-12-14 16:42:10 -05:00
|
|
|
int features;
|
|
|
|
|
int localMapSize;
|
2016-03-06 15:11:09 -05:00
|
|
|
int localScanMapSize;
|
2017-01-03 21:05:00 -05:00
|
|
|
int localKeyFrames;
|
|
|
|
|
int localBundleOutliers;
|
|
|
|
|
int localBundleConstraints;
|
|
|
|
|
float localBundleTime;
|
|
|
|
|
bool keyFrameAdded;
|
2015-06-11 16:57:16 -04:00
|
|
|
float timeEstimation;
|
|
|
|
|
float timeParticleFiltering;
|
|
|
|
|
double stamp;
|
|
|
|
|
double interval;
|
|
|
|
|
Transform transform;
|
|
|
|
|
Transform transformFiltered;
|
2015-12-17 14:13:19 -05:00
|
|
|
Transform transformGroundTruth;
|
2015-06-15 14:44:44 -04:00
|
|
|
float distanceTravelled;
|
2014-12-18 16:54:46 -05:00
|
|
|
|
2016-03-06 15:11:09 -05:00
|
|
|
int type; // 0=F2M, 1=F2F
|
2014-12-18 16:54:46 -05:00
|
|
|
|
2016-03-06 15:11:09 -05:00
|
|
|
// F2M
|
2014-12-18 16:54:46 -05:00
|
|
|
std::multimap<int, cv::KeyPoint> words;
|
|
|
|
|
std::vector<int> wordMatches;
|
|
|
|
|
std::vector<int> wordInliers;
|
2015-07-28 23:48:50 -04:00
|
|
|
std::map<int, cv::Point3f> localMap;
|
2016-03-06 15:11:09 -05:00
|
|
|
cv::Mat localScanMap;
|
2014-12-18 16:54:46 -05:00
|
|
|
|
2016-03-06 15:11:09 -05:00
|
|
|
// F2F
|
2015-04-23 22:01:41 -04:00
|
|
|
std::vector<cv::Point2f> refCorners;
|
|
|
|
|
std::vector<cv::Point2f> newCorners;
|
2014-12-18 16:54:46 -05:00
|
|
|
std::vector<int> cornerInliers;
|
2014-12-14 16:42:10 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* ODOMETRYINFO_H_ */
|