mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Added ground truth localization error stats
This commit is contained in:
@@ -171,6 +171,8 @@ class RTABMAP_EXP Statistics
|
|||||||
RTABMAP_STATS(Gt, Rotational_std, deg);
|
RTABMAP_STATS(Gt, Rotational_std, deg);
|
||||||
RTABMAP_STATS(Gt, Rotational_min, deg);
|
RTABMAP_STATS(Gt, Rotational_min, deg);
|
||||||
RTABMAP_STATS(Gt, Rotational_max, deg);
|
RTABMAP_STATS(Gt, Rotational_max, deg);
|
||||||
|
RTABMAP_STATS(Gt, Localization_linear_error, m);
|
||||||
|
RTABMAP_STATS(Gt, Localization_angular_error, deg);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const std::map<std::string, float> & defaultData();
|
static const std::map<std::string, float> & defaultData();
|
||||||
|
|||||||
@@ -3077,10 +3077,23 @@ bool Rtabmap::process(
|
|||||||
statistics_.setProximityDetectionMapId(_memory->getMapId(lastProximitySpaceClosureId));
|
statistics_.setProximityDetectionMapId(_memory->getMapId(lastProximitySpaceClosureId));
|
||||||
if(_loopClosureHypothesis.first || lastProximitySpaceClosureId)
|
if(_loopClosureHypothesis.first || lastProximitySpaceClosureId)
|
||||||
{
|
{
|
||||||
UASSERT(uContains(sLoop->getLinks(), signature->id()));
|
// Loop closure transform
|
||||||
UINFO("Set loop closure transform = %s", sLoop->getLinks().find(signature->id())->second.transform().prettyPrint().c_str());
|
UASSERT(sLoop);
|
||||||
statistics_.setLoopClosureTransform(sLoop->getLinks().find(signature->id())->second.transform());
|
std::multimap<int, Link>::const_iterator loopIter = sLoop->getLinks().find(signature->id());
|
||||||
|
UASSERT(loopIter!=sLoop->getLinks().end());
|
||||||
|
UINFO("Set loop closure transform = %s", loopIter->second.transform().prettyPrint().c_str());
|
||||||
|
statistics_.setLoopClosureTransform(loopIter->second.transform());
|
||||||
|
|
||||||
|
// if ground truth exists, compute localization error
|
||||||
|
if(!sLoop->getGroundTruthPose().isNull() && !signature->getGroundTruthPose().isNull())
|
||||||
|
{
|
||||||
|
Transform transformGT = sLoop->getGroundTruthPose().inverse() * signature->getGroundTruthPose();
|
||||||
|
Transform error = loopIter->second.transform().inverse() * transformGT;
|
||||||
|
statistics_.addStatistic(Statistics::kGtLocalization_linear_error(), error.getNorm());
|
||||||
|
statistics_.addStatistic(Statistics::kGtLocalization_angular_error(), error.getAngle(1,0,0)*180/M_PI);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map correction (/map -> /odom)
|
||||||
statistics_.addStatistic(Statistics::kLoopMap_correction_norm(), _mapCorrection.getNorm());
|
statistics_.addStatistic(Statistics::kLoopMap_correction_norm(), _mapCorrection.getNorm());
|
||||||
float roll,pitch,yaw;
|
float roll,pitch,yaw;
|
||||||
_mapCorrection.getEulerAngles(roll, pitch, yaw);
|
_mapCorrection.getEulerAngles(roll, pitch, yaw);
|
||||||
|
|||||||
Reference in New Issue
Block a user