Add a soccerball obj/urdf, hand-modeled in Blender, using guidance from https://www.youtube.com/watch?v=N93n6hPsqkI (but using texture mapping so the export to OBJ works in PyBullet)

This commit is contained in:
Erwin Coumans
2020-09-21 16:11:52 -07:00
parent 1bd82e7d81
commit 2e1b84487b
5 changed files with 20748 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import pybullet as p
import pybullet_data as pd
import time
p.connect(p.GUI)
p.setAdditionalSearchPath(pd.getDataPath())
offset = 0
for scale in range (1,10,1):
ball = p.loadURDF("soccerball.urdf",[offset,0,1], globalScaling=scale*0.1)
p.changeDynamics(ball,-1,linearDamping=0, angularDamping=0, rollingFriction=0.001, spinningFriction=0.001)
p.changeVisualShape(ball,-1,rgbaColor=[0.8,0.8,0.8,1])
offset += 2*scale*0.1
p.loadURDF("plane.urdf")
p.setGravity(0,0,-10)
p.setRealTimeSimulation(1)
while p.isConnected():
#p.getCameraImage(320,200, renderer=p.ER_BULLET_HARDWARE_OPENGL)
time.sleep(0.5)

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

View File

@@ -0,0 +1,13 @@
# Blender MTL File: 'soccerball9.blend'
# Material Count: 1
newmtl black.001
Ns 94.117647
Ka 1.000000 1.000000 1.000000
Kd 1.000000 1.000000 1.000000
Ks 1.000000 1.000000 1.000000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd colors16.png

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<robot name="urdf_robot">
<link name="baseLink">
<contact>
<rolling_friction value="0.03"/>
<spinning_friction value="0.03"/>
</contact>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="10.0"/>
<inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="soccerball.obj" scale="1 1 1"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
<specular rgb="11 1 1"/>
</material>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<sphere radius="0.5"/>
</geometry>
</collision>
</link>
</robot>