mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
0.10.12: Added rtabmap::getLastLocalizationPose() method (to get last corrected pose either in mapping or localization mode)
This commit is contained in:
@@ -100,6 +100,7 @@ public:
|
||||
const Memory * getMemory() const {return _memory;}
|
||||
float getGoalReachedRadius() const {return _goalReachedRadius;}
|
||||
float getLocalRadius() const {return _localRadius;}
|
||||
const Transform & getLastLocalizationPose() const {return _lastLocalizationPose;}
|
||||
|
||||
float getTimeThreshold() const {return _maxTimeAllowed;} // in ms
|
||||
void setTimeThreshold(float maxTimeAllowed); // in ms
|
||||
@@ -242,7 +243,7 @@ private:
|
||||
std::map<int, Transform> _optimizedPoses;
|
||||
std::multimap<int, Link> _constraints;
|
||||
Transform _mapCorrection;
|
||||
Transform _lastLocalizationPose; // for localization mode
|
||||
Transform _lastLocalizationPose; // Corrected odometry pose. In mapping mode, this corresponds to last pose return by getLocalOptimizedPoses().
|
||||
int _lastLocalizationNodeId; // for localization mode
|
||||
|
||||
// Planning stuff
|
||||
|
||||
@@ -1097,7 +1097,7 @@ bool Rtabmap::process(
|
||||
|
||||
// Update Poses and Constraints
|
||||
_optimizedPoses.insert(std::make_pair(signature->id(), newPose));
|
||||
_lastLocalizationPose = newPose; // used in localization mode only (path planning)
|
||||
_lastLocalizationPose = newPose; // keep in cache the latest corrected pose
|
||||
if(signature->getLinks().size() == 1 &&
|
||||
signature->getLinks().begin()->second.type() == Link::kNeighbor)
|
||||
{
|
||||
@@ -2266,7 +2266,7 @@ bool Rtabmap::process(
|
||||
|
||||
// Update map correction, it should be identify when optimizing from the last node
|
||||
_mapCorrection = _optimizedPoses.at(signature->id()) * signature->getPose().inverse();
|
||||
_lastLocalizationPose = _optimizedPoses.at(signature->id()); // update in case we switch to localization mode
|
||||
_lastLocalizationPose = _optimizedPoses.at(signature->id()); // update
|
||||
if(_mapCorrection.getNormSquared() > 0.001f && _optimizeFromGraphEnd)
|
||||
{
|
||||
UERROR("Map correction should be identity when optimizing from the last node. T=%s", _mapCorrection.prettyPrint().c_str());
|
||||
|
||||
Reference in New Issue
Block a user