disable the gMaxNumCmdPer1ms experiment by default (-1)

fix minitaur_evaluate.py script, quadruped.py
This commit is contained in:
erwincoumans
2017-03-04 12:59:21 -08:00
parent dcc4c0bda8
commit 44b140dd38
5 changed files with 95 additions and 45 deletions

View File

@@ -48,7 +48,7 @@ bool gResetSimulation = 0;
int gVRTrackingObjectUniqueId = -1;
btTransform gVRTrackingObjectTr = btTransform::getIdentity();
int gMaxNumCmdPer1ms = 10;//experiment: add some delay to avoid threads starving other threads
int gMaxNumCmdPer1ms = -1;//experiment: add some delay to avoid threads starving other threads
int gCreateObjectSimVR = -1;
int gEnableKukaControl = 0;
btVector3 gVRTeleportPos1(0,0,0);

View File

@@ -313,13 +313,15 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
b3Clock::usleep(0);
}
if (numCmdSinceSleep1ms>gMaxNumCmdPer1ms)
if (gMaxNumCmdPer1ms>0)
{
BT_PROFILE("usleep(1000)");
b3Clock::usleep(1000);
numCmdSinceSleep1ms = 0;
sleepClock.reset();
}
if (numCmdSinceSleep1ms>gMaxNumCmdPer1ms)
{
BT_PROFILE("usleep(10)");
b3Clock::usleep(10);
numCmdSinceSleep1ms = 0;
sleepClock.reset();
}
if (sleepClock.getTimeMilliseconds()>1)
{
sleepClock.reset();