diff --git a/Extras/CMakeLists.txt b/Extras/CMakeLists.txt index fc0d22604..58a161a45 100644 --- a/Extras/CMakeLists.txt +++ b/Extras/CMakeLists.txt @@ -1,5 +1,36 @@ -SUBDIRS( InverseDynamics BulletRoboticsGUI BulletRobotics obj2sdf Serialize ConvexDecomposition HACD GIMPACTUtils ) +OPTION(BUILD_INVERSE_DYNAMIC_EXTRA "Build InverseDynamic extra module, only applied when BUILD_EXTRAS is ON" ON) +OPTION(BUILD_BULLET_ROBOTICS_GUI_EXTRA "Build BulletRoboticsGUI extra module, only applied when BUILD_EXTRAS is ON" ON) +OPTION(BUILD_BULLET_ROBOTICS_EXTRA "Build BulletRobotics extra module, only applied when BUILD_EXTRAS is ON" ON) +OPTION(BUILD_OBJ2SDF_EXTRA "Build obj2sdf extra module, only applied when BUILD_EXTRAS is ON" ON) +OPTION(BUILD_SERIALIZE_EXTRA "Build Serialize extra module, only applied when BUILD_EXTRAS is ON" ON) +OPTION(BUILD_CONVEX_DECOMPOSITION_EXTRA "Build ConvexDecomposition extra module, only applied when BUILD_EXTRAS is ON" ON) +OPTION(BUILD_HACD_EXTRA "Build HACD extra module, only applied when BUILD_EXTRAS is ON" ON) +OPTION(BUILD_GIMPACTUTILS_EXTRA "Build GIMPACTUtils extra module, only applied when BUILD_EXTRAS is ON" ON) +IF(BUILD_INVERSE_DYNAMIC_EXTRA) + SUBDIRS( InverseDynamics ) +ENDIF() +IF(BUILD_BULLET_ROBOTICS_GUI_EXTRA) + SUBDIRS( BulletRoboticsGUI ) +ENDIF() +IF(BUILD_BULLET_ROBOTICS_EXTRA) + SUBDIRS( BulletRobotics ) +ENDIF() +IF(BUILD_OBJ2SDF_EXTRA) + SUBDIRS( obj2sdf ) +ENDIF() +IF(BUILD_SERIALIZE_EXTRA) + SUBDIRS( Serialize ) +ENDIF() +IF(BUILD_CONVEX_DECOMPOSITION_EXTRA) + SUBDIRS( ConvexDecomposition ) +ENDIF() +IF(BUILD_HACD_EXTRA) + SUBDIRS( HACD ) +ENDIF() +IF(BUILD_GIMPACTUTILS_EXTRA) + SUBDIRS( GIMPACTUtils ) +ENDIF() #Maya Dynamica plugin is moved to http://dynamica.googlecode.com diff --git a/README.md b/README.md index e0fb2af97..7b0c1e330 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,11 @@ This is the official C++ source code repository of the Bullet Physics SDK: real- ![PyBullet](https://pybullet.org/wordpress/wp-content/uploads/2019/03/cropped-pybullet.png) +## Issues ## +The Issue tracker was flooded with support questions and is closed until it is cleaned up. Use the [PyBullet forums](http://pybullet.org) to discuss with others. + ## PyBullet ## -New in Bullet 2.85: pybullet Python bindings, improved support for robotics and VR. Use pip install pybullet and checkout the [PyBullet Quickstart Guide](https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#heading=h.2ye70wns7io3). +It is highly recommended to use PyBullet Python bindings for improved support for robotics, reinforcement learning and VR. Use pip install pybullet and checkout the [PyBullet Quickstart Guide](https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#heading=h.2ye70wns7io3). Installation is simple: ``` @@ -63,7 +66,7 @@ You can download and install Bullet using the [vcpkg](https://github.com/Microso cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install - vcpkg install bullet3 + ./vcpkg install bullet3 The Bullet port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. @@ -91,9 +94,9 @@ p.connect(p.SHARED_MEMORY) #or (p.TCP, "localhost", 6667) or (p.UDP, "192.168.86 Make sure cmake is installed (sudo apt-get install cmake, brew install cmake, or https://cmake.org) In a terminal type: - - ./build_cmake_pybullet_double.sh - +``` +./build_cmake_pybullet_double.sh +``` This script will invoke cmake and build in the build_cmake directory. You can find pybullet in Bullet/examples/pybullet. The BulletExampleBrowser binary will be in Bullet/examples/ExampleBrowser. @@ -101,15 +104,15 @@ You can also build Bullet using premake. There are premake executables in the bu Depending on your system (Linux 32bit, 64bit or Mac OSX) use one of the following lines Using premake: ``` - cd build3 - ./premake4_linux --double gmake - ./premake4_linux64 --double gmake - ./premake4_osx --double --enable_pybullet gmake +cd build3 +./premake4_linux --double gmake +./premake4_linux64 --double gmake +./premake4_osx --double --enable_pybullet gmake ``` Then ``` - cd gmake - make +cd gmake +make ``` Note that on Linux, you need to use cmake to build pybullet, since the compiler has issues of mixing shared and static libraries. @@ -117,9 +120,9 @@ Note that on Linux, you need to use cmake to build pybullet, since the compiler **Mac OSX Xcode** Click on build3/xcode4.command or in a terminal window execute - - ./premake_osx xcode4 - +``` +./premake_osx xcode4 +``` ## Usage The App_ExampleBrowser executables will be located in the bin folder. diff --git a/examples/RobotSimulator/CMakeLists.txt b/examples/RobotSimulator/CMakeLists.txt index b2d6c2412..c17481f8c 100644 --- a/examples/RobotSimulator/CMakeLists.txt +++ b/examples/RobotSimulator/CMakeLists.txt @@ -149,7 +149,7 @@ ELSE() IF(NOT APPLE) FIND_PACKAGE(Threads) TARGET_LINK_LIBRARIES( App_HelloBulletRobotics ${CMAKE_THREAD_LIBS_INIT} ${DL} ) - ENDIF(APPLE) + ENDIF(NOT APPLE) ENDIF(WIN32) diff --git a/examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_env_randomizer.py b/examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_env_randomizer.py index 0fbfef36d..81b89f301 100644 --- a/examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_env_randomizer.py +++ b/examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_env_randomizer.py @@ -56,7 +56,7 @@ class MinitaurEnvRandomizer(env_randomizer_base.EnvRandomizerBase): leg_masses_upper_bound = np.array(leg_masses) * (1.0 + self._minitaur_leg_mass_err_range[1]) randomized_leg_masses = [ np.random.uniform(leg_masses_lower_bound[i], leg_masses_upper_bound[i]) - for i in xrange(len(leg_masses)) + for i in range(len(leg_masses)) ] minitaur.SetLegMasses(randomized_leg_masses) diff --git a/setup.py b/setup.py index 271d527a6..5b9a43dc9 100644 --- a/setup.py +++ b/setup.py @@ -501,7 +501,7 @@ if 'BT_USE_EGL' in EGL_CXX_FLAGS: setup( name='pybullet', - version='3.1.4', + version='3.1.5', description= 'Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning', long_description= diff --git a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp index 71184f36a..7cc6b8ab0 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp @@ -1294,9 +1294,7 @@ public: btVector3 normalColor(1, 1, 0); m_debugDrawer->drawLine(center, center + normal, normalColor); } - m_debugDrawer->drawLine(wv0, wv1, m_color); - m_debugDrawer->drawLine(wv1, wv2, m_color); - m_debugDrawer->drawLine(wv2, wv0, m_color); + m_debugDrawer->drawTriangle(wv0, wv1, wv2, m_color, 1.0); } }; diff --git a/src/BulletSoftBody/btDeformableBodySolver.cpp b/src/BulletSoftBody/btDeformableBodySolver.cpp index 4b11fccec..e81680f01 100644 --- a/src/BulletSoftBody/btDeformableBodySolver.cpp +++ b/src/BulletSoftBody/btDeformableBodySolver.cpp @@ -405,6 +405,10 @@ void btDeformableBodySolver::predictMotion(btScalar solverdt) for (int i = 0; i < m_softBodies.size(); ++i) { btSoftBody* psb = m_softBodies[i]; + /* Clear contacts */ + psb->m_nodeRigidContacts.resize(0); + psb->m_faceRigidContacts.resize(0); + psb->m_faceNodeContacts.resize(0); if (psb->isActive()) { @@ -472,10 +476,6 @@ void btDeformableBodySolver::predictDeformableMotion(btSoftBody* psb, btScalar d { psb->updateFaceTree(true, true); } - /* Clear contacts */ - psb->m_nodeRigidContacts.resize(0); - psb->m_faceRigidContacts.resize(0); - psb->m_faceNodeContacts.resize(0); /* Optimize dbvt's */ // psb->m_ndbvt.optimizeIncremental(1); // psb->m_fdbvt.optimizeIncremental(1); diff --git a/src/LinearMath/btIDebugDraw.h b/src/LinearMath/btIDebugDraw.h index 82ec19a69..df4db2ff5 100644 --- a/src/LinearMath/btIDebugDraw.h +++ b/src/LinearMath/btIDebugDraw.h @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -21,7 +21,7 @@ subject to the following restrictions: ///The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations. ///Typical use case: create a debug drawer object, and assign it to a btCollisionWorld or btDynamicsWorld using setDebugDrawer and call debugDrawWorld. -///A class that implements the btIDebugDraw interface has to implement the drawLine method at a minimum. +///A class that implements the btIDebugDraw interface will need to provide non-empty implementations of the the drawLine and getDebugMode methods at a minimum. ///For color arguments the X,Y,Z components refer to Red, Green and Blue each in the range [0..1] class btIDebugDraw {