Commit Graph

244 Commits

Author SHA1 Message Date
Erwin Coumans
99c7c32b10 tcp fixes and allow to run graphics server on mainloop (for Mac) 2020-03-20 16:50:44 -07:00
Erwin Coumans
344bd629ee embed TCP graphics server in PyBullet for easier working-from-home
This allows to render at a different machine, sending all assets across the TCP network, using port 6667 by default.
You can use ssh port forwarding to get this working:
ssh -R 6667:localhost:6667 username@remotehost.com -v

python3 -m pybullet_utils.graphicsServer
python3 -m pybullet_utils.graphicsClient

Note that there are still some tcp networking issues that can cause a hang, just restart graphics server and graphics client if it hangs.
2020-03-20 15:43:52 -07:00
Erwin Coumans
c06859723b Embed graphics server (shared memory) in PyBullet. Use pybullet.connect(pybullet.GRAPHICS_SERVER) to enable it.
TODO: enable for Mac OSX on mainloop, add tcp bridges from and to shared memory.
2020-03-19 14:18:35 -07:00
Erwin Coumans
1640eef937 pybullet: enable getMeshData for multibody/rigid body (and filter on collisionShapeIndex for compound shapes) 2020-03-17 00:38:12 -07:00
Erwin Coumans
7991012f9d pybullet: fixes in polyhedral feature generation 2020-03-16 23:32:26 -07:00
Xuchen Han
4f36e09747 Motor->NonContactInner 2020-03-02 16:00:40 -08:00
Xuchen Han
7ad19fde6f formatting 2020-02-26 14:16:51 -08:00
Xuchen Han
84117b8440 separate motor constraint iterations and expose API 2020-02-26 14:11:41 -08:00
Erwin Coumans
e29ba9fe5c add option to merge fixed links in URDF file (improves performance, can handle URDF files with many fixed links)
add option to ignore visual and collision shapes in URDF file
2020-02-21 15:04:26 -08:00
Erwin Coumans
6afa0a463d unsupported: expose collisionMargin to changeDynamics/getDynamicsInfo.
add cube_convex.urdf for testing this collisionMargin. Test script:
import pybullet as p
import time
p.connect(p.GUI)
plane = p.loadURDF("plane_implicit.urdf")
cube = p.loadURDF("cube_convex.urdf",[0,0,1])
p.setGravity(0,0,-10)
while (1):
	p.stepSimulation()
	pts = p.getContactPoints()
	p.changeDynamics(plane,-1,collisionMargin=0.3)
	p.changeDynamics(cube,-1,collisionMargin=0.3)
	print("===================")
	print("cube pos=", p.getBasePositionAndOrientation(cube)[0])
	print("margin=", p.getDynamicsInfo(plane,-1)[11])
	#time.sleep(1./10.)
