File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1111import 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 ()
You can’t perform that action at this time.
0 commit comments