How to fix the position of dynamic cylinders

As shown in the image, how to fix the position of all dynamic cylinders so that they can stay as a grid?

For example, if I use a cube to hit them, they will spread out.

Hi @TUM_ICS_YI - If you want cylinders to be fixed then why making them dynamic?

You can add a fixed joint to all of them. Ideally if you want it to be fixed then it’s better to remove the rigid body attribute.

Thanks. I make it dynamics since the contact sensor has to be attached with solid object.
Is there a way to add a series of joint using python API?

Yes, you can use this: UsdPhysicsJoint Class Reference