mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
* Adjustment: Initial CMake reworking.
This commit is contained in:
parent
516163fd5d
commit
d7cdf54661
5394 changed files with 2615532 additions and 8711 deletions
30
Engine/lib/bullet/examples/pybullet/robotcontrol.py
Normal file
30
Engine/lib/bullet/examples/pybullet/robotcontrol.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import pybullet as p
|
||||
p.connect(p.GUI) #or p.SHARED_MEMORY or p.DIRECT
|
||||
|
||||
p.loadURDF("plane.urdf")
|
||||
p.setGravity(0,0,-10)
|
||||
huskypos = [0,0,0.1]
|
||||
|
||||
husky = p.loadURDF("husky/husky.urdf",huskypos[0],huskypos[1],huskypos[2])
|
||||
numJoints = p.getNumJoints(husky)
|
||||
for joint in range (numJoints) :
|
||||
print (p.getJointInfo(husky,joint))
|
||||
targetVel = 10 #rad/s
|
||||
maxForce = 100 #Newton
|
||||
|
||||
for joint in range (2,6) :
|
||||
p.setJointMotorControl(husky,joint,p.VELOCITY_CONTROL,targetVel,maxForce)
|
||||
for step in range (300):
|
||||
p.stepSimulation()
|
||||
|
||||
targetVel=-10
|
||||
for joint in range (2,6) :
|
||||
p.setJointMotorControl(husky,joint,p.VELOCITY_CONTROL,targetVel,maxForce)
|
||||
for step in range (400):
|
||||
p.stepSimulation()
|
||||
|
||||
p.getContactPointData(husky)
|
||||
|
||||
p.disconnect()
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue