feat: Rotated wrist joint on left side

This commit is contained in:
Leni Aniva 2024-07-18 14:09:53 -07:00
parent 4c5985fa08
commit 052575017a
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
2 changed files with 16 additions and 6 deletions

View File

@ -88,7 +88,7 @@ class WingProfile(Model):
elbow_height: float elbow_height: float
wrist_bot_loc: Cq.Location wrist_bot_loc: Cq.Location
wrist_height: float wrist_height: float
elbow_rotate: float = -5 elbow_rotate: float = -5.0
wrist_rotate: float = 30.0 wrist_rotate: float = 30.0
flip: bool = False flip: bool = False
@ -842,6 +842,10 @@ class WingL(WingProfile):
def __post_init__(self): def __post_init__(self):
assert self.wrist_height <= self.shoulder_joint.height assert self.wrist_height <= self.shoulder_joint.height
self.wrist_bot_loc = self.wrist_bot_loc.with_angle_2d(self.wrist_angle) self.wrist_bot_loc = self.wrist_bot_loc.with_angle_2d(self.wrist_angle)
self.elbow_joint.angle_neutral = -15.0
self.elbow_rotate = 5.0
self.wrist_joint.angle_neutral = -self.wrist_bot_loc.to2d_rot() - 30.0
self.wrist_rotate = self.wrist_joint.angle_neutral
super().__post_init__() super().__post_init__()

View File

@ -67,13 +67,19 @@ def to2d_pos(self: Cq.Location) -> Tuple[float, float]:
""" """
Returns position and angle Returns position and angle
""" """
(x, y, z), (rx, ry, _) = self.toTuple() (x, y), _ = self.to2d()
assert z == 0 return x, y
assert rx == 0
assert ry == 0
return (x, y)
Cq.Location.to2d_pos = to2d_pos Cq.Location.to2d_pos = to2d_pos
def to2d_rot(self: Cq.Location) -> Tuple[float, float]:
"""
Returns position and angle
"""
_, r = self.to2d()
return r
Cq.Location.to2d_rot = to2d_rot
def with_angle_2d(self: Cq.Location, angle: float) -> Tuple[float, float]: def with_angle_2d(self: Cq.Location, angle: float) -> Tuple[float, float]:
""" """
Returns position and angle Returns position and angle