mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 10:00:23 +08:00
Added Rtabmap::setInitialPose()
This commit is contained in:
@@ -129,6 +129,7 @@ public:
|
|||||||
float getTimeThreshold() const {return _maxTimeAllowed;} // in ms
|
float getTimeThreshold() const {return _maxTimeAllowed;} // in ms
|
||||||
void setTimeThreshold(float maxTimeAllowed); // in ms
|
void setTimeThreshold(float maxTimeAllowed); // in ms
|
||||||
|
|
||||||
|
void setInitialPose(const Transform & initialPose);
|
||||||
int triggerNewMap();
|
int triggerNewMap();
|
||||||
bool labelLocation(int id, const std::string & label);
|
bool labelLocation(int id, const std::string & label);
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -786,6 +786,7 @@ void OccupancyGrid::update(const std::map<int, Transform> & posesIn)
|
|||||||
{
|
{
|
||||||
if(addedNodes_.find(iter->first) == addedNodes_.end())
|
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);
|
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);
|
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
|
//ground
|
||||||
if(pair.first.first.cols)
|
if(pair.first.first.cols)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -662,6 +662,24 @@ Transform Rtabmap::getPose(int locationId) const
|
|||||||
return Transform();
|
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 Rtabmap::triggerNewMap()
|
||||||
{
|
{
|
||||||
int mapId = -1;
|
int mapId = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user