Skip to content

Commit d0cd6c8

Browse files
committed
ELink clash
2 parents 211e1ba + 7070d04 commit d0cd6c8

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy