Skip to content

Commit 0630aba

Browse files
committed
Add test for #342 fkine trajectory
1 parent 083cdc4 commit 0630aba

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

tests/test_ETS.py

+26-1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,32 @@ def test_fkine_sym(self):
232232
)
233233
# nt.assert_almost_equal(r2.fkine(q2, tool=tool), ans6) # type: ignore
234234

235+
def test_fkine_traj(self):
236+
robot = rtb.ERobot(
237+
[
238+
rtb.Link(rtb.ET.Rx()),
239+
rtb.Link(rtb.ET.Ry()),
240+
rtb.Link(rtb.ET.Rz()),
241+
rtb.Link(rtb.ET.tx()),
242+
rtb.Link(rtb.ET.ty()),
243+
rtb.Link(rtb.ET.tz()),
244+
]
245+
)
246+
247+
ets = robot.ets()
248+
249+
qt = np.arange(10 * ets.n).reshape(10, ets.n)
250+
251+
T_individual = []
252+
253+
for q in qt:
254+
T_individual.append(ets.eval(q))
255+
256+
T_traj = ets.eval(qt)
257+
258+
for i in range(10):
259+
nt.assert_allclose(T_traj[i, :, :], T_individual[i])
260+
235261
def test_jacob0_panda(self):
236262
deg = np.pi / 180
237263
mm = 1e-3
@@ -4342,5 +4368,4 @@ def test_manip_fail2(self):
43424368

43434369

43444370
if __name__ == "__main__":
4345-
43464371
unittest.main()

0 commit comments

Comments
 (0)