From 027b5b25d212aa788cc774e55e3baf18f077a23d Mon Sep 17 00:00:00 2001 From: Luis Camero Date: Tue, 27 Aug 2024 16:37:57 -0400 Subject: [PATCH 1/4] Add height parameter to Dingo top plate --- clearpath_config/platform/attachments/dd100.py | 13 +++++++++++++ clearpath_config/platform/attachments/dd150.py | 13 ++++++------- clearpath_config/platform/attachments/do100.py | 14 +++++++------- clearpath_config/platform/attachments/do150.py | 14 +++++++------- 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/clearpath_config/platform/attachments/dd100.py b/clearpath_config/platform/attachments/dd100.py index fe3505a..cfae4f1 100644 --- a/clearpath_config/platform/attachments/dd100.py +++ b/clearpath_config/platform/attachments/dd100.py @@ -37,17 +37,30 @@ class DD100TopPlate(BaseAttachment): PACS = "pacs" MODELS = [PACS] PARENT = "default_mount" + HEIGHT = 0.1 def __init__( self, name: str = ATTACHMENT_MODEL, model: str = PACS, enabled: bool = BaseAttachment.ENABLED, + height: float = HEIGHT, parent: str = PARENT, xyz: List[float] = Accessory.XYZ, rpy: List[float] = Accessory.RPY ) -> None: super().__init__(name, model, enabled, parent, xyz, rpy) + self.height = height + + def to_dict(self) -> dict: + d = super().to_dict() + d['height'] = self.height + return d + + def from_dict(self, d: dict) -> None: + super().from_dict(d) + if 'height' in d: + self.height = d['height'] # DD100 Attachments diff --git a/clearpath_config/platform/attachments/dd150.py b/clearpath_config/platform/attachments/dd150.py index c49c9b7..6db0e0e 100644 --- a/clearpath_config/platform/attachments/dd150.py +++ b/clearpath_config/platform/attachments/dd150.py @@ -28,26 +28,25 @@ from clearpath_config.common.types.accessory import Accessory from clearpath_config.common.types.platform import Platform from clearpath_config.platform.types.attachment import BaseAttachment, PlatformAttachment +from clearpath_config.platform.attachments.dd100 import DD100TopPlate from typing import List -class DD150TopPlate(BaseAttachment): +class DD150TopPlate(DD100TopPlate): PLATFORM = Platform.DD150 ATTACHMENT_MODEL = "%s.top_plate" % PLATFORM - PACS = "pacs" - MODELS = [PACS] - PARENT = "default_mount" def __init__( self, name: str = ATTACHMENT_MODEL, - model: str = PACS, + model: str = DD100TopPlate.PACS, enabled: bool = BaseAttachment.ENABLED, - parent: str = PARENT, + height: float = DD100TopPlate.HEIGHT, + parent: str = DD100TopPlate.PARENT, xyz: List[float] = Accessory.XYZ, rpy: List[float] = Accessory.RPY ) -> None: - super().__init__(name, model, enabled, parent, xyz, rpy) + super().__init__(name, model, enabled, height, parent, xyz, rpy) # DD150 Attachments diff --git a/clearpath_config/platform/attachments/do100.py b/clearpath_config/platform/attachments/do100.py index 4d19778..e3cf219 100644 --- a/clearpath_config/platform/attachments/do100.py +++ b/clearpath_config/platform/attachments/do100.py @@ -28,26 +28,26 @@ from clearpath_config.common.types.accessory import Accessory from clearpath_config.common.types.platform import Platform from clearpath_config.platform.types.attachment import BaseAttachment, PlatformAttachment +from clearpath_config.platform.attachments.dd100 import DD100TopPlate from typing import List -class DO100TopPlate(BaseAttachment): +class DO100TopPlate(DD100TopPlate): PLATFORM = Platform.DO100 ATTACHMENT_MODEL = "%s.top_plate" % PLATFORM - PACS = "pacs" - MODELS = [PACS] - PARENT = "default_mount" def __init__( self, name: str = ATTACHMENT_MODEL, - model: str = PACS, + model: str = DD100TopPlate.PACS, enabled: bool = BaseAttachment.ENABLED, - parent: str = PARENT, + height: float = DD100TopPlate.HEIGHT, + parent: str = DD100TopPlate.PARENT, xyz: List[float] = Accessory.XYZ, rpy: List[float] = Accessory.RPY ) -> None: - super().__init__(name, model, enabled, parent, xyz, rpy) + super().__init__(name, model, enabled, height, parent, xyz, rpy) + # DO100 Attachments diff --git a/clearpath_config/platform/attachments/do150.py b/clearpath_config/platform/attachments/do150.py index 52cddb9..2bd7ddb 100644 --- a/clearpath_config/platform/attachments/do150.py +++ b/clearpath_config/platform/attachments/do150.py @@ -28,26 +28,26 @@ from clearpath_config.common.types.accessory import Accessory from clearpath_config.common.types.platform import Platform from clearpath_config.platform.types.attachment import BaseAttachment, PlatformAttachment +from clearpath_config.platform.attachments.dd100 import DD100TopPlate from typing import List -class DO150TopPlate(BaseAttachment): +class DO150TopPlate(DD100TopPlate): PLATFORM = Platform.DO150 ATTACHMENT_MODEL = "%s.top_plate" % PLATFORM - PACS = "pacs" - MODELS = [PACS] - PARENT = "default_mount" def __init__( self, name: str = ATTACHMENT_MODEL, - model: str = PACS, + model: str = DD100TopPlate.PACS, enabled: bool = BaseAttachment.ENABLED, - parent: str = PARENT, + height: float = DD100TopPlate.HEIGHT, + parent: str = DD100TopPlate.PARENT, xyz: List[float] = Accessory.XYZ, rpy: List[float] = Accessory.RPY ) -> None: - super().__init__(name, model, enabled, parent, xyz, rpy) + super().__init__(name, model, enabled, height, parent, xyz, rpy) + # DO150 Attachments From 4f756952284aba3489551e3018355fdeadbfad22 Mon Sep 17 00:00:00 2001 From: Luis Camero Date: Fri, 30 Aug 2024 09:47:58 -0400 Subject: [PATCH 2/4] FAMS, HAMS, and Tower as separate attachments --- clearpath_config/platform/attachments/r100.py | 93 +++++++++++++++++-- 1 file changed, 83 insertions(+), 10 deletions(-) diff --git a/clearpath_config/platform/attachments/r100.py b/clearpath_config/platform/attachments/r100.py index c9f4aa5..76d586f 100644 --- a/clearpath_config/platform/attachments/r100.py +++ b/clearpath_config/platform/attachments/r100.py @@ -31,24 +31,93 @@ from clearpath_config.platform.types.attachment import BaseAttachment, PlatformAttachment -class R100ArmMount(BaseAttachment): +class R100FAMS(BaseAttachment): PLATFORM = Platform.R100 - ATTACHMENT_MODEL = "%s.arm_mount" % PLATFORM - FAMS = "fams" - HAMS = "hams" - TOWER = "tower" - MODELS = [FAMS, HAMS, TOWER] - DEFAULT = TOWER + ATTACHMENT_MODEL = "%s.fams" % PLATFORM + DEFAULT = "default" + MODELS = [DEFAULT] PARENT = "default_mount" + TABLE_HEIGHT = 0.3 def __init__( self, name: str = ATTACHMENT_MODEL, model: str = DEFAULT, + table_height: float = TABLE_HEIGHT, enabled: bool = BaseAttachment.ENABLED, parent: str = PARENT, xyz: List[float] = Accessory.XYZ, - rpy: List[float] = Accessory.RPY + rpy: List[float] = Accessory.RPY, + ) -> None: + super().__init__(name, model, enabled, parent, xyz, rpy) + self.table_height = table_height + + def to_dict(self) -> dict: + d = super().to_dict() + d['table_height'] = self.table_height + return d + + def from_dict(self, d: dict) -> None: + super().from_dict(d) + if 'table_height' in d: + self.table_height = d['table_height'] + return d + + +class R100HAMS(BaseAttachment): + PLATFORM = Platform.R100 + ATTACHMENT_MODEL = "%s.hams" % PLATFORM + DEFAULT = "default" + MODELS = [DEFAULT] + PARENT = "default_mount" + TABLE_HEIGHT = 0.6 + MOUNT_HEIGHT = 0.3 + + def __init__( + self, + name: str = ATTACHMENT_MODEL, + model: str = DEFAULT, + table_height: float = TABLE_HEIGHT, + mount_height: float = MOUNT_HEIGHT, + enabled: bool = BaseAttachment.ENABLED, + parent: str = PARENT, + xyz: List[float] = Accessory.XYZ, + rpy: List[float] = Accessory.RPY, + ) -> None: + super().__init__(name, model, enabled, parent, xyz, rpy) + self.table_height = table_height + self.mount_height = mount_height + + def to_dict(self) -> dict: + d = super().to_dict() + d['table_height'] = self.table_height + d['mount_height'] = self.mount_height + return d + + def from_dict(self, d: dict) -> None: + super().from_dict(d) + if 'table_height' in d: + self.table_height = d['table_height'] + if 'mount_height' in d: + self.mount_height = d['mount_height'] + return d + + +class R100Tower(BaseAttachment): + PLATFORM = Platform.R100 + ATTACHMENT_MODEL = "%s.tower" % PLATFORM + DEFAULT = "default" + MODELS = [DEFAULT] + PARENT = "default_mount" + + def __init__( + self, + name: str = ATTACHMENT_MODEL, + model: str = DEFAULT, + enabled: bool = BaseAttachment.ENABLED, + parent: str = PARENT, + xyz: List[float] = Accessory.XYZ, + rpy: List[float] = Accessory.RPY, ) -> None: super().__init__(name, model, enabled, parent, xyz, rpy) @@ -57,8 +126,12 @@ def __init__( class R100Attachment(PlatformAttachment): PLATFORM = Platform.R100 # Arm Mount - ARM_MOUNT = R100ArmMount.ATTACHMENT_MODEL + HAMS = R100HAMS.ATTACHMENT_MODEL + FAMS = R100FAMS.ATTACHMENT_MODEL + TOWER = R100Tower.ATTACHMENT_MODEL TYPES = { - ARM_MOUNT: R100ArmMount + HAMS: R100HAMS, + FAMS: R100FAMS, + TOWER: R100Tower } From 4d44ac027bf7d190a3e5652df920a261f959e52a Mon Sep 17 00:00:00 2001 From: Luis Camero Date: Fri, 30 Aug 2024 12:21:21 -0400 Subject: [PATCH 3/4] Height parameters for tower shoulder --- clearpath_config/platform/attachments/r100.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/clearpath_config/platform/attachments/r100.py b/clearpath_config/platform/attachments/r100.py index 76d586f..1bef1d0 100644 --- a/clearpath_config/platform/attachments/r100.py +++ b/clearpath_config/platform/attachments/r100.py @@ -109,6 +109,8 @@ class R100Tower(BaseAttachment): DEFAULT = "default" MODELS = [DEFAULT] PARENT = "default_mount" + LEFT_HEIGHT = 0.0 + RIGHT_HEIGHT = 0.0 def __init__( self, @@ -116,10 +118,26 @@ def __init__( model: str = DEFAULT, enabled: bool = BaseAttachment.ENABLED, parent: str = PARENT, + left_height: float = LEFT_HEIGHT, + right_height: float = RIGHT_HEIGHT, xyz: List[float] = Accessory.XYZ, rpy: List[float] = Accessory.RPY, ) -> None: super().__init__(name, model, enabled, parent, xyz, rpy) + self.left_height = left_height + self.right_height = right_height + + def to_dict(self) -> dict: + d = super().to_dict() + d['left_height'] = self.left_height + d['right_height'] = self.right_height + + def from_dict(self, d: dict) -> None: + super().from_dict(d) + if 'left_height' in d: + self.left_height = d['left_height'] + if 'right_height' in d: + self.right_height = d['right_height'] # R100 Attachments From 031dc41d755cf841e8beae45c5163cf455d7e592 Mon Sep 17 00:00:00 2001 From: Luis Camero Date: Mon, 9 Sep 2024 14:32:50 -0400 Subject: [PATCH 4/4] Remove empty line in D150 attachments --- clearpath_config/platform/attachments/do100.py | 1 - clearpath_config/platform/attachments/do150.py | 1 - 2 files changed, 2 deletions(-) diff --git a/clearpath_config/platform/attachments/do100.py b/clearpath_config/platform/attachments/do100.py index e3cf219..37f8293 100644 --- a/clearpath_config/platform/attachments/do100.py +++ b/clearpath_config/platform/attachments/do100.py @@ -49,7 +49,6 @@ def __init__( super().__init__(name, model, enabled, height, parent, xyz, rpy) - # DO100 Attachments class DO100Attachment(PlatformAttachment): PLATFORM = Platform.DO100 diff --git a/clearpath_config/platform/attachments/do150.py b/clearpath_config/platform/attachments/do150.py index 2bd7ddb..44ba568 100644 --- a/clearpath_config/platform/attachments/do150.py +++ b/clearpath_config/platform/attachments/do150.py @@ -49,7 +49,6 @@ def __init__( super().__init__(name, model, enabled, height, parent, xyz, rpy) - # DO150 Attachments class DO150Attachment(PlatformAttachment): PLATFORM = Platform.DO100