Skip to content

Commit 6ad2b7d

Browse files
committed
Make the vertex numbers match the old dot files
1 parent 31bf464 commit 6ad2b7d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

subt_ign/src/dot_generator.cc

+10-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,16 @@ bool fillVertexData(const std::string &_includeStr, VertexData &_vd)
162162
modelSdf.SetPose(pose);
163163

164164
static int tileId = 0;
165-
_vd.id = tileId++;
165+
// Try getting the tile id from the tile name first.
166+
try
167+
{
168+
int numIndex = name.rfind("_");
169+
_vd.id = std::stoi(name.substr(numIndex+1));
170+
}
171+
catch (...)
172+
{
173+
_vd.id = tileId++;
174+
}
166175
_vd.tileType = modelType;
167176
_vd.tileName = name;
168177
_vd.model = modelSdf;

0 commit comments

Comments
 (0)