diff --git a/src/rod/sdf/geometry.py b/src/rod/sdf/geometry.py index 767b2a7..de55d58 100644 --- a/src/rod/sdf/geometry.py +++ b/src/rod/sdf/geometry.py @@ -1,7 +1,8 @@ from __future__ import annotations import dataclasses -from typing import ClassVar +import types +from typing import ClassVar, Union import mashumaro @@ -116,7 +117,7 @@ class Sphere(Element): @dataclasses.dataclass class Geometry(Element): - GeometryType: ClassVar = ( + GeometryType: ClassVar[types.UnionType] = ( Box | Capsule | Cylinder | Ellipsoid | Heightmap | Mesh | Plane | Sphere ) diff --git a/src/rod/tree/tree_elements.py b/src/rod/tree/tree_elements.py index 400ea8a..f09958a 100644 --- a/src/rod/tree/tree_elements.py +++ b/src/rod/tree/tree_elements.py @@ -57,7 +57,7 @@ def __str__(self) -> str: content_string = ( f"name={self.name()}, " f"index={self.index}, " - f"parent={self.parent.name() if self.parent else "None"}, " + f"parent={self.parent.name() if self.parent else str(None)}, " f"children=[{[c.name() for c in self.children]}]" ) diff --git a/src/rod/urdf/exporter.py b/src/rod/urdf/exporter.py index a1ba3ed..06ecdc8 100644 --- a/src/rod/urdf/exporter.py +++ b/src/rod/urdf/exporter.py @@ -446,7 +446,7 @@ def _rod_material_to_xmltodict(material: rod.Material) -> dict[str, Any]: return UrdfExporter.DefaultMaterial return { - "@name": f"color_{hash(" ".join(map(str, material.diffuse)))}", + "@name": f"color_{hash(' '.join(map(str, material.diffuse)))}", "color": { "@rgba": " ".join(map(str, material.diffuse)), },