如何使用 pybullet createConstraint 来约束对象的世界坐标系位置

How to use pybullet createConstraint for constraining world frame position of an object

createConstraint pybullet 中的方法允许约束一个关节位置 w.r.t。其他。有没有办法使用此功能来防止物体移动,例如在球体之外?

到目前为止,我在每个时间步检查对象位置,并在违反约束的情况下手动更改位置。

实际上在pybullet的文件examples/pybullet/constraint.py中有一个工作示例。