diff --git a/examples/ExampleBrowser/OpenGLExampleBrowser.cpp b/examples/ExampleBrowser/OpenGLExampleBrowser.cpp index e028efdbf..1d78d8215 100644 --- a/examples/ExampleBrowser/OpenGLExampleBrowser.cpp +++ b/examples/ExampleBrowser/OpenGLExampleBrowser.cpp @@ -390,6 +390,13 @@ void OpenGLExampleBrowserVisualizerFlagCallback(int flag, bool enable) { gEnableRenderLoop = (enable!=0); } + + if (flag == COV_ENABLE_SINGLE_STEP_RENDERING) + { + singleStepSimulation = true; + } + + if (flag == COV_ENABLE_SHADOWS) { useShadowMap = enable; diff --git a/examples/OpenGLWindow/X11OpenGLWindow.cpp b/examples/OpenGLWindow/X11OpenGLWindow.cpp index 645e95b52..ddd3a1311 100644 --- a/examples/OpenGLWindow/X11OpenGLWindow.cpp +++ b/examples/OpenGLWindow/X11OpenGLWindow.cpp @@ -6,11 +6,7 @@ #include #include -#ifdef GLEW_STATIC #include "glad/gl.h" -#else -#include -#endif//GLEW_STATIC #ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS #include "glad/glx.h" diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index ab9f7fc23..5b32d13a3 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -1824,6 +1824,8 @@ void PhysicsServerCommandProcessor::setGuiHelper(struct GUIHelperInterface* guiH guiHelper->createPhysicsDebugDrawer(m_data->m_dynamicsWorld); } else { + //state loggers use guiHelper, so remove them before the guiHelper is deleted + deleteStateLoggers(); if (m_data->m_guiHelper && m_data->m_dynamicsWorld && m_data->m_dynamicsWorld->getDebugDrawer()) { diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index 55135dd22..a563fbad7 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -793,7 +793,7 @@ enum b3ConfigureDebugVisualizerEnum COV_ENABLE_DEPTH_BUFFER_PREVIEW, COV_ENABLE_SEGMENTATION_MARK_PREVIEW, COV_ENABLE_PLANAR_REFLECTION, - + COV_ENABLE_SINGLE_STEP_RENDERING, }; enum b3AddUserDebugItemEnum diff --git a/examples/SharedMemory/grpc/main.cpp b/examples/SharedMemory/grpc/main.cpp index 61306c26e..5560abd55 100644 --- a/examples/SharedMemory/grpc/main.cpp +++ b/examples/SharedMemory/grpc/main.cpp @@ -28,7 +28,7 @@ typedef SharedMemoryCommandProcessor MyCommandProcessor; #include #include -#include "proto/pybullet.grpc.pb.h" +#include "SharedMemory/grpc/proto/pybullet.grpc.pb.h" using grpc::Server; diff --git a/examples/pybullet/examples/collisionFilter.py b/examples/pybullet/examples/collisionFilter.py index ca7108891..e94b1f0f3 100644 --- a/examples/pybullet/examples/collisionFilter.py +++ b/examples/pybullet/examples/collisionFilter.py @@ -14,4 +14,5 @@ p.setCollisionFilterPair(planeId, cubeId,-1,-1,enableCollision ) p.setRealTimeSimulation(1) p.setGravity(0,0,-10) while (p.isConnected()): - time.sleep(1) \ No newline at end of file + time.sleep(1./240.) + p.setGravity(0,0,-10) diff --git a/examples/pybullet/examples/mylittleminitaur.py b/examples/pybullet/examples/mylittleminitaur.py deleted file mode 100644 index fd1ad4718..000000000 --- a/examples/pybullet/examples/mylittleminitaur.py +++ /dev/null @@ -1,21 +0,0 @@ -import pybullet as p -import time -import math -import sys -sys.path.append(".") - -from minitaur import Minitaur -p.connect(p.GUI) -p.setTimeOut(5) -#p.setPhysicsEngineParameter(numSolverIterations=50) -p.setGravity(0,0,-10) -p.setTimeStep(0.01) - -urdfRoot = '' -p.loadURDF("%s/plane.urdf" % urdfRoot) -minitaur = Minitaur(urdfRoot) - -while (True): - p.stepSimulation() - time.sleep(0.01) - \ No newline at end of file diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 9654d48a7..5a500c4ee 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -9815,6 +9815,7 @@ initpybullet(void) PyModule_AddIntConstant(m, "COV_ENABLE_DEPTH_BUFFER_PREVIEW", COV_ENABLE_DEPTH_BUFFER_PREVIEW); PyModule_AddIntConstant(m, "COV_ENABLE_SEGMENTATION_MARK_PREVIEW", COV_ENABLE_SEGMENTATION_MARK_PREVIEW); PyModule_AddIntConstant(m, "COV_ENABLE_PLANAR_REFLECTION", COV_ENABLE_PLANAR_REFLECTION); + PyModule_AddIntConstant(m, "COV_ENABLE_SINGLE_STEP_RENDERING", COV_ENABLE_SINGLE_STEP_RENDERING); PyModule_AddIntConstant(m, "ER_TINY_RENDERER", ER_TINY_RENDERER); diff --git a/setup.py b/setup.py index 075df915e..204e369a6 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,6 @@ CXX_FLAGS += '-DBT_USE_DOUBLE_PRECISION ' CXX_FLAGS += '-DBT_ENABLE_ENET ' CXX_FLAGS += '-DBT_ENABLE_CLSOCKET ' CXX_FLAGS += '-DB3_DUMP_PYTHON_VERSION ' -CXX_FLAGS += '-DBT_USE_EGL ' EGL_CXX_FLAGS = '' @@ -451,6 +450,10 @@ egl_renderer_sources = \ +["examples/OpenGLWindow/LoadShader.cpp"] \ +["src/LinearMath/btQuickprof.cpp"] +if 'BT_USE_EGL' in CXX_FLAGS: + sources += ['examples/ThirdPartyLibs/glad/egl.c'] + sources += ['examples/OpenGLWindow/EGLOpenGLWindow.cpp'] + if _platform == "linux" or _platform == "linux2": libraries = ['dl','pthread'] CXX_FLAGS += '-D_LINUX ' @@ -468,9 +471,6 @@ if _platform == "linux" or _platform == "linux2": +["examples/ThirdPartyLibs/glad/gl.c"]\ +["examples/ThirdPartyLibs/glad/glx.c"] include_dirs += ["examples/ThirdPartyLibs/optionalX11"] - if 'BT_USE_EGL' in CXX_FLAGS: - sources += ['examples/ThirdPartyLibs/glad/egl.c'] - sources += ['examples/OpenGLWindow/EGLOpenGLWindow.cpp'] if 'BT_USE_EGL' in EGL_CXX_FLAGS: egl_renderer_sources = egl_renderer_sources\ @@ -545,7 +545,7 @@ eglRender = Extension("eglRenderer", setup( name = 'pybullet', - version='2.1.5', + version='2.1.6', description='Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning', long_description='pybullet is an easy to use Python module for physics simulation, robotics and deep reinforcement learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.', url='https://github.com/bulletphysics/bullet3',