fixed "path.size()=0!? nearestId=1 ids=1, aborting..." warning when Rtabmap/CreateIntermediateNodes is true and proximity detection is enabled.

This commit is contained in:
matlabbe
2021-05-21 17:46:19 -04:00
parent f96591e030
commit ae4778b89c
+6 -1
View File
@@ -1873,7 +1873,12 @@ void CoreWrapper::process(
{ {
if(iter->first.header.stamp < lastPoseStamp_) if(iter->first.header.stamp < lastPoseStamp_)
{ {
Transform interOdom = rtabmap_ros::transformFromPoseMsg(iter->first.pose.pose); Transform interOdom;
if(!rtabmap_.getLocalOptimizedPoses().empty())
{
// add intermediate poses only if the current local graph is not empty
interOdom = rtabmap_ros::transformFromPoseMsg(iter->first.pose.pose);
}
if(!interOdom.isNull()) if(!interOdom.isNull())
{ {
cv::Mat covariance; cv::Mat covariance;