don't compensate for COLLADA up axis in collision element for now

(todo: let user override COLLADA up axis, some URDF files are inconsistent)
This commit is contained in:
=
2015-09-10 17:36:19 -07:00
parent d72cda101c
commit 2257ec05ad
2 changed files with 6 additions and 8 deletions

View File

@@ -742,7 +742,8 @@ btCollisionShape* convertURDFToCollisionShape(const UrdfCollision* collision, co
//compensate upAxisTrans and unitMeterScaling here //compensate upAxisTrans and unitMeterScaling here
btMatrix4x4 upAxisMat; btMatrix4x4 upAxisMat;
upAxisMat.setPureRotation(upAxisTrans.getRotation()); upAxisMat.setIdentity();
//upAxisMat.setPureRotation(upAxisTrans.getRotation());
btMatrix4x4 unitMeterScalingMat; btMatrix4x4 unitMeterScalingMat;
unitMeterScalingMat.setPureScaling(btVector3(unitMeterScaling,unitMeterScaling,unitMeterScaling)); unitMeterScalingMat.setPureScaling(btVector3(unitMeterScaling,unitMeterScaling,unitMeterScaling));
btMatrix4x4 worldMat = unitMeterScalingMat*instance->m_worldTransform*upAxisMat; btMatrix4x4 worldMat = unitMeterScalingMat*instance->m_worldTransform*upAxisMat;
@@ -851,10 +852,8 @@ int BulletURDFImporter::convertLinkVisualShapes(int linkIndex, const char* pathP
for (int v = 0; v < link->m_visualArray.size();v++) for (int v = 0; v < link->m_visualArray.size();v++)
{ {
const UrdfVisual& vis = link->m_visualArray[v]; const UrdfVisual& vis = link->m_visualArray[v];
btTransform childTrans = vis.m_linkLocalFrame; btTransform childTrans = vis.m_linkLocalFrame;
convertURDFToVisualShape(&vis, pathPrefix, inertialFrame.inverse()*childTrans, vertices, indices); convertURDFToVisualShape(&vis, pathPrefix, inertialFrame.inverse()*childTrans, vertices, indices);
} }
} }
#endif #endif
@@ -909,8 +908,7 @@ int BulletURDFImporter::convertLinkVisualShapes(int linkIndex, const char* pathP
btTransform childTrans = col.m_linkLocalFrame; btTransform childTrans = col.m_linkLocalFrame;
compoundShape->addChildShape(localInertiaFrame.inverse()*childTrans,childShape); compoundShape->addChildShape(localInertiaFrame.inverse()*childTrans,childShape);
}
}
} }
} }

View File

@@ -185,7 +185,7 @@ void ImportUrdfSetup::initPhysics()
{ {
int upAxis = 2; int upAxis = 2;
m_guiHelper->setUpAxis(2); m_guiHelper->setUpAxis(upAxis);
this->createEmptyDynamicsWorld(); this->createEmptyDynamicsWorld();
//m_dynamicsWorld->getSolverInfo().m_numIterations = 100; //m_dynamicsWorld->getSolverInfo().m_numIterations = 100;
@@ -356,7 +356,7 @@ void ImportUrdfSetup::initPhysics()
bool createGround=false; bool createGround=true;
if (createGround) if (createGround)
{ {
btVector3 groundHalfExtents(20,20,20); btVector3 groundHalfExtents(20,20,20);