PyBullet: All link arrays need to be same size

126 Views Asked by At

When trying to create a Multibody with a base and a link (or even more links) i get the error from the title.

I checked that all the length of arrays(lists) are the same and made a super simple version with only a base and one link.

p.createMultiBody(baseMass=1, 
baseCollisionShapeIndex=1, 
baseVisualShapeIndex=1, 
basePosition = [0,0,0], 
baseOrientation=[0,0,0,1], 
linkMasses=[1],  
linkCollisionShapeIndices=[2],
linkVisualShapeIndices=[2], 
linkPositions=[[0,0,1]], 
linkOrientations=[[0,0,0,0]], 
linkParentIndices=[1], 
linkJointTypes=[p.JOINT_FIXED], 
linkJointAxis=[[0,0,1]])

pybullet.error: All link arrays need to be same size.

If you have any hint what I'm doing wrong, help me out.

1

There are 1 best solutions below

0
David Klee On

You are missing the arguments linkInertialFramePositions and linkInertialFrameOrientations. These arguments are labelled as optional in the Quickstart Guide, but must be provided if the body has any joints.