mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-09-23 10:44:37 +00:00
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:
17
examples/pybullet/examples/soccerball.py
Normal file
17
examples/pybullet/examples/soccerball.py
Normal 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)
|
||||
BIN
examples/pybullet/gym/pybullet_data/colors16.png
Normal file
BIN
examples/pybullet/gym/pybullet_data/colors16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 953 B |
13
examples/pybullet/gym/pybullet_data/soccerball.mtl
Normal file
13
examples/pybullet/gym/pybullet_data/soccerball.mtl
Normal 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
|
||||
20686
examples/pybullet/gym/pybullet_data/soccerball.obj
Normal file
20686
examples/pybullet/gym/pybullet_data/soccerball.obj
Normal file
File diff suppressed because it is too large
Load Diff
32
examples/pybullet/gym/pybullet_data/soccerball.urdf
Normal file
32
examples/pybullet/gym/pybullet_data/soccerball.urdf
Normal 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>
|
||||
|
||||
Reference in New Issue
Block a user