Commit Graph

497 Commits

Author SHA1 Message Date
Erwin Coumans
1452cae641 * add textured models of ball.vtk (obj/mtl) and torus (obj/mtl) and cloth.
1) allow to render deformables in 'getCameraImage', for TinyRenderer (tested OK) and EGL (untested)
2) allow to have textures for deformables. See deformable_ball.py, deformable_anchor.py and deformable_torus.py for examples
3) deformables: allow to request simulation mesh data (even if there is a render mesh) See deformable_anchor.py for an example usage
   data = p.getMeshData(clothId, -1, flags=p.MESH_DATA_SIMULATION_MESH)
4) fix deletion of deformables, thanks to Fychuyan, https://github.com/bulletphysics/bullet3/pull/3048
5) allow to enable and disable double-sided rendering, p.changeVisualShape(objectUid, linkIndex, flags=p.VISUAL_SHAPE_DOUBLE_SIDED)
6) fix GripperGraspExample, model not found
7) Fix deformable anchor not attaching to multibody with object unique id of 0
8) Fix issue with assignment of unique ids in TinyRenderer/EGL renderer (always use broadphase uid)
9) Avoid crash/issue of simulation with pinned vertices (mass 0) in btDeformableBackwardEulerObjective::applyExplicitForce
10) Store uv/normal in btSoftBody::RenderNode to allow textured meshes
11) (uncomment in btSoftBodyHelpers.cpp): dump vertices and indices in obj wavefront format, when loading a VTK file, for quicker creation of a (textured) surface mesh
12) allow interpolateRenderMesh also for old position-based soft bodies (not only the shiny new FEM deformables)
13) fix a few premake targets
14) update build_visual_studio_vr_pybullet_double_cmake.bat so it suits c:\python37 and installs locally
    for local install of Bullet, see also this example https://github.com/erwincoumans/hello_bullet_cmake
2020-09-12 01:03:04 -07:00
Erwin Coumans
ccdec68b1d expose shadowmap intensity to PyBullet API 2020-09-07 16:52:14 -07:00
Erwin Coumans
16efd7b288 fix memory leak in pybullet.calculateJacobian 2020-08-13 17:02:54 -07:00
Erwin Coumans
82493e9fbb fix copy/paste bug in pybullet.c related to collisionShapeOrientationAObj (missing Obj)
this would lead to the collisionShapeOrientationA not being considered.
2020-08-12 21:26:43 -07:00
Peng Xu
20667bd7d0 Pybullet fast numpy input support for rayTestBatch. 2020-08-11 02:19:23 -07:00
Erwin Coumans
d12d886e13 raycast filter masks can be negative, always apply the mask (-1 default). Thanks to Tingnan for reporting/reproduction case. 2020-08-03 11:00:14 -07:00
Erwin Coumans
c517c434e6 pybullet allow to enable/change joint limits:
pybullet.changeDynamicsInfo(objectUniqueId, linkIndex, jointLowerLimit=..., jointUpperLimit=...) # jointLowerLimit <= jointUpperLimit

and joint limit max force:
pybullet.changeDynamicsInfo(objectUniqueId, linkIndex, jointLimitForce=...)

For example:
p.changeDynamics(sphereUid,linkIndex, jointLowerLimit=1, jointUpperLimit=3, jointLimitForce=10.5)

