Skip to content

DHRobot.ikine_6s() undoes the tool transform on the wrong side #640

Description

@petercorke

Background

Originally reported in #491: DHRobot.ikine_6s() undoes the tool transform on the wrong side. src/roboticstoolbox/robot/DHRobot.py:1892:

if tool is not None:
    T = tool.inv() * T

Since forward kinematics composes as T_ee = T_base * T_chain * T_tool, undoing the tool transform to recover T_chain requires right-multiplying by tool.inv() (T = T * tool.inv()), not left-multiplying.

Confirmed still live (2026-08-25)

Reproduced directly: Puma560 with tool = SE3.Tz(0.1), solved via ikine_a (which uses ikine_6s internally, see Puma560.py). Roundtrip fkine(sol.q) does not match the original target pose -- the translation error is shaped exactly like the tool offset (off by ~0.1 in z, consistent with the tool transform being applied on the wrong side / inverted incorrectly).

Next steps

Change line 1892 to T = T * tool.inv(), matching the reporter's proposed fix. Add a regression test: solve ikine_6s/ikine_a for a model with a nonzero tool, assert fkine(sol.q) round-trips to the original target.

Originally reported: #491.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtKnown technical debt / deferred cleanup, not a live bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions