From 90939279f9b9318a1ee37029befdedff808c63bc Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 20 May 2018 14:18:53 +1000 Subject: [PATCH] PyBullet: cmake build, enable DBUILD_PYBULLET_NUMPY=ON fix issue with HalfCheetahBulletEnv-v0 in previous commit --- build_cmake_pybullet_double.sh | 2 +- examples/pybullet/gym/pybullet_envs/robot_locomotors.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build_cmake_pybullet_double.sh b/build_cmake_pybullet_double.sh index c1a7d403a..0f02d29d5 100755 --- a/build_cmake_pybullet_double.sh +++ b/build_cmake_pybullet_double.sh @@ -5,7 +5,7 @@ if [ -e CMakeCache.txt ]; then fi mkdir -p build_cmake cd build_cmake -cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=OFF -DUSE_DOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=Release .. || exit 1 +cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=ON -DUSE_DOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=Release .. || exit 1 make -j $(command nproc 2>/dev/null || echo 12) || exit 1 cd examples cd pybullet diff --git a/examples/pybullet/gym/pybullet_envs/robot_locomotors.py b/examples/pybullet/gym/pybullet_envs/robot_locomotors.py index 7f2d95ef1..4db807f5e 100644 --- a/examples/pybullet/gym/pybullet_envs/robot_locomotors.py +++ b/examples/pybullet/gym/pybullet_envs/robot_locomotors.py @@ -116,8 +116,8 @@ class HalfCheetah(WalkerBase): # Use contact other than feet to terminate episode: due to a lot of strange walks using knees return +1 if np.abs(pitch) < 1.0 and not self.feet_contact[1] and not self.feet_contact[2] and not self.feet_contact[4] and not self.feet_contact[5] else -1 - def robot_specific_reset(self): - WalkerBase.robot_specific_reset(self) + def robot_specific_reset(self, bullet_client): + WalkerBase.robot_specific_reset(self, bullet_client) self.jdict["bthigh"].power_coef = 120.0 self.jdict["bshin"].power_coef = 90.0 self.jdict["bfoot"].power_coef = 60.0