Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the Implementation of FK #71

Open
Jiaqi-zhang opened this issue Jan 23, 2024 · 0 comments
Open

About the Implementation of FK #71

Jiaqi-zhang opened this issue Jan 23, 2024 · 0 comments

Comments

@Jiaqi-zhang
Copy link

Jiaqi-zhang commented Jan 23, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant