diff --git a/onshape_to_robot/robot_description.py b/onshape_to_robot/robot_description.py index 287a77e..6e173af 100644 --- a/onshape_to_robot/robot_description.py +++ b/onshape_to_robot/robot_description.py @@ -268,7 +268,7 @@ def addSTL(self, matrix, stl, color, name, node='visual'): material_name = name + "_material" material_name = xml_escape(material_name) - self.append('<'+node+'>') + self.append(f'<{node} name="{name}">') self.append(origin(matrix)) self.append('') self.append(f'') @@ -278,7 +278,7 @@ def addSTL(self, matrix, stl, color, name, node='visual'): self.append('' % (color[0], color[1], color[2])) self.append('') - self.append('') + self.append(f'<{node}>') def addPart(self, matrix, stl, mass, com, inertia, color, shapes=None, name=''): if stl is not None: @@ -449,14 +449,14 @@ def material(self, color): return m def addSTL(self, matrix, stl, color, name, node='visual'): - self.append('<'+node+' name="'+name+'_visual">') + self.append(f'<{node} name="{name}_visual">') self.append(pose(matrix)) self.append('') self.append('file://'+stl+'') self.append('') if node == 'visual': self.append(self.material(color)) - self.append('') + self.append(f'<{node}>') def addPart(self, matrix, stl, mass, com, inertia, color, shapes=None, name=''): name = self._link_name+'_'+str(self._link_childs)+'_'+name