Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed staticmethods and replaced with classmethods to preserve inhe… #18

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading