improved cena gesture
This commit is contained in:
+15
-12
@@ -251,24 +251,27 @@ class NaoTeleop:
|
||||
|
||||
def cena_gesture(self):
|
||||
if self.typing_mode: return
|
||||
print("👋 YOU CAN'T SEE ME! (Backhand version)")
|
||||
print("👋 YOU CAN'T SEE ME! (Pendulum Sweep)")
|
||||
try:
|
||||
self.motion.setStiffnesses("RArm", 1.0)
|
||||
names = ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw", "RHand"]
|
||||
|
||||
# Adjusted RWristYaw to 1.5 to turn the hand backhand
|
||||
angles = [
|
||||
[-0.4]*5, # Pitch (raise arm)
|
||||
[-0.1, -0.6, -0.1, -0.6, -0.1], # Roll (wave across face)
|
||||
[0.0]*5, # Elbow Yaw
|
||||
[1.4]*5, # Elbow Roll (bent to face)
|
||||
[1.5]*5, # Wrist Yaw (Backhand flip)
|
||||
[1.0]*5 # Hand flat and open
|
||||
]
|
||||
times = [[0.4, 0.8, 1.2, 1.6, 2.0]] * 6
|
||||
# Anchor pose: Arm brought up to face, elbow bent.
|
||||
# RShoulderRoll -0.2 (closer to body), RElbowRoll 1.3 (vertical).
|
||||
# The swing happens on RElbowYaw.
|
||||
|
||||
self.motion.angleInterpolation(names, angles, times, True)
|
||||
# Setup: Move to start position at the side of the face
|
||||
# Setting up the pose first
|
||||
self.motion.angleInterpolation(["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw", "RHand"],
|
||||
[-0.2, -0.2, -0.6, 1.3, 1.2, 1.0], 0.5, True)
|
||||
|
||||
# The Pendulum Sweep: Moving RElbowYaw from left to right across the face
|
||||
# Swings from -0.6 to 0.6
|
||||
self.motion.angleInterpolation(["RElbowYaw"], [0.6], 0.8, True)
|
||||
|
||||
# Optional: Add a second faster sweep if you want
|
||||
self.motion.angleInterpolation(["RElbowYaw"], [-0.6], 0.6, True)
|
||||
|
||||
# Return to neutral
|
||||
neutral = [1.5, -0.15, 1.2, 0.5, 0.0, 0.0]
|
||||
self.motion.angleInterpolationWithSpeed(names, neutral, 0.3)
|
||||
|
||||
Reference in New Issue
Block a user