2020-02-14 17:36:40 -08:00
Tigran Gasparian
19075f75b2 Only clear the user data cache when a full user data sync is requested. 2020-02-03 15:24:12 +01:00
Tigran Gasparian
2403a22ebf Bump up shared memory magic number. 2020-01-23 16:58:32 +01:00
Tigran Gasparian
34db76d263 Adds an option to syncUserData to specify the bodies for which to sync. 2020-01-23 14:46:33 +01:00
Erwin Coumans
8ebdf7862c fix b3RobotSimulatorClientAPI_NoDirect::changeConstraint API 2020-01-09 17:56:21 -08:00
Xuchen Han
8fde74ecea update SHARED_MEMORY_MAGIC_NUMBER 2019-11-28 12:14:40 -08:00
Erwin Coumans
1f6d504e44 fix memory issues in btSparseSDF.h
(hash function on structure with uninitialized padding, and  Reset not called in destructor)
expose sparseSdfVoxelSize in PyBullet.setPhysicsEngineParameter
don't call deformable wireframe drawing in the wrong thread/place (it can cause crashes)
2019-11-18 10:22:56 -08:00
Erwin Coumans
72e0e7c223 fix load_soft_body.py example.
add optional flags in pybullet.resetSimulation.
fix compile issue due to SKIP_DEFORMABLE_WORLD
fix issue in .obj importer (todo: replace with tiny_obj_loader)
todo: replace std::ifstream fs; by fileIO usage.
2019-11-14 21:20:42 -08:00
Chuyuan Fu
913400eba1 add SOLVER_USE_ARTICULATED_WARMSTARTING option and APIs
fix compile
2019-10-23 21:36:26 -07:00
Chuyuan Fu
e4a5f9e06e add body type info to dynamics info 2019-09-03 14:27:19 -07:00
Erwin Coumans
f9b232b153 pybullet: allow programmatic creation of heightfield. See https://github.com/erwincoumans/bullet3/tree/master/examples/pybullet/examples/heightfield.py
premake4: allow to build example browser without C++11, re-enable stable PD control plugin using --enable_stable_pd=True
2019-08-11 13:59:24 -07:00
Chuyuan Fu
2e64b27a31 bindings for setting warmstarting factor
fix space
2019-08-06 15:53:31 -07:00
Erwin Coumans
36f3adc03f copy/move heightfield files around (part of pybullet_data)
prepare for heightfield support in pybullet (first step, needs a bit more)
2019-07-25 13:01:26 -07:00
Erwin Coumans
39a4e8dcd9 Implement faster array versions of PyBullet: getJointStatesMultiDof, getLinkStates, setJointMotorControlMultiDofArray, resetJointStatesMultiDof,
Implement StablePD in C++ through setJointMotorControlMultiDofArray method for pybullet_envs.deep_mimic, see testHumanoid.py and examples/pybullet/examples/humanoidMotionCapture.py
Minor fix in ChromeTraceUtil in case startTime>endTime (why would it happen?)
2019-07-21 13:08:22 -07:00
Chuyuan Fu
4da456054c Update PhysicsServerCommandProcessor and plugins to support render 2019-06-25 17:59:15 -07:00
Erwin Coumans
7e76ee0ad7 make pybullet.getMeshData work for softbody 2019-06-17 21:43:38 -07:00
Chuyuan Fu
229e87c3c9 get mesh data api
fix compile

fix typo
2019-06-17 19:00:53 -07:00
Erwin Coumans
6160b52fd7 graphicsServer to workaround OpenGL issues on some servers. 2019-06-13 23:24:22 -07:00
Erwin Coumans
688df2c60b fix exceeding shared memory usage, return of member of deleted class. 2019-05-06 17:13:42 -07:00
erwincoumans
e97a7d77af only report solver analytics if enabled using setPhysicsEngineParameter(reportSolverAnalytics=1) 2019-04-14 18:20:20 -07:00
erwincoumans
5ff52e47d9 report constraint solver analytics data, currently for each island the number of solver iterations used and remaining residual error. 2019-04-11 22:19:02 -07:00
erwincoumans
6951aaf26a implement PyBullet removeState command. Fixes Issue #2163
https://github.com/bulletphysics/bullet3/issues/2163
2019-04-03 20:06:40 -07:00
mbennice
8fcb8d0694 Update to bullet formatting 2019-03-17 11:52:56 -07:00
mbennice
d41e449d6f Adds a timestamp as a physics parameter. 2019-03-14 15:32:45 -07:00
erwincoumans
8e1c1448ab Expose motor drive torque reporting for motors in spherical joints in getJointStateMultiDof. 2019-02-27 09:54:12 -08:00
erwincoumans
bdf9b10246 more work on pybullet_envs.deep_mimic.
allow btMultiBody to not wakeup (for some RL experiments)
move deep_mimic motion files to data/motions folder, so we can use the args files unmodified.
2019-02-18 17:57:02 -08:00
Tigran Gasparian
d9e36935e6 Adds extra information about the UserData in the notifications.
When using the USER_DATA_ADDED and USER_DATA_REMOVED notifications, some
more information is necessary than just the user data id, especially
when a user data entry has been removed.
2019-02-12 12:02:20 +01:00
erwincoumans
ae8e83988b Add preliminary PhysX 4.0 backend for PyBullet
Add inverse dynamics / mass matrix code from DeepMimic, thanks to Xue Bin (Jason) Peng
Add example how to use stable PD control for humanoid with spherical joints (see humanoidMotionCapture.py)
Fix related to TinyRenderer object transforms not updating when using collision filtering
2019-01-22 21:08:37 -08:00
Erwin Coumans
bf9efffa4b Increase mesh allocation for vertices/indices in PyBullet.createCollisionShape
See createMesh.py for an example.

