diff --git a/clearpath_generator_common/clearpath_generator_common/description/links.py b/clearpath_generator_common/clearpath_generator_common/description/links.py index 827badaa..38f26a8d 100644 --- a/clearpath_generator_common/clearpath_generator_common/description/links.py +++ b/clearpath_generator_common/clearpath_generator_common/description/links.py @@ -48,6 +48,8 @@ class BaseDescription(): NAME = 'name' PARENT_LINK = 'parent_link' + RGBA = 'rgba' + COLLISION_ENABLE = 'collision' def __init__(self, link: BaseLink) -> None: self.link = link @@ -57,7 +59,7 @@ def __init__(self, link: BaseLink) -> None: self.parameters = { self.NAME: self.link.name, - self.PARENT_LINK: self.link.parent + self.PARENT_LINK: self.link.parent, } @property @@ -74,7 +76,8 @@ class BoxDescription(BaseDescription): def __init__(self, link: Box) -> None: super().__init__(link) self.parameters.update({ - self.SIZE: str(link.size).strip('[]').replace(',', '') + self.SIZE: str(link.size).strip('[]').replace(',', ''), + self.RGBA: str(self.link.rgba).strip('[]').replace(',', ''), }) class CylinderDescription(BaseDescription): @@ -85,7 +88,9 @@ def __init__(self, link: Cylinder) -> None: super().__init__(link) self.parameters.update({ self.RADIUS: link.radius, - self.LENGTH: link.length + self.LENGTH: link.length, + self.RGBA: str(self.link.rgba).strip('[]').replace(',', ''), + self.COLLISION_ENABLE: self.link.collision_enable, }) class SphereDescription(BaseDescription): @@ -94,7 +99,9 @@ class SphereDescription(BaseDescription): def __init__(self, link: Sphere) -> None: super().__init__(link) self.parameters.update({ - self.RADIUS: link.radius + self.RADIUS: link.radius, + self.RGBA: str(self.link.rgba).strip('[]').replace(',', ''), + self.COLLISION_ENABLE: self.link.collision_enable, }) class MeshDescription(BaseDescription): @@ -102,14 +109,19 @@ class MeshDescription(BaseDescription): def __init__(self, link: Mesh) -> None: super().__init__(link) + self.parameters.update({ + self.RGBA: str(self.link.rgba).strip('[]').replace(',', ''), + self.COLLISION_ENABLE: self.link.collision_enable, + }) if (link.visual.package): self.parameters.update({ self.VISUAL: os.path.join('package://' + link.visual.package, - File.clean(link.visual.path, make_abs=False)) + File.clean(link.visual.path, make_abs=False)), + }) else: self.parameters.update({ - self.VISUAL: 'file://' + File.clean(link.visual.path, make_abs=False) + self.VISUAL: 'file://' + File.clean(link.visual.path, make_abs=False), }) MODEL = { diff --git a/clearpath_platform_description/urdf/links/box.urdf.xacro b/clearpath_platform_description/urdf/links/box.urdf.xacro index aa65d880..19bdfc9f 100644 --- a/clearpath_platform_description/urdf/links/box.urdf.xacro +++ b/clearpath_platform_description/urdf/links/box.urdf.xacro @@ -1,19 +1,22 @@ - + - + + + - - - - - - + + + + + + + diff --git a/clearpath_platform_description/urdf/links/cylinder.urdf.xacro b/clearpath_platform_description/urdf/links/cylinder.urdf.xacro index 6dcc4cae..d6dcfacf 100644 --- a/clearpath_platform_description/urdf/links/cylinder.urdf.xacro +++ b/clearpath_platform_description/urdf/links/cylinder.urdf.xacro @@ -1,19 +1,22 @@ - + - + + + - - - - - - + + + + + + + diff --git a/clearpath_platform_description/urdf/links/mesh.urdf.xacro b/clearpath_platform_description/urdf/links/mesh.urdf.xacro index 4b175ff5..484dddeb 100644 --- a/clearpath_platform_description/urdf/links/mesh.urdf.xacro +++ b/clearpath_platform_description/urdf/links/mesh.urdf.xacro @@ -1,19 +1,22 @@ - + - + + + - - - - - - + + + + + + + diff --git a/clearpath_platform_description/urdf/links/sphere.urdf.xacro b/clearpath_platform_description/urdf/links/sphere.urdf.xacro index 5f57fe3a..a56643de 100644 --- a/clearpath_platform_description/urdf/links/sphere.urdf.xacro +++ b/clearpath_platform_description/urdf/links/sphere.urdf.xacro @@ -1,19 +1,22 @@ - + - + + + - - - - - - + + + + + + +