Update repr/str to handle case with no name
@@ -128,6 +128,9 @@ class ELink(Link):
def __repr__(self):
name = self.__class__.__name__
+ if self.name is None:
+ s = f"ets={self.ets()}"
+ else:
s = f"{self.name}, ets={self.ets()}"
if self.parent is not None:
s += f", parent={self.parent.name}"
@@ -141,12 +144,16 @@ class ELink(Link):
:return: Pretty print of the robot link
:rtype: str
"""
- # name = self.__class__.__name__
+ name = self.__class__.__name__
+
+ if self.name is None:
+ return f"{name}[{self.ets()}] "
+ else:
if self.parent is None:
parent = ""
else:
parent = f" [{self.parent.name}]"
- return f"name[{self.name}({parent}): {self.ets()}] "
+ return f"{name}[{self.name}({parent}): {self.ets()}] "
@property
def v(self):