add b3ChangeDynamicsInfoSetJointLimit/b3ChangeDynamicsInfoSetJointLimitForce
add getConstraintType for btMultiBodyConstraint
2020-07-07 19:42:23 -07:00
erwincoumans
50af23e487
Merge pull request #2832 from xhan0619/pybullet-api
Set numNonContactInnerIterations from Pybullet
2020-06-01 17:19:45 -07:00
erwincoumans
eea724bc02
Merge pull request #2837 from erwincoumans/master
also allow reportHitNumber for single pybullet.rayTest, better mtl/urdf color selection
2020-06-01 17:18:24 -07:00
Xuchen Han
a33a9412fa add numNonContactInnerIterations to getPhysicsParameters 2020-05-29 08:28:52 -07:00
Xuchen Han
e6fdaebea9 add api for setting non contact iteration for pybullet 2020-05-28 17:58:21 -07:00
Erwin Coumans
a3c4b2995e also allow reportHitNumber for single pybullet.rayTest (not just rayTestBatch) 2020-05-22 15:13:56 -07:00
erwincoumans
5233b72160
Merge pull request #2800 from xhan0619/splitImpulseMulti
Stability improvements for deformable.
2020-05-21 09:47:33 -07:00
Erwin Coumans
754dbd5fda add pybullet.unsupportedChangeScaling feature for some small experiments, this is not general and has many limitations that are not likely are going to be resolved,
so unless it does what you want, ignore this api, it is unsupported!
2020-05-17 13:46:11 -07:00
Xuchen Han
adf9e74dcb match API in pybullet.c 2020-05-11 18:51:26 -07:00
Xuchen Han
644fd5f311 add API for two different damping modes for mass spring 2020-05-11 16:42:17 -07:00
Erwin Coumans
53b65b795f add fractionEpsilon to filter rays with similar hit fraction
remove debug printf
2020-05-09 02:42:47 -07:00
Erwin Coumans
f0cccf0faa add collisionFilterMask to rayTestBatch and rayTest
This will allow to exclude (filter) certain bodies.
By default, static bodies have collision group 2, and dynamic (mass=1) bodies have collision group 1.
As long as mask & group != 0, a raytest will be performed.
2020-05-08 11:57:25 -07:00
Erwin Coumans
8f380b3fd2 use white as default undefined color instead of the googley colors.
use loadURDF(..., flags = pybullet.URDF_GOOGLEY_UNDEFINED_COLORS) to get Googley colors when colors are undefined.
2020-05-08 10:44:39 -07:00
Erwin Coumans
daa0a27403 add reportHitNumber to allow reporting a specific ray intersection hit
(by default, pybullet.rayTestBatch reports the closest hit, so you can report 2nd closest or 3rd closest hit etc)
Fix pybullet.createCollisionShape, in some cases (concave trimesh, convex mesh) two instances were created.
2020-05-07 23:23:24 -07:00
Erwin Coumans
d479ca712c allow to call getDebugVisualizerCamera in DIRECT mode (returns all 0) 2020-05-05 03:15:26 +00:00
Xuchen Han
84f028a5e6 move the position of physicsclientid in the list of argument to be the last 2020-04-29 16:40:06 -07:00
Xuchen Han
5f1260199a set appropriate repulsion stiffness for pybullet torus demo 2020-04-27 20:05:16 -07:00
Erwin Coumans
b45d697d28 always use python release version (not debug) on Windows, similar hack as pybind11 2020-04-10 09:19:51 -07:00
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
911355fe62 fixes for Mac OSX 2020-03-20 15:57:19 -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
27fbbfee7f pybullet removeAllParameters (sliders, buttons)
pybullet addUserDebugParameter adds button instead of slider, if min > max.
2020-03-16 21:29:30 -07:00
Erwin Coumans
f0528db5e9 embed V-HACD directly into Pybullet to make it easier to use:
pip3 install pybulle
import pybullet as p
p.connect(p.DIRECT)
p.vhacd("teddy.obj", "teddy_large_newout.obj", "newlog.txt", depth=2,resolution=1000000)
2020-03-16 00:38:52 -07:00
Erwin Coumans
0fd8598ca3 fix pybullet constants in previous commit 2020-02-21 16:16:13 -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
0617f4f3cd expose computeDofCount to pybullet
expose computeDofCount and calculateMassMatrix to BulletRobotics C++ API
(all untested)
2020-02-14 19:58:32 -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
Erwin Coumans
6195f40c02 fix compile issue in pybullet.c 2020-02-06 09:11:18 -08: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
jackson-waschura
0b33d940e4 Actually use self collisions when specified 2019-12-08 13:54:38 +01:00
Xuchen Han
7bce5d61f4 separate in-plane and bending stiffness for mass spring model for easier parameter tuning 2019-11-27 11:40:10 -08:00
Erwin Coumans
96deb42aa5 pybullet.createSoftBodyAnchor 2019-11-19 19:20:08 -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
Xuchen Han
a86710c5b6 add python binding to allow loading deformable objects 2019-11-15 21:25:11 -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
Erwin Coumans
24a76614f8 PyBullet: fix memory leak in changeTexture command
Fixes #2481
2019-11-14 17:07:08 -08:00
Erwin Coumans
64ea8e9f27 PyBullet createMultiBody(Batch), return all body unique ids
PyBullet: fix crash: always check for existance m_multibodyWorld in ::render method
2019-09-09 16:41:25 -07:00
Chuyuan Fu
e4a5f9e06e add body type info to dynamics info 2019-09-03 14:27:19 -07:00
Erwin Coumans
648844e898 minor fixes, bump up pybullet to 2.5.5 2019-08-14 21:30:10 -07:00
Erwin Coumans
88d1788ee5 PyBullet: allow to update an existing heightfield shape
Also, use flags = p.GEOM_CONCAVE_INTERNAL_EDGE to enable internal edge filtering for heightfield (disabled by default)
See https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/examples/heightfield.py
2019-08-14 21:06:10 -07:00
Erwin Coumans
e0b642d730 pybullet: fix calculateInverseKinematics2 2019-08-11 17:02:16 -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