Skip to content

The inverse kinematic doesn't reflect true orientation of a motion. #177

@yujuisu

Description

@yujuisu

The orientation of each bone are computed downstream from a chain:

for chain in self._kinematic_tree:
    R = root_quat
    for j in range(len(chain) - 1):
        # (batch, 3)
        u = self._raw_offset_np[chain[j+1]][np.newaxis,...].repeat(len(joints), axis=0)
        # print(u.shape)
        # (batch, 3)
        v = joints[:, chain[j+1]] - joints[:, chain[j]]
        v = v / np.sqrt((v**2).sum(axis=-1))[:, np.newaxis]
        # print(u.shape, v.shape)
        rot_u_v = qbetween_np(u, v)

        R_loc = qmul_np(qinv_np(R), rot_u_v)

        quat_params[:,chain[j + 1], :] = R_loc
        R = qmul_np(R, R_loc)

But consider these:

  1. Lift the arm by rotating the shoulder. You should update the orientation of the arm. But instead you update the relative rotation between forearm and arm.
  2. It can’t detect twist around the forearm axis. Suppose the wrist rotates (e.g. turning a screwdriver), but the elbow and wrist positions stay fixed.

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