Skip to content

About the Implementation of FK #71

@Jiaqi-zhang

Description

@Jiaqi-zhang

Thank you for the excellent work.

I have a question regarding the implementation of Forward Kinematics (FK), as shown in the code below.

Why is the local rotation of the child joint not used when calculating the global position of the bones, and instead, only the global rotation of the parent joint is applied? In my understanding, the bone from the parent joint to its own joint is also influenced by the local rotation of its own node. However, according to your code, it seems that the bone is manipulated based on the parent node's rotation.

def transform_mul(x, y):

    # Combine two transformation together

    # old version
    z = transform_from_rotation_translation(
        r=quat_mul_norm(transform_rotation(x), transform_rotation(y)),
        t=quat_rotate(transform_rotation(x), transform_translation(y))
        + transform_translation(x),
    )
    
    # my version
    joint_r = quat_mul_norm(transform_rotation(x), transform_rotation(y))
    z = transform_from_rotation_translation(
        r=joint_r,
        t=quat_rotate(joint_r, transform_translation(y)) + transform_translation(x),
    )
    return z

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions