@@ -194,8 +194,9 @@ void BulletURDFImporter::getAllIndices(
194194 int mbIndex = cache->getMbIndexFromUrdfIndex (urdfLinkIndex);
195195 cp.m_mbIndex = mbIndex;
196196 cp.m_parentIndex = parentIndex;
197- int parentMbIndex =
198- parentIndex >= 0 ? cache->getMbIndexFromUrdfIndex (parentIndex) : -1 ;
197+ int parentMbIndex = parentIndex >= 0
198+ ? cache->getMbIndexFromUrdfIndex (parentIndex)
199+ : BASELINK_ID;
199200 cp.m_parentMBIndex = parentMbIndex;
200201
201202 allIndices.emplace_back (std::move (cp));
@@ -255,9 +256,8 @@ void BulletURDFImporter::initURDFToBulletCache(
255256 cache->m_urdfLinkIndices2BulletLinkIndices .resize (
256257 numTotalLinksIncludingBase);
257258 cache->m_urdfLinkLocalInertialFrames .resize (numTotalLinksIncludingBase);
258-
259- cache->m_currentMultiBodyLinkIndex =
260- -1 ; // multi body base has 'link' index -1
259+ // multi body base has 'link' index BASELINK_ID
260+ cache->m_currentMultiBodyLinkIndex = BASELINK_ID;
261261
262262 bool maintainLinkOrder = (flags & CUF_MAINTAIN_LINK_ORDER) != 0 ;
263263 if (maintainLinkOrder) {
@@ -327,7 +327,7 @@ void BulletURDFImporter::convertURDFToBullet(
327327 parentTransforms[urdfLinkIndex] = parentTransformInWorldSpace;
328328 std::vector<childParentIndex> allIndices;
329329
330- getAllIndices (urdfLinkIndex, - 1 , allIndices);
330+ getAllIndices (urdfLinkIndex, BASELINK_ID , allIndices);
331331 std::sort (allIndices.begin (), allIndices.end (),
332332 [](const childParentIndex& a, const childParentIndex& b) {
333333 return a.m_index < b.m_index ;
0 commit comments