Last active
October 11, 2019 09:34
-
-
Save PierreExeter/e92a2fce094928529b75964b781c0b14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pybullet as p | |
import time | |
import pybullet_data | |
# Start pybullet simulation | |
p.connect(p.GUI) | |
# p.connect(p.DIRECT) # don't render | |
# load urdf file path | |
p.setAdditionalSearchPath(pybullet_data.getDataPath()) | |
# load urdf and set gravity | |
p.setGravity(0,0,-10) | |
planeId = p.loadURDF("plane.urdf") | |
cubeStartPos = [0,0,1] | |
cubeStartOrientation = p.getQuaternionFromEuler([0,0,0]) | |
boxId = p.loadURDF("r2d2.urdf", cubeStartPos, cubeStartOrientation) | |
# step through the simluation | |
for i in range (10000): | |
p.stepSimulation() | |
time.sleep(1./240.) | |
p.disconnect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment