Skip to content

Commit

Permalink
Removed staticmethods and replaced with classmethods to preserve inhe…
Browse files Browse the repository at this point in the history
…ritance
  • Loading branch information
fishbotics committed Mar 2, 2024
1 parent b5df28a commit ea15f75
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions urchin/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ def meshes(self, value):
raise TypeError("Mesh requires a trimesh.Trimesh")
self._meshes = value

@staticmethod
def _load_and_combine_meshes(fn, combine):
@classmethod
def _load_and_combine_meshes(cls, fn, combine):
meshes = load_meshes(fn)
if combine:
# Delete visuals for simplicity
Expand Down Expand Up @@ -3838,8 +3838,8 @@ def _merge_materials(self):
self._materials.append(v.material)
self._material_map[v.material.name] = v.material

@staticmethod
def load(file_obj, lazy_load_meshes=False):
@classmethod
def load(cls, file_obj, lazy_load_meshes=False):
"""Load a URDF from a file.
Parameters
Expand Down Expand Up @@ -3872,7 +3872,7 @@ def load(file_obj, lazy_load_meshes=False):
path, _ = os.path.split(file_obj.name)

node = tree.getroot()
return URDF._from_xml(node, path, lazy_load_meshes)
return cls._from_xml(node, path, lazy_load_meshes)

def _validate_joints(self):
"""Raise an exception of any joints are invalidly specified.
Expand Down

0 comments on commit ea15f75

Please sign in to comment.