[python]pybullet安装后测试代码
Posted FL1623863129
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[python]pybullet安装后测试代码相关的知识,希望对你有一定的参考价值。
import pybullet as p
from time import sleep
'''
urdf文件可以去https://github.com/bulletphysics/bullet3下载
'''
physicsClient = p.connect(p.GUI)
p.setGravity(0, 0, -10)
# planeId = p.loadURDF("plane.urdf")
cubeStartPos = [0, 0, 1]
cubeStartOrientation = p.getQuaternionFromEuler([0, 0, 0])
boxId = p.loadURDF("plane.urdf", cubeStartPos, cubeStartOrientation)
cubePos, cubeOrn = p.getBasePositionAndOrientation(boxId)
useRealTimeSimulation = 0
if (useRealTimeSimulation):
p.setRealTimeSimulation(1)
while True:
if (useRealTimeSimulation):
p.setGravity(0, 0, -10)
sleep(0.01) # Time in seconds.
else:
p.stepSimulation()
源码下载地址:
以上是关于[python]pybullet安装后测试代码的主要内容,如果未能解决你的问题,请参考以下文章
ERROR: Failed building wheel for pybullet 解决方案