From b5904aa564d1154785e82b60d222a9317b8fccde Mon Sep 17 00:00:00 2001 From: Roni Kreinin <59886299+roni-kreinin@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:01:08 -0500 Subject: [PATCH] Revert "A300" --- clearpath_config/common/types/platform.py | 5 -- clearpath_config/manipulators/types/arms.py | 8 +- clearpath_config/platform/attachments/a300.py | 88 ------------------- clearpath_config/platform/attachments/mux.py | 2 - clearpath_config/platform/battery.py | 6 -- clearpath_config/platform/can.py | 31 ++----- clearpath_config/platform/extras.py | 13 --- clearpath_config/sensors/types/cameras.py | 4 +- setup.py | 8 +- 9 files changed, 16 insertions(+), 149 deletions(-) delete mode 100644 clearpath_config/platform/attachments/a300.py diff --git a/clearpath_config/common/types/platform.py b/clearpath_config/common/types/platform.py index 49c0718..19bc732 100644 --- a/clearpath_config/common/types/platform.py +++ b/clearpath_config/common/types/platform.py @@ -70,8 +70,6 @@ class Platform: J100 = 'j100' # Husky V2 A200 = 'a200' - # Husky V3 - A300 = 'a300' # Ridgeback V1 R100 = 'r100' # Warthog V2 @@ -86,7 +84,6 @@ class Platform: DO150, J100, A200, - A300, R100, W200, GENERIC @@ -95,7 +92,6 @@ class Platform: PACS = { GENERIC: PACSProfile(rows=100, columns=100), A200: PACSProfile(rows=8, columns=7), - A300: PACSProfile(rows=8, columns=7), J100: PACSProfile(rows=4, columns=2), W200: PACSProfile(rows=100, columns=100), R100: PACSProfile(rows=100, columns=100), @@ -104,7 +100,6 @@ class Platform: INDEX = { GENERIC: IndexingProfile(), A200: IndexingProfile(), - A300: IndexingProfile(), DD100: IndexingProfile(imu=1), DO100: IndexingProfile(imu=1), DD150: IndexingProfile(imu=1), diff --git a/clearpath_config/manipulators/types/arms.py b/clearpath_config/manipulators/types/arms.py index 80f85e5..f30f70a 100644 --- a/clearpath_config/manipulators/types/arms.py +++ b/clearpath_config/manipulators/types/arms.py @@ -40,9 +40,9 @@ class BaseArm(BaseManipulator): MANIPULATOR_MODEL = 'base' MANIPULATOR_TYPE = 'arm' - IP_ADDRESS = 'ip' - IP_PORT = 'port' - DEFAULT_IP_ADDRESS = '192.168.131.40' + IP_ADDRESS = "ip" + IP_PORT = "port" + DEFAULT_IP_ADDRESS = "192.168.131.40" DEFAULT_IP_PORT = 10000 URDF_PARAMETERS = {} @@ -164,7 +164,7 @@ def assert_is_supported(): class UniversalRobots(BaseArm): - MANIPULATOR_MODEL = 'universal_robots' + MANIPULATOR_MODEL = "universal_robots" # Description Variables UR_TYPE = 'ur_type' diff --git a/clearpath_config/platform/attachments/a300.py b/clearpath_config/platform/attachments/a300.py deleted file mode 100644 index ad79f2e..0000000 --- a/clearpath_config/platform/attachments/a300.py +++ /dev/null @@ -1,88 +0,0 @@ -# Software License Agreement (BSD) -# -# @author Luis Camero -# @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of Clearpath Robotics nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# A300 Husky Platform Configuration -from typing import List - -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.types.bumper import Bumper - - -class A300TopPlate(BaseAttachment): - PLATFORM = Platform.A300 - ATTACHMENT_MODEL = '%s.top_plate' % PLATFORM - DEFAULT = 'default' - PACS = 'pacs' - MODELS = [DEFAULT, PACS] - 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) - - -class A300Bumper(Bumper): - PLATFORM = Platform.A300 - ATTACHMENT_MODEL = '%s.bumper' % PLATFORM - EXTENSION = 0.0 - DEFAULT = 'default' - MODELS = [DEFAULT] - PARENT = 'front_bumper_mount' - - def __init__( - self, - name: str = ATTACHMENT_MODEL, - model: str = DEFAULT, - enabled: bool = BaseAttachment.ENABLED, - extension: float = EXTENSION, - parent: str = PARENT, - xyz: List[float] = Accessory.XYZ, - rpy: List[float] = Accessory.RPY - ) -> None: - super().__init__(name, model, enabled, extension, parent, xyz, rpy) - - -class A300Attachment(PlatformAttachment): - PLATFORM = Platform.A300 - # Top Plates - TOP_PLATE = A300TopPlate.ATTACHMENT_MODEL - # Bumper - BUMPER = A300Bumper.ATTACHMENT_MODEL - - TYPES = { - TOP_PLATE: A300TopPlate, - BUMPER: A300Bumper, - } diff --git a/clearpath_config/platform/attachments/mux.py b/clearpath_config/platform/attachments/mux.py index a04e8b3..5889bb0 100644 --- a/clearpath_config/platform/attachments/mux.py +++ b/clearpath_config/platform/attachments/mux.py @@ -27,7 +27,6 @@ # POSSIBILITY OF SUCH DAMAGE. from clearpath_config.common.types.platform import Platform from clearpath_config.platform.attachments.a200 import A200Attachment -from clearpath_config.platform.attachments.a300 import A300Attachment from clearpath_config.platform.attachments.config import AttachmentsConfig from clearpath_config.platform.attachments.dd100 import DD100Attachment from clearpath_config.platform.attachments.dd150 import DD150Attachment @@ -43,7 +42,6 @@ class AttachmentsConfigMux: PLATFORM = { Platform.A200: AttachmentsConfig(A200Attachment), - Platform.A300: AttachmentsConfig(A300Attachment), Platform.DD100: AttachmentsConfig(DD100Attachment), Platform.DO100: AttachmentsConfig(DO100Attachment), Platform.DD150: AttachmentsConfig(DD150Attachment), diff --git a/clearpath_config/platform/battery.py b/clearpath_config/platform/battery.py index c97aa4d..49312c5 100644 --- a/clearpath_config/platform/battery.py +++ b/clearpath_config/platform/battery.py @@ -46,8 +46,6 @@ class BatteryConfig(BaseConfig): ES20_12C = 'ES20_12C' # A200/J100 LiION HE2613 = 'HE2613' - # A300 LiFEPO4 - S_24V20_U1 = 'S_24V20_U1' # R100 Lead Acid DTM8A31 = '8A31DTM' # W200 Lead Acid @@ -64,7 +62,6 @@ class BatteryConfig(BaseConfig): S1P2 = 'S1P2' S1P3 = 'S1P3' S1P4 = 'S1P4' - S1P6 = 'S1P6' S2P1 = 'S2P1' S4P1 = 'S4P1' S4P3 = 'S4P3' @@ -77,9 +74,6 @@ class BatteryConfig(BaseConfig): ES20_12C: [S2P1], HE2613: [S1P3, S1P4], }, - Platform.A300: { - S_24V20_U1: [S1P2, S1P4, S1P6], - }, Platform.DD100: { TLV1222: [S1P1], PH3054: [S1P1], diff --git a/clearpath_config/platform/can.py b/clearpath_config/platform/can.py index 92435f5..dbd4f99 100644 --- a/clearpath_config/platform/can.py +++ b/clearpath_config/platform/can.py @@ -25,11 +25,12 @@ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -from typing import List - from clearpath_config.common.types.config import BaseConfig from clearpath_config.common.types.list import ListConfig from clearpath_config.common.types.platform import Platform +from typing import List + +from clearpath_config.common.types.list import ListConfig class CANBridge: @@ -135,32 +136,11 @@ def __init__(self) -> None: class CANBridgeConfig: SINGLE_VCAN_DEFAULT = [ { - CANBridge.INTERFACE: 'vcan0', - CANBridge.ENABLE_CAN_FD: False, - CANBridge.INTERVAL: 0.01, - CANBridge.USE_BUS_TIME: False, - CANBridge.FILTERS: '0:0', - CANBridge.AUTO_CONFIGURE: True, - CANBridge.AUTO_ACTIVATE: True, - } - ] - - A300_DEFAULT = [ - { - CANBridge.INTERFACE: 'can0', - CANBridge.ENABLE_CAN_FD: False, - CANBridge.INTERVAL: 0.01, - CANBridge.USE_BUS_TIME: False, - CANBridge.FILTERS: '0:0', - CANBridge.AUTO_CONFIGURE: True, - CANBridge.AUTO_ACTIVATE: True, - }, - { - CANBridge.INTERFACE: 'vcan1', + CANBridge.INTERFACE: "vcan0", CANBridge.ENABLE_CAN_FD: False, CANBridge.INTERVAL: 0.01, CANBridge.USE_BUS_TIME: False, - CANBridge.FILTERS: '0:0', + CANBridge.FILTERS: "0:0", CANBridge.AUTO_CONFIGURE: True, CANBridge.AUTO_ACTIVATE: True, } @@ -168,7 +148,6 @@ class CANBridgeConfig: DEFAULTS = { Platform.A200: [], - Platform.A300: A300_DEFAULT, Platform.DD100: SINGLE_VCAN_DEFAULT, Platform.DD150: SINGLE_VCAN_DEFAULT, Platform.DO100: SINGLE_VCAN_DEFAULT, diff --git a/clearpath_config/platform/extras.py b/clearpath_config/platform/extras.py index 0b21b4f..abaae67 100644 --- a/clearpath_config/platform/extras.py +++ b/clearpath_config/platform/extras.py @@ -48,18 +48,6 @@ class ROSParameterDefaults: 'platform_velocity_controller.angular.z.min_acceleration': -6.0, } - A300 = { - 'platform_velocity_controller.wheel_radius': 0.1625, - 'platform_velocity_controller.linear.x.max_velocity': 2.0, - 'platform_velocity_controller.linear.x.min_velocity': -2.0, - 'platform_velocity_controller.linear.x.max_acceleration': 4.0, - 'platform_velocity_controller.linear.x.min_acceleration': -4.0, - 'platform_velocity_controller.angular.z.max_velocity': 2.0, - 'platform_velocity_controller.angular.z.min_velocity': -2.0, - 'platform_velocity_controller.angular.z.max_acceleration': 4.0, - 'platform_velocity_controller.angular.z.min_acceleration': -4.0, - } - DD100 = { 'platform_velocity_controller.wheel_radius': 0.049, 'platform_velocity_controller.linear.x.max_velocity': 1.3, @@ -146,7 +134,6 @@ class ROSParameterDefaults: DEFAULTS = { Platform.A200: A200, - Platform.A300: A300, Platform.DD100: DD100, Platform.DO100: DO100, Platform.DD150: DD150, diff --git a/clearpath_config/sensors/types/cameras.py b/clearpath_config/sensors/types/cameras.py index e3967a1..8e1c334 100644 --- a/clearpath_config/sensors/types/cameras.py +++ b/clearpath_config/sensors/types/cameras.py @@ -25,7 +25,9 @@ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +from typing import List from math import pi + from typing import List from clearpath_config.common.types.accessory import Accessory @@ -1357,7 +1359,7 @@ def device_type(self) -> str: @device_type.setter def device_type(self, device_type: str) -> None: assert device_type in self.DEVICE_TYPES, ( - 'Device type "%s" is not one of "%s"' % ( + "Device type '%s' is not one of '%s'" % ( device_type, self.DEVICE_TYPES ) diff --git a/setup.py b/setup.py index 081d05e..6fd0251 100644 --- a/setup.py +++ b/setup.py @@ -34,13 +34,13 @@ # Samples samples = [] -for path, dirs, files in os.walk(os.path.join(package_name, 'sample')): +for path, dirs, files in os.walk(os.path.join(package_name, "sample")): for file in files: samples.append(os.path.join(path, file)) setup( name=package_name, - version='0.3.4', + version="0.3.4", packages=[ package_name, package_name + '.common', @@ -64,8 +64,8 @@ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), # Include the package.xml file - (os.path.join('share', package_name), ['package.xml']), - (os.path.join('share', package_name, 'sample'), samples), + (os.path.join("share", package_name), ["package.xml"]), + (os.path.join("share", package_name, "sample"), samples), ], install_requires=[ 'setuptools',