diff --git a/examples/pybullet/gym/pybullet_data/domino/domino.jpg b/examples/pybullet/gym/pybullet_data/domino/domino.jpg new file mode 100644 index 000000000..11d0d0750 Binary files /dev/null and b/examples/pybullet/gym/pybullet_data/domino/domino.jpg differ diff --git a/examples/pybullet/gym/pybullet_data/domino/domino.mtl b/examples/pybullet/gym/pybullet_data/domino/domino.mtl new file mode 100644 index 000000000..a602fae98 --- /dev/null +++ b/examples/pybullet/gym/pybullet_data/domino/domino.mtl @@ -0,0 +1,11 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 0 +Ka 0.000000 0.000000 0.000000 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 +map_Kd domino.jpg diff --git a/examples/pybullet/gym/pybullet_data/domino/domino.obj b/examples/pybullet/gym/pybullet_data/domino/domino.obj new file mode 100644 index 000000000..6103b5ed5 --- /dev/null +++ b/examples/pybullet/gym/pybullet_data/domino/domino.obj @@ -0,0 +1,152 @@ +# Blender v2.79 (sub 0) OBJ File: '' +# www.blender.org +mtllib domino.mtl +o Cube_Cube.001 +v -0.012700 0.003175 -0.025400 +v -0.012700 0.003175 0.025400 +v 0.012700 0.003175 -0.025400 +v 0.012700 0.003175 0.025400 +v -0.012700 -0.003175 -0.025400 +v -0.012700 -0.003175 0.025400 +v 0.012700 -0.003175 -0.025400 +v 0.012700 -0.003175 0.025400 +v 0.000000 0.003175 -0.025400 +v -0.012700 0.003175 0.000000 +v 0.000000 0.003175 0.025400 +v 0.012700 0.003175 0.000000 +v 0.012700 0.000000 -0.025400 +v 0.012700 0.000000 0.025400 +v 0.012700 -0.003175 0.000000 +v 0.000000 -0.003175 -0.025400 +v 0.000000 -0.003175 0.025400 +v -0.012700 -0.003175 0.000000 +v -0.012700 0.000000 -0.025400 +v -0.012700 0.000000 0.025400 +v 0.000000 0.000000 0.025400 +v 0.000000 0.000000 -0.025400 +v -0.012700 0.000000 0.000000 +v 0.000000 -0.003175 0.000000 +v 0.012700 0.000000 0.000000 +v 0.000000 0.003175 0.000000 +vt 0.126001 0.870497 +vt 0.124465 0.872033 +vt 0.124465 0.870497 +vt 0.237060 0.851119 +vt 0.218639 0.869540 +vt 0.218639 0.851119 +vt 0.245670 0.816240 +vt 0.187635 0.874274 +vt 0.187635 0.816240 +vt 0.128048 0.875036 +vt 0.125628 0.877456 +vt 0.125628 0.875036 +vt 0.234999 0.850344 +vt 0.218252 0.867091 +vt 0.218252 0.850344 +vt 0.126159 0.872047 +vt 0.122877 0.875330 +vt 0.122877 0.872047 +vt 0.218639 0.852670 +vt 0.203807 0.867502 +vt 0.203807 0.852670 +vt 0.218639 0.837837 +vt 0.203807 0.837837 +vt 0.126159 0.868764 +vt 0.122877 0.868764 +vt 0.126351 0.873597 +vt 0.123659 0.876290 +vt 0.123659 0.873597 +vt 0.126351 0.870905 +vt 0.123659 0.870905 +vt 0.234999 0.833597 +vt 0.218252 0.833597 +vt 0.123208 0.877456 +vt 0.123208 0.875036 +vt 0.215927 0.837296 +vt 0.204429 0.848794 +vt 0.204429 0.837296 +vt 0.227424 0.837296 +vt 0.215927 0.848794 +vt 0.129601 0.874274 +vt 0.129601 0.816240 +vt 0.187635 0.758206 +vt 0.129601 0.758206 +vt 0.245670 0.758206 +vt 0.200219 0.869540 +vt 0.200219 0.851119 +vt 0.125240 0.873601 +vt 0.123516 0.875326 +vt 0.123516 0.873601 +vt 0.126964 0.873601 +vt 0.125240 0.875326 +vt 0.122929 0.872033 +vt 0.122929 0.870497 +vt 0.124465 0.868961 +vt 0.122929 0.868961 +vt 0.126001 0.868961 +vt 0.126001 0.872033 +vt 0.237060 0.869540 +vt 0.245670 0.874274 +vt 0.128048 0.877456 +vt 0.234999 0.867091 +vt 0.126159 0.875330 +vt 0.218639 0.867502 +vt 0.126351 0.876290 +vt 0.227424 0.848794 +vt 0.126964 0.875326 +vn 0.0000 1.0000 0.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 -1.0000 0.0000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 0.0000 1.0000 +usemtl None +s off +f 11/1/1 12/2/1 26/3/1 +f 14/4/2 15/5/2 25/6/2 +f 17/7/3 18/8/3 24/9/3 +f 20/10/4 10/11/4 23/12/4 +f 16/13/5 19/14/5 22/15/5 +f 11/16/6 20/17/6 21/18/6 +f 21/19/6 6/20/6 17/21/6 +f 14/22/6 17/21/6 8/23/6 +f 4/24/6 21/18/6 14/25/6 +f 22/26/5 1/27/5 9/28/5 +f 13/29/5 9/28/5 3/30/5 +f 7/31/5 22/15/5 13/32/5 +f 23/12/4 1/33/4 19/34/4 +f 18/35/4 19/36/4 5/37/4 +f 6/38/4 23/39/4 18/35/4 +f 24/9/3 5/40/3 16/41/3 +f 15/42/3 16/41/3 7/43/3 +f 8/44/3 24/9/3 15/42/3 +f 25/6/2 7/45/2 13/46/2 +f 12/47/2 13/48/2 3/49/2 +f 4/50/2 25/51/2 12/47/2 +f 26/3/1 3/52/1 9/53/1 +f 10/54/1 9/53/1 1/55/1 +f 2/56/1 26/3/1 10/54/1 +f 11/1/1 4/57/1 12/2/1 +f 14/4/2 8/58/2 15/5/2 +f 17/7/3 6/59/3 18/8/3 +f 20/10/4 2/60/4 10/11/4 +f 16/13/5 5/61/5 19/14/5 +f 11/16/6 2/62/6 20/17/6 +f 21/19/6 20/63/6 6/20/6 +f 14/22/6 21/19/6 17/21/6 +f 4/24/6 11/16/6 21/18/6 +f 22/26/5 19/64/5 1/27/5 +f 13/29/5 22/26/5 9/28/5 +f 7/31/5 16/13/5 22/15/5 +f 23/12/4 10/11/4 1/33/4 +f 18/35/4 23/39/4 19/36/4 +f 6/38/4 20/65/4 23/39/4 +f 24/9/3 18/8/3 5/40/3 +f 15/42/3 24/9/3 16/41/3 +f 8/44/3 17/7/3 24/9/3 +f 25/6/2 15/5/2 7/45/2 +f 12/47/2 25/51/2 13/48/2 +f 4/50/2 14/66/2 25/51/2 +f 26/3/1 12/2/1 3/52/1 +f 10/54/1 26/3/1 9/53/1 +f 2/56/1 11/1/1 26/3/1 diff --git a/examples/pybullet/gym/pybullet_data/domino/domino.urdf b/examples/pybullet/gym/pybullet_data/domino/domino.urdf new file mode 100644 index 000000000..8a91e09e2 --- /dev/null +++ b/examples/pybullet/gym/pybullet_data/domino/domino.urdf @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/pybullet/gym/pybullet_data/domino/license.txt b/examples/pybullet/gym/pybullet_data/domino/license.txt new file mode 100644 index 000000000..bd3b1943f --- /dev/null +++ b/examples/pybullet/gym/pybullet_data/domino/license.txt @@ -0,0 +1,10 @@ +URDF model created by Erwin Coumans. Mesh / texture created in Blender. + +If you use the model, add a citation to PyBullet: + +@MISC{coumans2018, +author = {Erwin Coumans and Yunfei Bai}, +title = {PyBullet, a Python module for physics simulation for games, robotics and machine learning}, +howpublished = {\url{http://pybullet.org}}, +year = {2016--2019} +} diff --git a/examples/pybullet/gym/pybullet_envs/examples/dominoes.py b/examples/pybullet/gym/pybullet_envs/examples/dominoes.py new file mode 100644 index 000000000..c96c07ebd --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/examples/dominoes.py @@ -0,0 +1,37 @@ +import pybullet_data as pd +import pybullet_utils as pu +import pybullet +import pybullet_utils.bullet_client as bc +import time + +p = bc.BulletClient(connection_mode=pybullet.GUI) +p.setAdditionalSearchPath(pd.getDataPath()) +p.loadURDF("plane_transparent.urdf", useMaximalCoordinates=True) +p#.setPhysicsEngineParameter(numSolverIterations=10, fixedTimeStep=0.01) + + +p.configureDebugVisualizer(p.COV_ENABLE_PLANAR_REFLECTION,1) +p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0) + +y2z = p.getQuaternionFromEuler([0,0,1.57]) +meshScale = [1,1,1] +visualShapeId = p.createVisualShape(shapeType=p.GEOM_MESH,fileName="domino/domino.obj", rgbaColor=[1,1,1,1], specularColor=[0.4,.4,0], visualFrameOrientation=y2z, meshScale=meshScale) + +boxDimensions = [0.5*0.00635, 0.5*0.0254, 0.5*0.0508] +collisionShapeId = p.createCollisionShape(p.GEOM_BOX,halfExtents=boxDimensions) + + +for j in range (12): + print("j=",j) + for i in range (35): + #p.loadURDF("domino/domino.urdf",[i*0.04,0, 0.06]) + p.createMultiBody(baseMass=0.025,baseCollisionShapeIndex = collisionShapeId,baseVisualShapeIndex = visualShapeId, basePosition = [i*0.04,j*0.05, 0.06], useMaximalCoordinates=True) + +p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1) + +p.setGravity(0,0,-9.8) +p.setRealTimeSimulation(1) +while (1): + p.setGravity(0,0,-9.8) + #p.stepSimulation(1./100.) + time.sleep(1./240.) \ No newline at end of file