The data has to fit in shared memory, hence the limit on Mac is lower than Windows and Linux:

#ifdef __APPLE__
#define B3_MAX_NUM_VERTICES 8192
#define B3_MAX_NUM_INDICES 32768
#else
#define B3_MAX_NUM_VERTICES 131072
#define B3_MAX_NUM_INDICES 524288
#endif
2019-01-03 16:19:28 -08:00
erwincoumans
192d27743a enable pybullet.calculateInverseDynamics for floating bodies
Using calculateInverseDynamics with zero target acceleration allows to compute the non-linear dynamics forces (coriolis/gyroscopic) and/or gravity force.
2018-11-27 08:49:56 -08:00
erwincoumans
17219f84c6 make setJointPosMultiDof and setJointVelMultiDof argument const.
add PyBullet.resetJointStateMultiDof / getJointStateMultiDof, for preliminary support for spherical and planar joints
2018-11-10 14:26:31 -08:00
erwincoumans
750133694c Disable btQuickprof.h profiling by default. We use custom profiling functions, see b3ChromeUtilsStartTimings. 2018-11-01 08:19:50 -07:00
erwincoumans
078887c4d7 PyBullet fileIOPlugin: don't add equal fileIO interface twice (based on identical fileIOType and pathPrefix)
loadBullet goes through fileIOPlugin
2018-10-29 10:25:40 -07:00
erwincoumans
a44df2b0a6 PyBullet: allow to pass vertices (for convex) and vertices+indices (for concave) to createCollisionShape
See createObstacleCourse.py for an example use. At the moment a limit of 1024 vertices and 1024 indices.
Will be lifted once we implement the streaming version (soon).
2018-10-26 10:18:51 -07:00
erwincoumans
b5e475aec3 enable planar reflection in MinitaurGymEnv
enable follow cam in other Gym locomotion environments
add testing assets for multi-material obj files -> sdf conversion.
Also use ER_NO_SEGMENTATION_MASK flag for TinyRenderer/EGL plugin renderer
2018-10-14 15:10:19 -07:00
erwincoumans
c1e20c448f Implement InMemoryFile for memory caching for fileIO plugin.
Support SDF loading through fileIO plugin.
Replace strcspn by C code (not crossplatform)
Add flag for loadURDF to use color from MTL file (instead from URDF link material)
pybullet.URDF_USE_MATERIAL_COLORS_FROM_MTL and pybullet.URDF_USE_MATERIAL_TRANSPARANCY_FROM_MTL
2018-10-14 12:54:34 -07:00
erwincoumans
a24c1436af state 2 of FileIO plugin: adding/removing FileIO types, search through all registered FileIO types.
(not enabled by default yet)
Example:
fileIO = p.loadPlugin("fileIOPlugin")
print("fileIO=",fileIO)
p.executePluginCommand(fileIO,"e:/develop/bullet3/data/plane.zip", [p.AddFileIOAction,p.ZipFileIO])
p.executePluginCommand(fileIO,"e:/develop/bullet3/data/test2.zip", [p.AddFileIOAction,p.ZipFileIO])
planeId = p.loadURDF("plane.urdf")
duckId = p.loadURDF("duck_vhacd.urdf",[0,0,1])
2018-10-11 14:39:31 -07:00
erwincoumans
c0e38cd921
Merge pull request #1896 from jviereck/jviereck_add_lateral_contact_info
Adding support for lateral friction to getContactPoints()
2018-10-06 15:27:14 -07:00
Erwin Coumans
24ca5afe95 reverse ER_SEGMENTATION_MASK to ER_NO_SEGMENTATION_MASK so segmentation
mask is rendered by default
2018-10-04 14:14:24 -07:00
Erwin Coumans
42ae4e81a8 apply clang-format (on Mac, slightly different than running it on Windows) 2018-09-30 11:43:57 -07:00
erwincoumans
5bcd43711a PyBullet OpenGL/EGL hardware getCameraImage: use glViewport to reduce the glReadPixels calling cost dramatically for small images
PyBullet Allow OpenGL/EGL hardware to render segmentation mask. Use pybullet.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX or pybullet.ER_SEGMENTATION_MASK
PyBullet.removeBody fix indexing bug (use foundIndex, not i)
PyBullet bump up version to 2.2.3
2018-09-30 07:10:40 -07:00