I am doing simulation of my robot with PyBullet now, but I guess this question applies to other simulation software as well.

When I am using the functions createCollisionShape and createMultiBody, I am really confused about the definition of parameters like collisionFramePosition and linkInertialFramePositions. What is the definition of collision frame and inertial frame? The Quickstart Guide on the PyBullet website does not seem to have an explanation. Could someone tell me the definition or give me some resources to read?


1 Answer 1


My original answer on this confused linkInertialFramePositions with baseInertialFramePosition, so here is a (hopefully ;) ) more accurate description of the two:

The linkInertialFramePositions parameter is used to define the "local" inertial frame of reference of the given link with respect to the link frame position. Thus, if the link frame is located at [0.5, 0.5, 0.5] at a given point in time, then the value of linkInertialFramePositions will act as an offset to [0.5, 0.5, 0.5]. This is important when considering the functions applyExternalForce/Torque as specifying flags=p.LINK_FRAME will have this force/torque acting with respect to the local inertial frame. So, Although perhaps an overly broad generalization, the link inertial frames define the origin of forces and torques acting on a body relative to the link frame.

The collisionFramePosition and visualFramePosition variables act similarly, but deal with moving the actual shapes around, nothing inherently connected to any forces/torques you might appply (although I would imagine this will effect how the body behaves with respect to forces/torques applied in the local frame). These values will act as a sort of offset to the link frame when added to a multibody system. In other words, if a link is added to a multibody system with the aforementioned variables both set to [0.1, 0.1, 0.1], the link will be rendered at an offset of [0.1, 0.1, 0.1] with respect to the link frame, and its collision shape will also be at the same offset with respect to the link frame. Now, if you would like to change the link frame position instead of working with these fixed offsets, createMultiBody has a flag linkPositions that can be used to change the position of a link with respect to its parent.

  • $\begingroup$ Thank you very much for your answer. Generally, may I imagine the "linkInertialFramePosition" the same as the center of mass of an object? $\endgroup$
    – Aurora7979
    Commented Jan 9, 2023 at 1:13
  • $\begingroup$ I'm not 100% sure on this. I think it refers only to where user-defined forces are applied in the link frame. I would imagine that the COM is defined based on the shape of an object and cannot easily be changed - but I would recommend running some tests with different parameters to see if that is the case! $\endgroup$ Commented Jan 9, 2023 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.