tool and base can be None
rather than default value of SE3()
helps for symbolic stuff
@@ -20,10 +20,6 @@ class Robot:
self.name = name
self.manufacturer = manufacturer
- if base is None:
- base = SE3()
- if tool is None:
- tool = SE3()
self.base = base
self.tool = tool
if keywords is not None and not isinstance(keywords, (tuple, list)):
@@ -96,15 +92,22 @@ class Robot:
@base.setter
def base(self, T):
- if not isinstance(T, SE3):
- T = SE3(T)
+ # if not isinstance(T, SE3):
+ # T = SE3(T)
+ if T is None or isinstance(T, SE3):
self._base = T
+ else:
+ raise ValueError('base must be set to None (no tool) or an SE3')
@tool.setter
def tool(self, T):
- if not isinstance(T, SE3):
- T = SE3(T)
+ # if not isinstance(T, SE3):
+ # T = SE3(T)
+ # this is allowed to be none, it's helpful for symbolics rather than having an identity matrix
+ if T is None or isinstance(T, SE3):
self._tool = T
+ else:
+ raise ValueError('tool must be set to None (no tool) or an SE3')
@gravity.setter
def gravity(self, gravity_new):
