Commit Graph
100 Commits
Author SHA1 Message Date
erwincoumans 9553892770 PyBullet / BulletRobotics:
Implement collisionFilterPlugin, use setCollisionFilterPair to enable or disable collision detection between specific pairs of objects.
Also, expose setCollisionFilterGroupMask as PyBullet API and in urdf using the tag <collision group="1" mask="2"/>.
See examples/pybullet/examples/collisionFilter.py for an example.
PyBullet default: Lower the warmstarting factor, for maximal coordinates rigid bodies for more stable simulation.
Add btCollisionWorld::refreshBroadphaseProxy to easier recreate the broadphase proxy without adding/removing objects to the world.
2018-09-12 19:30:49 -07:00
erwincoumans bf3399d0e3 Merge remote-tracking branch 'bp/master' 2018-09-12 09:18:25 -07:00
erwincoumans 2a3a60ac64 Merge pull request #1874 from erwincoumans/master
more egl plugin fixes, create stb_image_write.cpp (instead of magic defines in various source files)
2018-09-11 14:14:40 -07:00
erwincoumans 87e8711b0a Merge pull request #1872 from RanTig/GetLinkStateFix
Change b3GetLinkState to use numLinks in status handle
2018-09-11 08:48:30 -07:00
erwincoumans 5b1588fc3f fix createProtobufs.bat script 2018-09-10 23:32:51 -07:00
erwincoumans 684a9f6a99 move stb_image/stb_image_write.cpp into a cpp file instead of random files with the magic 'STB_IMAGE_WRITE_IMPLEMENTATION' define
move setup.py back to eglRenderer extension, use pkgutil.get_loader('eglRenderer').get_filename()
disable dlmopen by default, unless B3_USE_DLMOPEN is defined.
2018-09-10 23:18:34 -07:00
erwincoumans ab84975ca9 Merge pull request #1870 from erwincoumans/master
pybullet eglPlugin: fix Mac OSX build
2018-09-10 12:23:36 -07:00
erwincoumans 1a047901ce Merge pull request #1869 from erwincoumans/master
fixes in eglRendererPlugin
2018-09-10 07:51:39 -07:00
erwincoumans 9698c3d600 PyBullet setup.py: only enable BT_USE_EGL on Linux, but allow to run the eglPlugin on Windows and Mac as well (using their default opengl window).
postpone the 'loadPlugin' for static eglPlugin, so that the init and exit happen in the same thread.
When you don't call unloadPlugin, the program may crash when exiting in SHARED_MEMORY_SERVER mode.
2018-09-09 21:08:47 -07:00
erwincoumans 2744e84592 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-09-09 15:25:27 -07:00
erwincoumans 7369005402 pybullet, use eglPlugin statically instead of dynamic loading an Extension -DSTATIC_EGLRENDERER_PLUGIN
Fix compile errors of pybullet on Windows.
2018-09-09 15:23:26 -07:00
erwincoumans c4fe0f7357 disable enable_egl by default (?!?) 2018-09-09 14:39:56 -07:00
erwincoumans adb5c049c7 Thanks to @dchichkov for some of the fixes in the eglRendererPlugin!
Rename tinyRenderer -> eglRenderer in the eglRendererPlugin.
Allow to run the eglRendererPlugin to run on Windows (not in EGL mode but Win32OpenGLWindow mode)

Here is a script I tested on Windows:
~~~~~~~~~~~~
mport pybullet as p
import time

p.connect(p.DIRECT)
plugin = p.loadPlugin("e:/develop/bullet3/bin/pybullet_eglRendererPlugin_vs2010_x64_debug.dll","_eglRendererPlugin")
print("plugin=",plugin)
p.setGravity(0,0,-10)
p.loadURDF("plane.urdf",[0,0,-1])
p.loadURDF("r2d2.urdf")
pixelWidth = 320
pixelHeight = 220
while (1):
	p.stepSimulation()
	viewMatrix = [1.0, 0.0, -0.0, 0.0, -0.0, 0.1736481785774231, -0.9848078489303589, 0.0, 0.0, 0.9848078489303589, 0.1736481785774231, 0.0, -0.0, -5.960464477539063e-08, -4.0, 1.0]
	projectionMatrix  = [1.0825318098068237, 0.0, 0.0, 0.0, 0.0, 1.732050895690918, 0.0, 0.0, 0.0, 0.0, -1.0002000331878662, -1.0, 0.0, 0.0, -0.020002000033855438, 0.0]

	#img_arr = p.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, shadow=1,lightDirection=[1,1,1])#,renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
	img_arr = p.getCameraImage(pixelWidth, pixelHeight, shadow=1,lightDirection=[1,1,1])#,renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
	#print("img_arr=",img_arr)
	time.sleep(1)
