Skip to content

Commit

Permalink
Revert "Added battery to platform"
Browse files Browse the repository at this point in the history
This reverts commit fce1183.
  • Loading branch information
luis-camero committed Oct 23, 2023
1 parent fce1183 commit f785062
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 212 deletions.
155 changes: 0 additions & 155 deletions clearpath_config/platform/battery.py

This file was deleted.

35 changes: 2 additions & 33 deletions clearpath_config/platform/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# POSSIBILITY OF SUCH DAMAGE.
from clearpath_config.common.types.config import BaseConfig
from clearpath_config.common.utils.dictionary import flip_dict
from clearpath_config.platform.battery import BatteryConfig
from clearpath_config.platform.extras import ExtrasConfig
from clearpath_config.platform.attachments.config import BaseAttachmentsConfig
from clearpath_config.platform.attachments.mux import AttachmentsConfigMux
Expand All @@ -39,19 +38,15 @@ class PlatformConfig(BaseConfig):
# Controllers
PS4 = "ps4"
LOGITECH = "logitech"

CONTROLLER = "controller"
ATTACHMENTS = "attachments"
# Extras
EXTRAS = "extras"
# Battery
BATTERY = "battery"

TEMPLATE = {
PLATFORM: {
CONTROLLER: CONTROLLER,
ATTACHMENTS: ATTACHMENTS,
BATTERY: BATTERY,
EXTRAS: EXTRAS
}
}
Expand All @@ -62,29 +57,25 @@ class PlatformConfig(BaseConfig):
# PLATFORM
CONTROLLER: PS4,
ATTACHMENTS: {},
BATTERY: BatteryConfig.DEFAULTS,
EXTRAS: ExtrasConfig.DEFAULTS,
EXTRAS: ExtrasConfig.DEFAULTS
}

def __init__(
self,
config: dict = {},
controller: str = DEFAULTS[CONTROLLER],
attachments: str = DEFAULTS[ATTACHMENTS],
battery: dict = DEFAULTS[BATTERY],
extras: dict = DEFAULTS[EXTRAS],
extras: str = DEFAULTS[EXTRAS]
) -> None:
# Initialization
self._config = {}
self.controller = controller
self.attachments = attachments
self._battery = BatteryConfig(battery)
self._extras = ExtrasConfig(extras)
# Setter Template
setters = {
self.KEYS[self.CONTROLLER]: PlatformConfig.controller,
self.KEYS[self.ATTACHMENTS]: PlatformConfig.attachments,
self.KEYS[self.BATTERY]: PlatformConfig.battery,
self.KEYS[self.EXTRAS]: PlatformConfig.extras
}
super().__init__(setters, config, self.PLATFORM)
Expand All @@ -96,8 +87,6 @@ def update(self, serial_number=False) -> None:
# TODO: Set PACS Profile
# Reload extras
self.extras.update(serial_number=serial_number)
# Reload battery
self.battery.update(serial_number=serial_number)

@property
def controller(self) -> str:
Expand Down Expand Up @@ -150,23 +139,3 @@ def extras(self, value: dict | ExtrasConfig) -> None:

def get_controller(self) -> str:
return self.controller

@property
def battery(self) -> BatteryConfig:
self.set_config_param(
key=self.KEYS[self.BATTERY],
value=self._battery.config[self.BATTERY]
)
return self._battery

@battery.setter
def battery(self, value: dict | BatteryConfig) -> None:
if isinstance(value, dict):
self._battery.config = value
elif isinstance(value, BatteryConfig):
self._battery = value
else:
assert isinstance(value, dict) or (
isinstance(value, BatteryConfig)), (
"Battery configuration must be of type 'dict' or 'BatteryConfig'"
)
3 changes: 0 additions & 3 deletions clearpath_config/sample/a200/a200_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: ES20-12C
configuration: 2S1P
attachments:
front_bumper:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions clearpath_config/sample/a200/a200_dual_laser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: ES20-12C
configuration: 2S1P
attachments:
front_bumper:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions clearpath_config/sample/a200/a200_sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: ES20-12C
configuration: 2S1P
attachments:
front_bumper:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions clearpath_config/sample/a200/a200_velodyne.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: ES20-12C
configuration: 2S1P
attachments:
front_bumper:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions clearpath_config/sample/j100/j100_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: HE2613
configuration: 1S1P
attachments:
front_fender:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions clearpath_config/sample/j100/j100_dual_laser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: HE2613
configuration: 1S1P
attachments:
front_fender:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions clearpath_config/sample/j100/j100_sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: HE2613
configuration: 1S1P
attachments:
front_fender:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions clearpath_config/sample/j100/j100_velodyne.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ system:
workspaces: []
platform:
controller: ps4
battery:
model: HE2613
configuration: 1S1P
attachments:
front_fender:
enabled: true
Expand Down

0 comments on commit f785062

Please sign in to comment.