deepmimic fix: reference initialization wasn't spread over all frames

This commit is contained in:
Erwin Coumans
2019-02-01 17:18:13 -08:00
parent 7cc2685faf
commit 1cef924973
5 changed files with 62 additions and 7 deletions

View File

@@ -68,7 +68,7 @@ class HumanoidStablePD(object):
self.resetPose()
def resetPose(self):
print("resetPose with self._frameFraction=",self._frameFraction)
print("resetPose with self._frame=", self._frame, " and self._frameFraction=",self._frameFraction)
pose = self.computePose(self._frameFraction)
self.initializePose(self._poseInterpolator, self._sim_model, initBase=True)
self.initializePose(self._poseInterpolator, self._kin_model, initBase=False)
@@ -126,7 +126,6 @@ class HumanoidStablePD(object):
keyFrameDuration = self._mocap_data.KeyFrameDuraction()
cycleTime = self.getCycleTime()
#print("self._motion_data.NumFrames()=",self._mocap_data.NumFrames())
#print("cycleTime=",cycleTime)
cycles = self.calcCycleCount(t, cycleTime)
#print("cycles=",cycles)
frameTime = t - cycles*cycleTime

View File

@@ -64,8 +64,12 @@ class PyBulletDeepMimicEnv(Env):
#self._humanoid.applyPDForces(taus)
#self._pybullet_client.stepSimulation()
time.sleep(timeStep)
#print("numframes = ", self._humanoid._mocap_data.NumFrames())
startTime = random.randint(0,self._humanoid._mocap_data.NumFrames()-2)
rnrange = 1000
rn = random.randint(0,rnrange)
startTime = float(rn)/rnrange * self._humanoid.getCycleTime()
self._humanoid.setSimTime(startTime)
self._humanoid.resetPose()
#this clears the contact points. Todo: add API to explicitly clear all contact points?