~~~~~~~~~~~~~
2018-09-09 13:37:49 -07:00
erwincoumans dc7feb9027 Merge remote-tracking branch 'bp/master' 2018-09-09 10:48:58 -07:00
erwincoumans 233a7083d1 Merge pull request #1790 from BlGene/egl-plugin
OpenGL render plugin
2018-09-09 09:27:15 -07:00
erwincoumans 377a89c09c Merge pull request #1866 from jna29/bug-fix/robot-manipulators-errors
Fixed bugs mistaking forearm_roll_joint for upper_arm_roll_joint
2018-09-08 18:53:47 -07:00
erwincoumans 63f4a63e15 since parent collision is always disabled by default for self-collision, we add a new flag
URDF_USE_SELF_COLLISION_INCLUDE_PARENT, to force self-collision between direct parent/child (not recommended in general)
2018-09-08 14:46:43 -07:00
erwincoumans cc91b4a7cf Merge pull request #1865 from erwincoumans/master
update quickstart guide, bump up pybullet version
2018-09-08 13:50:52 -07:00
erwincoumans 9085c18354 Merge pull request #1863 from erwincoumans/master
remove pre-build proto/grpc files (they differ for each platform and …
2018-09-07 16:17:06 -07:00
erwincoumans 5164f2f9a7 remove pre-build proto/grpc files (they differ for each platform and proto/grpc version) 2018-09-07 15:44:33 -07:00
erwincoumans 12409f1118 Merge pull request #1860 from erwincoumans/master
allow pybullet to connect to GRPC server. (need to use flag --enable_…
2018-09-05 21:20:21 -07:00
erwincoumans 0efc67841d allow pybullet to connect to GRPC server. (need to use flag --enable_grpc in premake build system)
add grpcPlugin, it can work in GUI, SHARED_MEMORY_SERVER, DIRECT and other modes.
example script to start server from pybullet:
import pybullet as p
p.connect(p.GUI)
#if statically linked plugin
id = p.loadPlugin("grpcPlugin")
#dynamics loading the plugin
#id = p.loadPlugin("E:/develop/bullet3/bin/pybullet_grpcPlugin_vs2010_x64_debug.dll", postFix="_grpcPlugin")

#start the GRPC server at hostname, port
if (id>=0):
	p.executePluginCommand(id, "localhost:1234")

Only in DIRECT mode, since there is no 'ping' you need to call to handle RCPs:
numRPC = 10
while (1):
	p.executePluginCommand(id, intArgs=[numRPC])
2018-09-05 17:58:14 -07:00
erwincoumans 437c0426c9 Merge pull request #1859 from erwincoumans/master
only add notifications if there is a plugin that needs them
2018-09-04 20:59:29 -07:00
erwincoumans c084763795 Merge pull request #1858 from erwincoumans/master
make GRPC work on Linux,
2018-09-04 17:49:49 -07:00
erwincoumans 2006f134b6 Merge pull request #1857 from erwincoumans/master
make grpc work on Mac OSX with premake
2018-09-04 17:03:27 -07:00
erwincoumans 710e660763 Merge pull request #1855 from erwincoumans/master
more work on grpc/proto/pybullet.proto
2018-09-04 12:11:03 -07:00
erwincoumans c4842220a8 Merge pull request #1852 from RanTig/remove-visual-shape
Removes visual shape data when a body gets removed.
2018-09-04 09:42:48 -07:00
erwincoumans 5b5e4f4d74 Merge pull request #1854 from RanTig/pybullet-plugincommand-fix
Small fix in executePluginCommand
2018-09-04 09:42:32 -07:00
erwincoumans 9b66074949 add some missing GRPC files 2018-09-04 09:10:57 -07:00
erwincoumans 9e2f6c7935 more GRPC work 2018-09-03 23:13:15 -07:00
erwincoumans 23e84ca9b6 more work on proto/pybullet.proto 2018-09-01 13:49:56 -07:00
erwincoumans 3285143232 Merge pull request #1851 from RanTig/use-dlmopen
Uses dlmopen() instead of dlopen() in b3PluginManager.cpp. This allow…
2018-08-31 14:13:13 -07:00
erwincoumans a9299fbd0c Merge pull request #1853 from erwincoumans/master
fix crash in btInternalEdgeUtility when a mesh is not the expected type
2018-08-31 14:12:43 -07:00
erwincoumans 4bf846822f Merge pull request #1850 from erwincoumans/master
Add preliminary GRPC server for PyBullet and BulletRobotics.
2018-08-30 19:40:13 -07:00
erwincoumans f10068b7c9 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-08-30 18:36:06 -07:00
erwincoumans ee9fca8c29 GJK fix for https://github.com/bulletphysics/bullet3/issues/1703
In a nutshell, we added a more reliable check, based on if the origin is in the GJK simplex, to determine if we are really intersecting and need to run EPA.
See also "Real-time Collision Detection with Implicit Objects" by Leif Olvang
Todo: integrate the simplex penetration check directly inside the Bullet btVoronoiSimplexSolver
and remove this temporary code from libCCD
Note, for large differences in shapes, use double precision build!
2018-08-30 18:35:51 -07:00
erwincoumans 4f7dfc2069 Add preliminary GRPC server for PyBullet and BulletRobotics.
Will add GRPC client and PyBullet GRPC server plugin.
Will cover most/all SharedMemoryCommand/SharedMemoryStatus messages.
Run the server, then test using the pybullet_client.py
2018-08-29 21:12:13 -07:00
erwincoumans 4d00beefbb Merge pull request #1849 from madebr/fix_1827
Fix for bug #1827
2018-08-29 20:54:31 -07:00
erwincoumans 65175425b0 Merge pull request #1848 from erwincoumans/master
more fixes related to islands
2018-08-27 08:50:46 -07:00
Erwin Coumans 2668b89740 fix another island issue 2018-08-26 22:25:39 -07:00
erwincoumans 8cac231890 Merge pull request #1847 from erwincoumans/master
Fix some deactivation issues with btMultiBodyDynamicsWorld, should al…
2018-08-26 18:38:34 -07:00
Erwin Coumans 72c48870b0 after picking in a multibody demo, allow sleeping for rigid bodies 2018-08-26 18:07:28 -07:00
Erwin Coumans 186ddb81d8 fix tab/space issue in Python file
fix determinism issue introduced in previous commit
2018-08-26 17:17:42 -07:00
Erwin Coumans ff43cea263 Fix some deactivation issues with btMultiBodyDynamicsWorld, should also improve performance for PyBullet with larger worlds
(even when sleeping is disabled, islands are split)
2018-08-26 16:14:36 -07:00
erwincoumans d5514ef68d Merge pull request #1846 from erwincoumans/master
also drop 'model://' from URDF file names (like we drop package://)
2018-08-26 11:40:13 -07:00
erwincoumans 1bc3cec547 Merge pull request #1844 from erwincoumans/master
remove leading space
2018-08-25 11:55:37 -07:00
erwincoumans 4eb0598e8e Merge pull request #1838 from gkjohnson/fix-urdf-xml-version
Change URDF xml version from "0.0" to "1.0"
2018-08-23 23:08:48 -07:00
erwincoumans 78946c8ca7 Merge pull request #1842 from crewmatt/crewmatt-ikoriginalpositions
Allow current positions for Calculate IK.
2018-08-23 23:07:48 -07:00
erwincoumans aace31c1fa Merge pull request #1843 from rhaschke/master
preserve constness to avoid compiler warnings
2018-08-23 23:06:54 -07:00
erwincoumans d44571a4b3 Merge pull request #1832 from erwincoumans/master
fix parameter mismatch in SerialChains.cpp
2018-08-10 02:03:12 +00:00
erwincoumans 2c425f72fe Merge pull request #1831 from erwincoumans/master
bump up pybullet version, revert linear slop
2018-08-09 23:56:29 +00:00
erwincoumans 1410c84824 Merge pull request #1830 from erwincoumans/master
add missing SerialChains.cpp file to premake4.lua
2018-08-09 23:31:03 +00:00
Erwin Coumans 07b21ca4a2 add missing SerialChains.cpp file to premake4.lua 2018-08-09 16:30:20 -07:00
erwincoumans ec5cc04680 Merge pull request #1818 from jslee02/multibody_mlcp_solver_v2
Add MLCP constraint solver for multibody
2018-08-09 22:54:52 +00:00
erwincoumans 8ca9e66294 Merge pull request #1829 from erwincoumans/master
data: add license files (mostly copied from the URDF files)
2018-08-09 22:51:46 +00:00
Erwin Coumans d3d0d948cc data: add license files (mostly copied from the URDF files) 2018-08-09 15:50:39 -07:00
erwincoumans 6fe1b000e5 Merge pull request #1820 from erwincoumans/master
fix previous revert of btMultiBody.cpp
2018-08-03 18:05:59 -07:00
erwincoumans 961d8adad1 Merge pull request #1806 from erwincoumans/master
prepare build system(s) for collisionFilterPlugin
2018-08-03 17:43:13 -07:00
erwincoumans 7d38cab1aa Merge pull request #1811 from RanTig/SimulationSteppedNotification
Adds a simulation stepped notification
2018-08-02 20:34:22 +02:00
erwincoumans 8b27a7311c Merge pull request #1801 from RanTig/TickPlugins
Notify plugins on certain events (e.g. body added).
2018-07-27 14:58:55 +02:00
erwincoumans fa41e2945c Merge pull request #1804 from erwincoumans/master
fix memory leak reported in Issue #1800
2018-07-27 14:50:45 +02:00
Erwin Coumans a696bd6a46 fix memory leak reported in Issue #1800
avoid access to array elements outside of range
2018-07-25 19:59:29 +02:00
erwincoumans 0c66696e19 Merge pull request #1803 from mbeards/id_macro_collision
Renamed error_message and warning_message macros.
2018-07-24 22:54:03 +02:00
erwincoumans 27b3241ff1 Merge pull request #1802 from erwincoumans/master
use the maximum square residual instead of sum
2018-07-24 20:46:01 +02:00
Erwin Coumans f0c8bbf1a1 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-07-24 15:21:12 +02:00
Erwin Coumans f91e5c573c use the maximum square residual instead of sum 2018-07-24 15:20:34 +02:00
erwincoumans 0e1dce41ea Merge pull request #1799 from erwincoumans/master
in solver,  body1 -> bodyA and body2 -> bodyB
2018-07-22 20:14:45 +02:00
erwincoumans defd961f60 Merge pull request #1798 from erwincoumans/master
Change constraint solver threshold-based termination condition on res…
2018-07-22 12:28:32 +02:00
Erwin Coumans b5495e789d Change constraint solver threshold-based termination condition on residual of velocity threshold, not on residual of impulse threshold.
This avoids issues with systems with large mass ratios.

Test: add this to BasicDemo/BasicExample.cpp in initPhysics

	m_dynamicsWorld->getSolverInfo().m_numIterations = 1000;
	m_dynamicsWorld->getSolverInfo().m_leastSquaresResidualThreshold = 1e-4;
2018-07-22 11:30:16 +02:00
erwincoumans c254768d1a Merge pull request #1793 from jslee02/fix_build_clang6
Fix build errors with Clang 6 (also resolve #1510)
2018-07-19 09:20:42 +02:00
erwincoumans a8d81eb155 Merge pull request #1787 from jslee02/multibody_cleanup
Minor code optimization in multibody forward dynamics
2018-07-18 10:19:02 +02:00
erwincoumans 3d5c921495 Merge pull request #1782 from RanTig/userdata
Changes UserData to use global identifiers and makes linkIndex optional.
2018-07-09 11:36:51 +02:00
erwincoumans d6aae09290 Merge pull request #1780 from erwincoumans/master
PyBullet: preliminary DART and MuJoCo backend code (mostly empty placeholders)
2018-07-09 11:25:33 +02:00
Erwin Coumans 2ce1e65b53 PyBullet: tweak in TCP server for VR - ROS bridge 2018-07-03 16:30:54 -07:00
Erwin Coumans c0183d4834 Merge remote-tracking branch 'bp/master' 2018-07-03 16:28:45 -07:00
erwincoumans 23f235e449 PyBullet: add example to enable another physics engine backend (DART, MuJoCo) 2018-07-01 14:49:34 -07:00
erwincoumans 98fc4b1510 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-07-01 14:42:48 -07:00
erwincoumans 0d8564db22 PyBullet: added preliminary DART and MuJoCo backend files, MuJoCo can loadMJCF, stepSimulation and getBasePositionAndOrientation, DART is empty.
PyBullet: add 2d biped example.,
2018-07-01 14:42:32 -07:00
Erwin Coumans bfc85ff1fd PyBullet: TCP connection, optimized getVREvents to allow faster Windows -> Linux Vive tracking state communication. 2018-06-27 23:43:42 -07:00
erwincoumans 04556502f0 Merge pull request #1778 from erwincoumans/master
fix hidden API
2018-06-27 09:21:11 -07:00
erwincoumans c531234f3a Merge pull request #1774 from erwincoumans/master
PyBullet: allow to replace existing debug lines in addUserDebugLine t…
2018-06-26 10:40:40 -07:00
erwincoumans e023d94b32 Merge pull request #1775 from bingjeff/marios_fix_global_variables
remove some debug globals from third_party/bullet
2018-06-26 08:58:27 -07:00
erwincoumans 1b69e22df6 Merge pull request #1776 from YunfeiBai/master
Remove the pdController when maxForce = 0
2018-06-26 08:54:40 -07:00
erwincoumans 49b0ec08e1 PyBullet: allow to replace existing debug lines in addUserDebugLine through the replaceItemUniqueId argument
See batchRayCast.py for example usage
2018-06-22 16:47:20 -07:00
erwincoumans 6b2cae1b1d Merge pull request #1769 from RanTig/parallel_raycast_fix
Several fixes for the parallel raycasts
2018-06-22 15:49:56 -07:00
erwincoumans 09751a0b6b Merge pull request #1770 from erwincoumans/master
PyBullet urdfEditor use in example,  PyBullet.setPhysicsEngineParameter: only update solverResidualThreshold if needed
2018-06-22 11:06:37 -07:00
erwincoumans 784f0fdc04 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-06-22 09:28:14 -07:00
erwincoumans 55e185fe39 PyBullet loadURDF in useMaximalCoordinated=True (btRigidBody), support lower/upper limits for revolute joints. 2018-06-22 09:28:07 -07:00
erwincoumans 8c851a70c7 Merge pull request #1766 from erwincoumans/master
lazy creation of batch scheduler, it causes issues with the physics.
2018-06-16 14:02:11 -07:00
erwincoumans 42c9d9aa3c lazy creation of batch scheduler, it causes issues with the physics. 2018-06-16 13:59:03 -07:00
erwincoumans 046d95b7e6 Merge pull request #1765 from erwincoumans/master
PyBullet: deal with backward compatibility of b3RaycastBatchAddRay
2018-06-16 13:09:17 -07:00
erwincoumans c55720fb41 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-06-16 12:28:38 -07:00
erwincoumans 7924d51665 PyBullet: deal with backward compatibility of b3RaycastBatchAddRay:
use b3RaycastBatchAddRays API to enable MAX_RAY_INTERSECTION_BATCH_SIZE_STREAMING num rays.
Old API (b3RaycastBatchAddRay) sticks to 256 rays, MAX_RAY_INTERSECTION_BATCH_SIZE.
2018-06-16 12:28:21 -07:00
erwincoumans ec37495142 Merge pull request #1761 from erwincoumans/master
bump up pybullet version
2018-06-16 10:47:28 -07:00
Erwin Coumans b94df12081 add missing pthread link in App_HelloBulletRobotics 2018-06-16 10:20:43 -07:00
erwincoumans 04d03d10be Fix memory leak due to batchRayCast never deleting the btTaskScheduler.
(and issue with TaskScheduler/btTaskScheduler.cpp, add JobQueue::exit, call it first, since it uses the m_threadSupport which was deleted before the destrucor was called.
Use a hashmap to store user timers, to avoid allocating many identical strings.
2018-06-16 09:37:53 -07:00
erwincoumans cb1fce7899 revert exposing getSharedMemoryStreamBuffer / adding to command structure
use 16k rays by default
add uploadRaysToSharedMemory method
2018-06-16 08:14:00 -07:00
erwincoumans 23f9250e04 Merge remote-tracking branch 'bp/master' 2018-06-16 06:58:10 -07:00
erwincoumans d660042d76 Merge pull request #1763 from YunfeiBai/master
Add the pdControlPlugin to the joint control C API, and add the PD co…
2018-06-16 06:57:50 -07:00
erwincoumans 75ec8f3fd9 PyBullet: add batchRayCast.py example 2018-06-16 06:20:15 -07:00