From 0047a44d3939ac17f31b96a2f0d38875ac0ea644 Mon Sep 17 00:00:00 2001 From: Kristian Hartikainen Date: Fri, 1 Nov 2024 10:40:27 +0200 Subject: [PATCH] Add names to collision/visual nodes --- onshape_to_robot/robot_description.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/onshape_to_robot/robot_description.py b/onshape_to_robot/robot_description.py index 287a77e..a1a10b7 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'') 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'') def addPart(self, matrix, stl, mass, com, inertia, color, shapes=None, name=''): name = self._link_name+'_'+str(self._link_childs)+'_'+name