diff --git a/data/pr2_gripper.urdf b/data/pr2_gripper.urdf index 6ca8dc674..7d16d986a 100644 --- a/data/pr2_gripper.urdf +++ b/data/pr2_gripper.urdf @@ -71,9 +71,9 @@ - + - + @@ -130,10 +130,17 @@ - + - + + + + + + + + diff --git a/examples/ExampleBrowser/main.cpp b/examples/ExampleBrowser/main.cpp index 0395fcbd9..46bbd2b0b 100644 --- a/examples/ExampleBrowser/main.cpp +++ b/examples/ExampleBrowser/main.cpp @@ -1,5 +1,3 @@ - - #include "OpenGLExampleBrowser.h" #include "Bullet3Common/b3CommandLineArgs.h" diff --git a/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp b/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp index 563c657a4..17f77631c 100644 --- a/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp +++ b/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp @@ -173,9 +173,17 @@ struct BulletMJCFImporterInternalData std::string sourceFileLocation(TiXmlElement* e) { +#if 0 + //no C++11 snprintf etc char buf[1024]; snprintf(buf, sizeof(buf), "%s:%i", m_sourceFileName.c_str(), e->Row()); return buf; +#else + char row[1024]; + sprintf(row,"%d",e->Row()); + std::string str = m_sourceFileName.c_str() + std::string(":") + std::string(row); + return str; +#endif } const UrdfLink* getLink(int modelIndex, int linkIndex) const diff --git a/examples/Importers/ImportURDFDemo/UrdfParser.cpp b/examples/Importers/ImportURDFDemo/UrdfParser.cpp index 0b42eb2c9..53857c6c2 100644 --- a/examples/Importers/ImportURDFDemo/UrdfParser.cpp +++ b/examples/Importers/ImportURDFDemo/UrdfParser.cpp @@ -1679,7 +1679,17 @@ bool UrdfParser::loadSDF(const char* sdfText, ErrorLogger* logger) std::string UrdfParser::sourceFileLocation(TiXmlElement* e) { +#if 0 + //no C++11 etc, no snprintf + char buf[1024]; snprintf(buf, sizeof(buf), "%s:%i", m_urdf2Model.m_sourceFile.c_str(), e->Row()); return buf; +#else + char row[1024]; + sprintf(row,"%d",e->Row()); + std::string str = m_urdf2Model.m_sourceFile.c_str() + std::string(":") + std::string(row); + return str; +#endif + } diff --git a/examples/SharedMemory/PhysicsServerExample.cpp b/examples/SharedMemory/PhysicsServerExample.cpp index 970b209d3..7ca002b8d 100644 --- a/examples/SharedMemory/PhysicsServerExample.cpp +++ b/examples/SharedMemory/PhysicsServerExample.cpp @@ -305,7 +305,8 @@ void MotionThreadFunc(void* userPtr,void* lsMemory) double deltaTimeInSeconds = 0; int numCmdSinceSleep1ms = 0; - + unsigned long long int prevTime = clock.getTimeMicroseconds(); + do { BT_PROFILE("loop"); @@ -330,8 +331,16 @@ void MotionThreadFunc(void* userPtr,void* lsMemory) sleepClock.reset(); numCmdSinceSleep1ms = 0; } + + unsigned long long int curTime = clock.getTimeMicroseconds(); + unsigned long long int dtMicro = curTime - prevTime; + prevTime = curTime; +#if 1 + double dt = double(dtMicro)/1000000.; +#else double dt = double(clock.getTimeMicroseconds())/1000000.; clock.reset(); +#endif deltaTimeInSeconds+= dt; { diff --git a/src/BulletDynamics/Featherstone/btMultiBody.cpp b/src/BulletDynamics/Featherstone/btMultiBody.cpp index c14aa2aea..07b2fcddb 100644 --- a/src/BulletDynamics/Featherstone/btMultiBody.cpp +++ b/src/BulletDynamics/Featherstone/btMultiBody.cpp @@ -112,7 +112,7 @@ btMultiBody::btMultiBody(int n_links, m_userObjectPointer(0), m_userIndex2(-1), m_userIndex(-1), - m_linearDamping(0.04f), + m_linearDamping(0.0f), m_angularDamping(0.04f), m_useGyroTerm(true), m_maxAppliedImpulse(1000.f), diff --git a/src/LinearMath/btQuickprof.cpp b/src/LinearMath/btQuickprof.cpp index b419495c0..c690b57c8 100644 --- a/src/LinearMath/btQuickprof.cpp +++ b/src/LinearMath/btQuickprof.cpp @@ -518,7 +518,7 @@ CProfileIterator * CProfileManager::Get_Iterator( void ) { int threadIndex = btQuickprofGetCurrentThreadIndex2(); - if (threadIndex<0) + if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT) return 0; return new CProfileIterator( &gRoots[threadIndex]); @@ -549,7 +549,7 @@ void CProfileManager::CleanupMemory(void) void CProfileManager::Start_Profile( const char * name ) { int threadIndex = btQuickprofGetCurrentThreadIndex2(); - if (threadIndex<0) + if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT) return; if (name != gCurrentNodes[threadIndex]->Get_Name()) { @@ -566,7 +566,7 @@ void CProfileManager::Start_Profile( const char * name ) void CProfileManager::Stop_Profile( void ) { int threadIndex = btQuickprofGetCurrentThreadIndex2(); - if (threadIndex<0) + if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT) return; // Return will indicate whether we should back up to our parent (we may @@ -590,7 +590,7 @@ void CProfileManager::Reset( void ) { gProfileClock.reset(); int threadIndex = btQuickprofGetCurrentThreadIndex2(); - if (threadIndex<0) + if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT) return; gRoots[threadIndex].Reset(); gRoots[threadIndex].Call(); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ff1da9bff..9bbfdf78c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,5 +3,5 @@ IF(BUILD_BULLET3) SUBDIRS( InverseDynamics SharedMemory ) ENDIF(BUILD_BULLET3) -SUBDIRS( gtest-1.7.0 collision RobotLogging BulletDynamics ) +SUBDIRS( gtest-1.7.0 collision BulletDynamics )