From 56d0b7a09a2d22f84496c963b63314047d7661ed Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 29 Nov 2019 08:05:54 -0800 Subject: [PATCH] deep_mimic, read velocity from poseInterpolator, not kinematic model This fixes issue #2401 --- .../gym/pybullet_envs/deep_mimic/env/humanoid_stable_pd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/pybullet/gym/pybullet_envs/deep_mimic/env/humanoid_stable_pd.py b/examples/pybullet/gym/pybullet_envs/deep_mimic/env/humanoid_stable_pd.py index cbdf9d191..5a07d70a6 100644 --- a/examples/pybullet/gym/pybullet_envs/deep_mimic/env/humanoid_stable_pd.py +++ b/examples/pybullet/gym/pybullet_envs/deep_mimic/env/humanoid_stable_pd.py @@ -807,7 +807,10 @@ class HumanoidStablePD(object): rootPosSim, rootOrnSim = self._pybullet_client.getBasePositionAndOrientation(self._sim_model) rootPosKin, rootOrnKin = self._pybullet_client.getBasePositionAndOrientation(self._kin_model) linVelSim, angVelSim = self._pybullet_client.getBaseVelocity(self._sim_model) - linVelKin, angVelKin = self._pybullet_client.getBaseVelocity(self._kin_model) + #don't read the velocities from the kinematic model (they are zero), use the pose interpolator velocity + #see also issue https://github.com/bulletphysics/bullet3/issues/2401 + linVelKin = self._poseInterpolator._baseLinVel + angVelKin = self._poseInterpolator._baseAngVel root_rot_err = self.calcRootRotDiff(rootOrnSim, rootOrnKin) pose_err += root_rot_w * root_rot_err