Skip to content

Commit

Permalink
Height parameters for tower shoulder
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-camero committed Aug 30, 2024
1 parent 4f75695 commit 4d44ac0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions clearpath_config/platform/attachments/r100.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,35 @@ class R100Tower(BaseAttachment):
DEFAULT = "default"
MODELS = [DEFAULT]
PARENT = "default_mount"
LEFT_HEIGHT = 0.0
RIGHT_HEIGHT = 0.0

def __init__(
self,
name: str = ATTACHMENT_MODEL,
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
Expand Down

0 comments on commit 4d44ac0

Please sign in to comment.