pybullet.error: GetBasePositionAndOrientation failed.报错

pybullet.error: GetBasePositionAndOrientation failed.报错

问题描述

使用Pybullet时,发现这个问题:

pybullet.error: GetBasePositionAndOrientation failed.

定位到报错的位置:

pos, _ = p.getBasePositionAndOrientation(index, physicsClientId=self.PYB_CLIENT)

# 其中
self.PYB_CLIENT = p.connect(p.DIRECT)

解决方案

在代码运行过程中 self.PYB_CLIENT 发生了改变,导致 connect 不上客户端
self.PYB_CLIENT的变化
删除 self.PYB_CLIENT 即可

pos, _ = p.getBasePositionAndOrientation(index)

(P.S.:虽然并没有相关代码使 self.PYB_CLIENT 发生改变,但它确实是变了,比较离谱,也求大佬能够解答)

猜你喜欢

转载自blog.csdn.net/weixin_43789096/article/details/130562904