10000 tool and base can be None · G-SS/robotics-toolbox-python@7c64cbb · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c64cbb

Browse files
committed
tool and base can be None
rather than default value of SE3() helps for symbolic stuff
1 parent ee9fbc3 commit 7c64cbb

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

roboticstoolbox/robot/Robot.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ def __init__(
2020
self.name = name
2121
self.manufacturer = manufacturer
2222

23-
if base is None:
24-
base = SE3()
25-
if tool is None:
26-
tool = SE3()
2723
self.base = base
2824
self.tool = tool
2925
if keywords is not None and not isinstance(keywords, (tuple, list)):
@@ -96,15 +92,22 @@ def manufacturer(self, manufacturer_new):
9692

9793
@base.setter
9894
def base(self, T):
99-
if not isinstance(T, SE3):
100-
T = SE3(T)
101-
self._base = T
95+
# if not isinstance(T, SE3):
96+
# T = SE3(T)
97+
if T is None or isinstance(T, SE3):
98+
self._base = T
99+
else:
100+
raise ValueError('base must be set to None (no tool) or an SE3')
102101

103102
@tool.setter
104103
def tool(self, T):
105-
if not isinstance(T, SE3):
106-
T = SE3(T)
107-
self._tool = T
104+
# if not isinstance(T, SE3):
105+
# T = SE3(T)
106+
# this is allowed to be none, it's helpful for symbolics rather than having an identity matrix
107+
if T is None or isinstance(T, SE3):
108+
self._tool = T
109+
else:
110+
raise ValueError('tool must be set to None (no tool) or an SE3')
108111

109112
@gravity.setter
110113
def gravity(self, gravity_new):

0 commit comments

Comments
 (0)
0