1414
1515
1616class AbstractRobotModelArtist (object ):
17-
1817 def transform (self , geometry , transformation ):
1918 """Transforms a CAD-specific geometry using a Transformation.
2019
@@ -75,7 +74,7 @@ def __init__(self, model):
7574 super (RobotModelArtist , self ).__init__ ()
7675 self .model = model
7776 self .create ()
78- self .scale_factor = 1.
77+ self .scale_factor = 1.0
7978 self .attached_tool_models = {}
8079 self .attached_items = {}
8180
@@ -105,7 +104,7 @@ def attach_tool_model(self, tool_model):
105104 The tool that should be attached to the robot's flange.
106105
107106 """
108- self .create (tool_model .root , ' attached_tool' )
107+ self .create (tool_model .root , " attached_tool" )
109108
110109 if not tool_model .link_name :
111110 link = self .model .get_end_effector_link ()
@@ -121,7 +120,7 @@ def attach_tool_model(self, tool_model):
121120
122121 sample_geometry = link .collision [0 ] if link .collision else link .visual [0 ] if link .visual else None
123122
124- if hasattr (sample_geometry , ' current_transformation' ):
123+ if hasattr (sample_geometry , " current_transformation" ):
125124 relative_transformation = sample_geometry .current_transformation
126125 else :
127126 relative_transformation = Transformation ()
@@ -231,17 +230,17 @@ def create(self, link=None, context=None):
231230 meshes = Geometry ._get_item_meshes (item )
232231
233232 if meshes :
234- is_visual = hasattr (item , ' get_color' )
233+ is_visual = hasattr (item , " get_color" )
235234 color = item .get_color () if is_visual else None
236235
237236 native_geometry = []
238237 for i , mesh in enumerate (meshes ):
239- mesh_type = ' visual' if is_visual else ' collision'
238+ mesh_type = " visual" if is_visual else " collision"
240239 if not context :
241240 mesh_name_components = [self .model .name , mesh_type , link .name , str (i )]
242241 else :
243242 mesh_name_components = [self .model .name , mesh_type , context , link .name , str (i )]
244- mesh_name = '.' .join (mesh_name_components )
243+ mesh_name = "." .join (mesh_name_components )
245244 native_mesh = self .create_geometry (mesh , name = mesh_name , color = color )
246245
247246 self .transform (native_mesh , item .init_transformation )
@@ -363,7 +362,7 @@ def _apply_transformation_on_transformed_link(self, item, transformation):
363362 None
364363
365364 """
366- if getattr (item , ' current_transformation' ):
365+ if getattr (item , " current_transformation" ):
367366 relative_transformation = transformation * item .current_transformation .inverse ()
368367 else :
369368 relative_transformation = transformation
@@ -450,10 +449,10 @@ def draw_visual(self):
450449
451450 """
452451 visual = []
453- for native_geometry in self ._iter_geometry (self .model , ' visual' ):
452+ for native_geometry in self ._iter_geometry (self .model , " visual" ):
454453 visual .append (native_geometry )
455454 for tool in self .attached_tool_models .values ():
456- for native_geometry in self ._iter_geometry (tool , ' visual' ):
455+ for native_geometry in self ._iter_geometry (tool , " visual" ):
457456 visual .append (native_geometry )
458457 return visual
459458
@@ -467,10 +466,10 @@ def draw_collision(self):
467466
468467 """
469468 visual = []
470- for native_geometry in self ._iter_geometry (self .model , ' collision' ):
469+ for native_geometry in self ._iter_geometry (self .model , " collision" ):
471470 visual .append (native_geometry )
472471 for tool in self .attached_tool_models .values ():
473- for native_geometry in self ._iter_geometry (tool , ' collision' ):
472+ for native_geometry in self ._iter_geometry (tool , " collision" ):
474473 visual .append (native_geometry )
475474
476475 return visual
0 commit comments