Skip to content

Commit

Permalink
Add names to collision/visual nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
hartikainen committed Nov 1, 2024
1 parent e1ffc8c commit 0047a44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions onshape_to_robot/robot_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('<geometry>')
self.append(f'<mesh filename="package://{stl_file}"/>')
Expand All @@ -278,7 +278,7 @@ def addSTL(self, matrix, stl, color, name, node='visual'):
self.append('<color rgba="%.20g %.20g %.20g 1.0"/>' %
(color[0], color[1], color[2]))
self.append('</material>')
self.append('</'+node+'>')
self.append(f'</{node}>')

def addPart(self, matrix, stl, mass, com, inertia, color, shapes=None, name=''):
if stl is not None:
Expand Down Expand Up @@ -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('<geometry>')
self.append('<mesh><uri>file://'+stl+'</uri></mesh>')
self.append('</geometry>')
if node == 'visual':
self.append(self.material(color))
self.append('</'+node+'>')
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
Expand Down

0 comments on commit 0047a44

Please sign in to comment.