There are several vague descriptions of ways to do this, like "use the createMultiBody
method" or "use maximal coordinates", but there is no other information.
To be more specific, I am loading objects I created with SolidWorks using the loadURDF
method, but I want them to only rotate about their z axis, and only move about their x and y axes. How can I achieve this? Is there a way to enable this for the entire environment?
Edit: Here's what I basically want to do:
import pybullet as p
p.connect(p.DIRECT)
OBJECT_1 = p.loadURDF("/location/of/object1.urdf")
OBJECT_2 = p.loadURDF("/location/of/object2.urdf")
OBJECT_3 = p.loadURDF("/location/of/object3.urdf")
OBJECT_4 = p.loadURDF("/location/of/object4.urdf")
# code to prevent the motion of OBJECT_1, OBJECT_2, OBJECT_3, and OBJECT_4
# (or the entire simulation) along the z axis.
# code to prevent the rotation of OBJECT_1, OBJECT_2, OBJECT_3, and OBJECT_4
# (or the entire simulation) along the x and y axes.
while True:
p.stepSimulation()
p.disconnect()