8000 erobot tests · stonebig/robotics-toolbox-python@7070d04 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 7070d04

Browse files
committed
erobot tests
1 parent 97001ae commit 7070d04

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

roboticstoolbox/robot/ELink.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def __init__(
5555
ets=ETS(),
5656
v=None,
5757
parent=None,
58+
jindex=None,
5859
**kwargs):
5960

6061
# process common options
@@ -81,7 +82,7 @@ def __init__(
8182
self._parent = parent
8283
self._child = []
8384
self._joint_name = None
84-
self._jindex = None
85+
self._jindex = jindex
8586

8687
# Initialise the static transform representing the constant
8788
# component of the ETS

tests/test_ERobot.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,33 @@
1111
import spatialmath as sm
1212

1313

14-
class TestETS(unittest.TestCase):
14+
class TestERobot(unittest.TestCase):
15+
16+
def test_ets_init(self):
17+
ets = rp.ETS.tx(-0.0825) * rp.ETS.rz() * rp.ETS.tx(-0.0825) \
18+
* rp.ETS.rz() * rp.ETS.tx(0.1)
19+
20+
rp.ERobot(ets)
21+
22+
def test_init_bases(self):
23+
e1 = rp.ELink()
24+
e2 = rp.ELink()
25+
e3 = rp.ELink(parent=e1)
26+
e4 = rp.ELink(parent=e2)
27+
28+
with self.assertRaises(ValueError):
29+
rp.ERobot([e1, e2, e3, e4])
30+
31+
# def test_jindex(self):
32+
# e1 = rp.ELink(rp.ETS.rz(), jindex=0)
33+
# e2 = rp.ELink(rp.ETS.rz(), jindex=1, parent=e1)
34+
# e3 = rp.ELink(rp.ETS.rz(), jindex=2, parent=e2)
35+
# e4 = rp.ELink(rp.ETS.rz(), jindex=3, parent=e3)
36+
37+
38+
39+
# # with self.assertRaises(ValueError):
40+
# rp.ERobot([e1, e2, e3, e4])
1541

1642
def test_panda(self):
1743
panda = rp.models.ETS.Panda()

0 commit comments

Comments
 (0)
0