From 5db1f0ce79d4d4a18aad271155201749f129018f Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Thu, 25 Jul 2024 13:05:12 -0700 Subject: [PATCH] feat: Pre stress joints --- nhf/touhou/houjuu_nue/joints.py | 2 +- nhf/touhou/houjuu_nue/wing.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/nhf/touhou/houjuu_nue/joints.py b/nhf/touhou/houjuu_nue/joints.py index 9884a88..b5ebd81 100644 --- a/nhf/touhou/houjuu_nue/joints.py +++ b/nhf/touhou/houjuu_nue/joints.py @@ -1051,7 +1051,7 @@ class DiskJoint(Model): angle: float = 0.0, ) -> Cq.Assembly: assert 0 <= angle <= self.movement_angle - deflection = angle - self.neutral_movement_angle + deflection = angle - (self.spring.angle_neutral - self.spring_angle_at_0) spring_name = disk.replace("/", "__Z") + "_spring" ( assembly diff --git a/nhf/touhou/houjuu_nue/wing.py b/nhf/touhou/houjuu_nue/wing.py index 0da6fd3..931af51 100644 --- a/nhf/touhou/houjuu_nue/wing.py +++ b/nhf/touhou/houjuu_nue/wing.py @@ -27,12 +27,12 @@ ELBOW_PARAMS = dict( actuator=LINEAR_ACTUATOR_50, parent_arm_width=15, ) +WRIST_DISK_PARAMS = dict( + movement_angle=30, + radius_disk=13.0, + radius_housing=15.0, +) WRIST_PARAMS = dict( - disk_joint=DiskJoint( - movement_angle=30, - radius_disk=13.0, - radius_housing=15.0, - ), ) @dataclass(kw_only=True) @@ -1096,6 +1096,7 @@ class WingR(WingProfile): elbow_joint: ElbowJoint = field(default_factory=lambda: ElbowJoint( disk_joint=DiskJoint( movement_angle=55, + spring_angle_at_0=75, ), flexor_offset_angle=15, flexor_mount_angle_child=-75, @@ -1108,6 +1109,10 @@ class WingR(WingProfile): wrist_bot_loc: Cq.Location = Cq.Location.from2d(403.0, 289.0, 45.0) wrist_height: float = 60.0 wrist_joint: ElbowJoint = field(default_factory=lambda: ElbowJoint( + disk_joint=DiskJoint( + spring_angle_at_0=120, + **WRIST_DISK_PARAMS, + ), flip=True, angle_neutral=-20.0, child_arm_radius=23.0, @@ -1344,6 +1349,7 @@ class WingL(WingProfile): elbow_rotate: float = 15.0 elbow_joint: ElbowJoint = field(default_factory=lambda: ElbowJoint( disk_joint=DiskJoint( + spring_angle_at_0=100, movement_angle=50, ), angle_neutral=30.0, @@ -1370,6 +1376,9 @@ class WingL(WingProfile): wrist_bot_loc: Cq.Location = Cq.Location.from2d(460.0, -10.0, -45.0) wrist_height: float = 43.0 wrist_joint: ElbowJoint = field(default_factory=lambda: ElbowJoint( + disk_joint=DiskJoint( + **WRIST_DISK_PARAMS, + ), flip=False, hole_pos=[10], lip_length=30,