move pybullet examples to Bullet/examples/pybullet/examples

This commit is contained in:
Erwin Coumans
2017-03-29 09:40:56 -07:00
parent 0750d502a8
commit eb8c31ae82
29 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import pybullet as p
p.connect(p.DIRECT)
hinge = p.loadURDF("hinge.urdf")
print("mass of linkA = 1kg, linkB = 1kg, total mass = 2kg")
hingeJointIndex = 0
#by default, joint motors are enabled, maintaining zero velocity
p.setJointMotorControl2(hinge,hingeJointIndex,p.VELOCITY_CONTROL,0,0,0)
p.setGravity(0,0,-10)
p.stepSimulation()
print("joint state without sensor")
print(p.getJointState(0,0))
p.enableJointForceTorqueSensor(hinge,hingeJointIndex)
p.stepSimulation()
print("joint state with force/torque sensor, gravity [0,0,-10]")
print(p.getJointState(0,0))
p.setGravity(0,0,0)
p.stepSimulation()
print("joint state with force/torque sensor, no gravity")
print(p.getJointState(0,0))
p.disconnect()