diff --git a/data/multibody.bullet b/data/multibody.bullet index 32b9e7f37..563b8939b 100644 Binary files a/data/multibody.bullet and b/data/multibody.bullet differ diff --git a/examples/ExampleBrowser/premake4.lua b/examples/ExampleBrowser/premake4.lua index b57b05a82..94cd3f7ee 100644 --- a/examples/ExampleBrowser/premake4.lua +++ b/examples/ExampleBrowser/premake4.lua @@ -27,7 +27,7 @@ project "App_BulletExampleBrowser" initOpenCL("clew") end - links{"BulletExampleBrowserLib","gwen", "OpenGL_Window","BulletSoftBody", "BulletInverseDynamicsUtils", "BulletInverseDynamics", "BulletDynamics","BulletCollision","rbdl_static","LinearMath","BussIK", "Bullet3Common"} + links{"BulletExampleBrowserLib","gwen", "OpenGL_Window","BulletSoftBody", "BulletInverseDynamicsUtils", "BulletInverseDynamics", "BulletDynamics","BulletCollision","LinearMath","BussIK", "Bullet3Common"} initOpenGL() initGlew() @@ -137,13 +137,8 @@ project "App_BulletExampleBrowser" "../SharedMemory/plugins/stablePDPlugin/Shape.cpp", "../SharedMemory/plugins/stablePDPlugin/RBDUtil.cpp", "../SharedMemory/plugins/stablePDPlugin/RBDModel.cpp", - "../SharedMemory/plugins/stablePDPlugin/Rand.cpp", "../SharedMemory/plugins/stablePDPlugin/MathUtil.cpp", "../SharedMemory/plugins/stablePDPlugin/KinTree.cpp", - "../SharedMemory/plugins/stablePDPlugin/FileUtil.cpp", - "../SharedMemory/plugins/stablePDPlugin/json/json_writer.cpp", - "../SharedMemory/plugins/stablePDPlugin/json/json_value.cpp", - "../SharedMemory/plugins/stablePDPlugin/json/json_reader.cpp", "../SharedMemory/SharedMemoryCommands.h", "../SharedMemory/SharedMemoryPublic.h", "../SharedMemory/b3RobotSimulatorClientAPI_NoGUI.cpp", diff --git a/examples/pybullet/examples/humanoidMotionCapture.py b/examples/pybullet/examples/humanoidMotionCapture.py index 45d943a9a..765a88498 100644 --- a/examples/pybullet/examples/humanoidMotionCapture.py +++ b/examples/pybullet/examples/humanoidMotionCapture.py @@ -2,7 +2,11 @@ import pybullet as p import json import time -p.connect(p.GUI) +useGUI = True +if useGUI: + p.connect(p.GUI) +else: + p.connect(p.DIRECT) useZUp = False useYUp = not useZUp @@ -198,15 +202,19 @@ p.getCameraImage(320,200) while (p.isConnected()): - - erp = p.readUserDebugParameter(erpId) - - kpMotor = p.readUserDebugParameter(kpMotorId) - maxForce=p.readUserDebugParameter(forceMotorId) + if useGUI: + erp = p.readUserDebugParameter(erpId) + kpMotor = p.readUserDebugParameter(kpMotorId) + maxForce=p.readUserDebugParameter(forceMotorId) + frameReal = p.readUserDebugParameter(frameId) + else: + erp = 0.2 + kpMotor = 0.2 + maxForce=1000 + frameReal = 0 + kp=kpMotor - - frameReal = p.readUserDebugParameter(frameId) frame = int(frameReal) frameNext = frame+1 if (frameNext >= numFrames): diff --git a/setup.py b/setup.py index 4f13322bb..c84a0fe53 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,8 @@ from setuptools import find_packages from sys import platform as _platform import sys import glob +import os + from distutils.core import setup from distutils.extension import Extension @@ -12,6 +14,8 @@ from glob import glob # monkey-patch for parallel compilation import multiprocessing import multiprocessing.pool + + def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): # those lines are copied from distutils.ccompiler.CCompiler directly macros, objects, extra_postargs, pp_opts, build = self._setup_compile(output_dir, macros, include_dirs, sources, depends, extra_postargs) @@ -21,7 +25,11 @@ def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=N def _single_compile(obj): try: src, ext = build[obj] except KeyError: return - self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) + newcc_args = cc_args + if _platform == "darwin": + if src.endswith('.cpp'): + newcc_args = cc_args + ["-stdlib=libc++"] + self._compile(obj, src, ext, newcc_args, extra_postargs, pp_opts) # convert to list, imap is evaluated on-demand pool = multiprocessing.pool.ThreadPool(N) list(pool.imap(_single_compile,objects)) @@ -29,7 +37,6 @@ def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=N import distutils.ccompiler distutils.ccompiler.CCompiler.compile=parallelCCompile - #see http://stackoverflow.com/a/8719066/295157 import os @@ -381,7 +388,7 @@ elif _platform == "win32": +["examples/ThirdPartyLibs/glad/gl.c"] elif _platform == "darwin": print("darwin!") - os.environ['LDFLAGS'] = '-framework Cocoa -framework OpenGL' + os.environ['LDFLAGS'] = '-framework Cocoa -stdlib=libc++ -framework OpenGL' CXX_FLAGS += '-DB3_NO_PYTHON_FRAMEWORK ' CXX_FLAGS += '-DHAS_SOCKLEN_T ' CXX_FLAGS += '-D_DARWIN '