Skip to content

Commit 6f15606

Browse files
committed
ERobot accepts a DHRobot to constructor
1 parent 7baf4e1 commit 6f15606

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

roboticstoolbox/robot/ERobot.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ def __init__(
7979
# search order
8080
orlinks = []
8181

82+
if isinstance(arg, DHRobot):
83+
# we're passed a DHRobot object
84+
args = args.ets()
85+
8286
link_number = 0
8387
if isinstance(arg, SuperETS):
8488
# we're passed an ETS string
@@ -128,20 +132,6 @@ def __init__(
128132
if link.isjoint:
129133
n += 1
130134

131-
132-
elif isinstance(arg, DHRobot):
133-
# we're passed a DHRobot object
134-
135-
self.__init__(
136-
arg.ets(),
137-
name=arg.name,
138-
manufacturer=arg.manufacturer,
139-
comment=arg.comment,
140-
base=arg.base,
141-
tool=arg.tool
142-
)
143-
return
144-
145135
# elinks = []
146136
# for dhlink in arg:
147137
# e = dhlink.ets()

0 commit comments

Comments
 (0)