From ab8f498d180f759b40609b70f3ce81c2516890c2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 18 Aug 2016 13:44:04 -0700 Subject: [PATCH 1/2] avoid infinite recursion in b3Clock::usleep --- examples/Utils/b3Clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Utils/b3Clock.cpp b/examples/Utils/b3Clock.cpp index 7482c302d..8e1884526 100644 --- a/examples/Utils/b3Clock.cpp +++ b/examples/Utils/b3Clock.cpp @@ -239,7 +239,7 @@ void b3Clock::usleep(int microSeconds) Sleep(millis); #else - usleep(microSeconds); + ::usleep(microSeconds); //struct timeval tv; //tv.tv_sec = microSeconds/1000000L; //tv.tv_usec = microSeconds%1000000L; From 2c636b52f7725acd096e88c27a63d9bfb4ac4ade Mon Sep 17 00:00:00 2001 From: erwin coumans Date: Thu, 18 Aug 2016 15:36:18 -0700 Subject: [PATCH 2/2] bugfix: in torque control mode, torque index starts at 6. --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 335855513..14df8c094 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -1418,7 +1418,7 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm b3Printf("Using CONTROL_MODE_TORQUE"); } // mb->clearForcesAndTorques(); - int torqueIndex = 0; + int torqueIndex = 6; if ((clientCmd.m_updateFlags&SIM_DESIRED_STATE_HAS_MAX_FORCE)!=0) { for (int link=0;linkgetNumLinks();link++)