From 2105ecbd533befbcf06a67eea799c1ee5ffd3909 Mon Sep 17 00:00:00 2001 From: Taha Zarif Date: Tue, 18 Aug 2026 17:19:08 +0430 Subject: [PATCH 1/2] fix: use joint ET for DHLink flip handling --- src/roboticstoolbox/robot/DHLink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/roboticstoolbox/robot/DHLink.py b/src/roboticstoolbox/robot/DHLink.py index 4b570901e..827a214dd 100644 --- a/src/roboticstoolbox/robot/DHLink.py +++ b/src/roboticstoolbox/robot/DHLink.py @@ -616,7 +616,7 @@ def A(self, q: float) -> SE3: sa = _sin(self.alpha) ca = _cos(self.alpha) - if self.ets[-1].isflip: + if self.v is not None and self.v.isflip: q = -q + self.offset else: q = q + self.offset From d9b98d4269f3f1cb4986ce335e53df81cf753c1e Mon Sep 17 00:00:00 2001 From: Taha Zarif Date: Tue, 18 Aug 2026 17:33:31 +0430 Subject: [PATCH 2/2] test: add regression coverage for flipped standard-DH joints --- tests/test_DHRobot.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/test_DHRobot.py b/tests/test_DHRobot.py index f76706561..307a8de7a 100644 --- a/tests/test_DHRobot.py +++ b/tests/test_DHRobot.py @@ -168,6 +168,33 @@ def test_qlim(self): nt.assert_array_almost_equal(r0.qlim, ans) nt.assert_array_almost_equal(r1.qlim, np.c_[qlim]) + def test_A_flip_standard_dh(self): + q = 0.3 + + flipped = rp.RevoluteDH( + d=0.2, a=0.3, alpha=0.4, offset=0.1, flip=True + ) + normal = rp.RevoluteDH( + d=0.2, a=0.3, alpha=0.4, offset=0.1 + ) + + nt.assert_array_almost_equal( + flipped.A(q).A, + normal.A(-q).A, + ) + + flipped = rp.PrismaticDH( + theta=0.2, a=0.3, alpha=0.4, offset=0.1, flip=True + ) + normal = rp.PrismaticDH( + theta=0.2, a=0.3, alpha=0.4, offset=0.1 + ) + + nt.assert_array_almost_equal( + flipped.A(q).A, + normal.A(-q).A, + ) + def test_fkine(self): l0 = rp.PrismaticDH() l1 = rp.RevoluteDH()