mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
multiband: fixed error when intermediate nodes without data are in memory
This commit is contained in:
@@ -2413,6 +2413,22 @@ bool multiBandTexturing(
|
|||||||
{
|
{
|
||||||
image = data.imageRaw();
|
image = data.imageRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(models.empty() || image.empty())
|
||||||
|
{
|
||||||
|
Transform odomPose;
|
||||||
|
int mapId;
|
||||||
|
int weight=0;
|
||||||
|
std::string label;
|
||||||
|
double stamp;
|
||||||
|
Transform gt;
|
||||||
|
std::vector<float> vel;
|
||||||
|
GPS gps;
|
||||||
|
EnvSensors envs;
|
||||||
|
memory->getNodeInfo(camId, odomPose, mapId, weight, label, stamp, gt, vel, gps, envs, true);
|
||||||
|
if(weight == -1) // just ignore intermediate nodes if their data is not set
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(dbDriver)
|
else if(dbDriver)
|
||||||
{
|
{
|
||||||
@@ -2433,6 +2449,14 @@ bool multiBandTexturing(
|
|||||||
{
|
{
|
||||||
image = data.imageRaw();
|
image = data.imageRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(models.empty() || image.empty())
|
||||||
|
{
|
||||||
|
int weight=0;
|
||||||
|
dbDriver->getWeight(camId, weight);
|
||||||
|
if(weight == -1) // just ignore intermediate nodes if their data is not set
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(models.empty())
|
if(models.empty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1231,16 +1231,14 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
robotPoses.insert(std::make_pair(iter->first, iter->second));
|
robotPoses.insert(std::make_pair(iter->first, iter->second));
|
||||||
cameraStamps.insert(std::make_pair(iter->first, node.getStamp()));
|
cameraStamps.insert(std::make_pair(iter->first, node.getStamp()));
|
||||||
bool intermediateNode = false;
|
|
||||||
if(models.empty() && node.getWeight() == -1 && !cameraModels.empty())
|
if(models.empty() && node.getWeight() == -1 && !cameraModels.empty())
|
||||||
{
|
{
|
||||||
// For intermediate nodes, use latest models
|
// For intermediate nodes, use latest models
|
||||||
models = cameraModels.rbegin()->second;
|
models = cameraModels.rbegin()->second;
|
||||||
intermediateNode = true;
|
|
||||||
}
|
}
|
||||||
if(!models.empty())
|
if(!models.empty())
|
||||||
{
|
{
|
||||||
if(!intermediateNode)
|
if(!node.sensorData().imageCompressed().empty())
|
||||||
{
|
{
|
||||||
cameraModels.insert(std::make_pair(iter->first, models));
|
cameraModels.insert(std::make_pair(iter->first, models));
|
||||||
}
|
}
|
||||||
@@ -1772,7 +1770,7 @@ int main(int argc, char * argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("Texturing %d polygons... robotPoses=%d, cameraDepths=%d\n", (int)mesh->polygons.size(), (int)robotPoses.size(), (int)cameraDepths.size());
|
printf("Texturing %d polygons... robotPoses=%d, cameraModels=%d, cameraDepths=%d\n", (int)mesh->polygons.size(), (int)robotPoses.size(), (int)cameraModels.size(), (int)cameraDepths.size());
|
||||||
std::vector<std::map<int, pcl::PointXY> > vertexToPixels;
|
std::vector<std::map<int, pcl::PointXY> > vertexToPixels;
|
||||||
pcl::TextureMeshPtr textureMesh = rtabmap::util3d::createTextureMesh(
|
pcl::TextureMeshPtr textureMesh = rtabmap::util3d::createTextureMesh(
|
||||||
mesh,
|
mesh,
|
||||||
|
|||||||
Reference in New Issue
Block a user