improved cena gesture

This commit is contained in:
Lucca Pirovano
2026-07-16 14:26:03 -04:00
parent 158372e528
commit ca196f5f1e
+15 -12
View File
@@ -251,23 +251,26 @@ class NaoTeleop:
def cena_gesture(self): def cena_gesture(self):
if self.typing_mode: return if self.typing_mode: return
print("👋 YOU CAN'T SEE ME! (Backhand version)") print("👋 YOU CAN'T SEE ME! (Pendulum Sweep)")
try: try:
self.motion.setStiffnesses("RArm", 1.0) self.motion.setStiffnesses("RArm", 1.0)
names = ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw", "RHand"] names = ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw", "RHand"]
# Adjusted RWristYaw to 1.5 to turn the hand backhand # Anchor pose: Arm brought up to face, elbow bent.
angles = [ # RShoulderRoll -0.2 (closer to body), RElbowRoll 1.3 (vertical).
[-0.4]*5, # Pitch (raise arm) # The swing happens on RElbowYaw.
[-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
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 # Return to neutral
neutral = [1.5, -0.15, 1.2, 0.5, 0.0, 0.0] neutral = [1.5, -0.15, 1.2, 0.5, 0.0, 0.0]