Code: Select all
p.vhacd(self.part_obj_path, obj_acd_path, "log.txt", pca=True, mode=1)
Below is the rough structure of my code; please let me know if there's anything in my code that might be contributing to this; thanks very much!
Code: Select all
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
# disable rendering
p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 0)
p.configureDebugVisualizer(p.COV_ENABLE_GUI, 0)
p.configureDebugVisualizer(p.COV_ENABLE_TINY_RENDERER, 0)
p.setGravity(0,0,-9.8)
for id, part in list_of_parts():
part_mesh = get_part_mesh()
mesh_color = part_mesh.get_color()
rgba = list(mesh_color) + [1]
quarternion = p.getQuaternionFromEuler(part.frame.radians_rot())
visualShapeId = p.createVisualShape(shapeType=p.GEOM_MESH,
fileName=part.collision_obj_path,
rgbaColor=rgba,
visualFramePosition=part.frame.pos,
visualFrameOrientation=quarternion)
collisionShapeId = p.createCollisionShape(shapeType=p.GEOM_MESH,
fileName=part.collision_obj_path,
collisionFramePosition=part.frame.pos,
collisionFrameOrientation=quarternion)
bodyId = p.createMultiBody(baseMass=part.mass,
baseCollisionShapeIndex=collisionShapeId,
baseVisualShapeIndex=visualShapeId,
useMaximalCoordinates=True)
p.changeDynamics(bodyId,-1,activationState=p.ACTIVATION_STATE_ENABLE_SLEEPING,linearDamping=0.5, angularDamping=0.5)
startPos = [0,0,0]
p.resetDebugVisualizerCamera(cameraDistance=800, cameraYaw=60, cameraPitch=-60, cameraTargetPosition=startPos)
p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 1)
p.setRealTimeSimulation(1)
while True:
p.stepSimulation()