mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Added Rtabmap::setInitialPose()
This commit is contained in:
@@ -786,6 +786,7 @@ void OccupancyGrid::update(const std::map<int, Transform> & posesIn)
|
||||
{
|
||||
if(addedNodes_.find(iter->first) == addedNodes_.end())
|
||||
{
|
||||
UDEBUG("Pose %d not found in current added poses, it be added to map", iter->first);
|
||||
poses.push_back(*iter);
|
||||
}
|
||||
}
|
||||
@@ -837,6 +838,8 @@ void OccupancyGrid::update(const std::map<int, Transform> & posesIn)
|
||||
{
|
||||
const std::pair<std::pair<cv::Mat, cv::Mat>, cv::Mat> & pair = cache_.at(iter->first);
|
||||
|
||||
UDEBUG("Adding grid %d: ground=%d obstacles=%d empty=%d", iter->first, pair.first.first.cols, pair.first.second.cols, pair.second.cols);
|
||||
|
||||
//ground
|
||||
if(pair.first.first.cols)
|
||||
{
|
||||
|
||||
@@ -662,6 +662,24 @@ Transform Rtabmap::getPose(int locationId) const
|
||||
return Transform();
|
||||
}
|
||||
|
||||
void Rtabmap::setInitialPose(const Transform & initialPose)
|
||||
{
|
||||
if(_memory)
|
||||
{
|
||||
if(!_memory->isIncremental())
|
||||
{
|
||||
_lastLocalizationPose = initialPose;
|
||||
_lastLocalizationNodeId = 0;
|
||||
_mapCorrection.setIdentity();
|
||||
_mapCorrectionBackup.setNull();
|
||||
}
|
||||
else
|
||||
{
|
||||
UWARN("Initial pose can only be set in localization mode (%s=false), ignoring it...", Parameters::kMemIncrementalMemory().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Rtabmap::triggerNewMap()
|
||||
{
|
||||
int mapId = -1;
|
||||
|
||||
Reference in New Issue
Block a user