Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/roboticstoolbox/robot/DHLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions tests/test_DHRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down