Skip to content

Relative transformation for relative frame task not working #97

@ChenZhenY

Description

@ChenZhenY

Hi,

Thanks for providing this wonderful IK. When I use relative frame task, I am able to achieve good whole body IK (providing transformation from base to EEF), but if I change it to relative transformation (providing transformation from torso to EEF) for upper body control, it doesn't seem work correctly. I am curious whether that's my relative frame task setup issue or the way I get the transformation is incorrect (I am using get_transform()). Here is my related code, the difference in two videos only result from test_base="base" (working) or test_base=torso (not tracking correctly).

Thanks in advance!

https://github.com/user-attachments/assets/6dcc9b11-5e30-4c23-9a82-d27634eb3885
https://github.com/user-attachments/assets/bcb18f7e-d24d-4d4a-aed4-cd44f35a8681

test_base = "base"
# test_base = "link_torso_5" 
right_hand_task = mink.RelativeFrameTask(
        frame_name="right_palm",
        frame_type="site",
        root_name=test_base,
        root_type="body",
        position_cost=1.0,
        orientation_cost=1.0,
    )

while viewer.is_running():
            data.mocap_pos[left_mocap_id][0] = pos_EE_L[0]
            data.mocap_pos[left_mocap_id][1] = pos_EE_L[1] + 0.1 * np.sin(2.0 * t)
            data.mocap_pos[left_mocap_id][2] = pos_EE_L[2]

            left_transform = configuration.get_transform("left_target", "site", test_base, "body")
            print(f"left_transform: {left_transform}")
            hands_tasks[0].set_target(left_transform)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions