From 3b779ad3e94e2c70fbeef27c2cf43648759772c5 Mon Sep 17 00:00:00 2001 From: Logan Su Date: Fri, 23 Sep 2016 11:45:46 -0700 Subject: [PATCH] Do not add limits for continuous joints. --- examples/Importers/ImportURDFDemo/URDF2Bullet.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/Importers/ImportURDFDemo/URDF2Bullet.cpp b/examples/Importers/ImportURDFDemo/URDF2Bullet.cpp index 5478b5b7d..1350076e6 100644 --- a/examples/Importers/ImportURDFDemo/URDF2Bullet.cpp +++ b/examples/Importers/ImportURDFDemo/URDF2Bullet.cpp @@ -320,15 +320,12 @@ void ConvertURDF2BulletInternal( cache.m_bulletMultiBody->getLink(mbLinkIndex).m_jointDamping = jointDamping; cache.m_bulletMultiBody->getLink(mbLinkIndex).m_jointFriction= jointFriction; creation.addLinkMapping(urdfLinkIndex,mbLinkIndex); - if (jointLowerLimit <= jointUpperLimit) - { - //std::string name = u2b.getLinkName(urdfLinkIndex); - //printf("create btMultiBodyJointLimitConstraint for revolute link name=%s urdf link index=%d (low=%f, up=%f)\n", name.c_str(), urdfLinkIndex, jointLowerLimit, jointUpperLimit); - - btMultiBodyConstraint* con = new btMultiBodyJointLimitConstraint(cache.m_bulletMultiBody, mbLinkIndex, jointLowerLimit, jointUpperLimit); - world1->addMultiBodyConstraint(con); - } - + if (jointType == URDFRevoluteJoint && jointLowerLimit <= jointUpperLimit) { + //std::string name = u2b.getLinkName(urdfLinkIndex); + //printf("create btMultiBodyJointLimitConstraint for revolute link name=%s urdf link index=%d (low=%f, up=%f)\n", name.c_str(), urdfLinkIndex, jointLowerLimit, jointUpperLimit); + btMultiBodyConstraint* con = new btMultiBodyJointLimitConstraint(cache.m_bulletMultiBody, mbLinkIndex, jointLowerLimit, jointUpperLimit); + world1->addMultiBodyConstraint(con); + } } else {