improved wave gesture

This commit is contained in:
Lucca Pirovano
2026-07-15 14:05:36 -04:00
parent a20909b8ff
commit cedb1332fd
+24 -13
View File
@@ -55,27 +55,38 @@ class NaoTeleop:
try: try:
self.motion.setStiffnesses("RArm", 1.0) self.motion.setStiffnesses("RArm", 1.0)
# Friendly high wave names = ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw", "RHand"]
names = ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw"]
# Better motion: arm raised higher + side-to-side wave
angles = [ angles = [
[-1.0, -0.8, -1.0, -0.8, -1.0], # RShoulderPitch (raise arm high) [-1.5, -1.5, -1.5, -1.5, -1.5],
[ 0.2, -0.5, 0.2, -0.5, 0.2], # RShoulderRoll [-0.4, -0.7, -0.4, -0.7, -0.4],
[ 0.8, 1.2, 0.8, 1.2, 0.8], # RElbowYaw [ 0.6, 1.1, 0.6, 1.1, 0.6],
[-1.0, -0.3, -1.0, -0.3, -1.0], # RElbowRoll [ 0.8, 0.3, 0.8, 0.3, 0.8],
[ 0.0, 1.5, 0.0, -1.5, 0.0] # RWristYaw (hand wave) [ 0.0, 1.5, 0.0, -1.5, 0.0],
[ 1.0, 1.0, 1.0, 1.0, 1.0]
] ]
times = [[0.5, 1.0, 1.5, 2.0, 2.5]] * 5 times = [
[0.5, 1.0, 1.5, 2.0, 2.5],
[0.5, 1.0, 1.5, 2.0, 2.5],
[0.5, 1.0, 1.5, 2.0, 2.5],
[0.5, 1.0, 1.5, 2.0, 2.5],
[0.5, 1.0, 1.5, 2.0, 2.5],
[0.5, 1.0, 1.5, 2.0, 2.5]
]
self.motion.angleInterpolation(names, angles, times, True) self.motion.angleInterpolation(names, angles, times, True)
# Strong return to neutral position # --- THE FIX ---
self.motion.setAngles("RArm", [0.0] * 5, 0.6) # True "StandInit" natural arm angles: Pitch 1.5 (down), slight bends.
time.sleep(0.8) # Give time to settle neutral_angles = [1.5, -0.15, 1.2, 0.5, 0.0, 0.0]
print("✅ Better wave completed") # Use angleInterpolationWithSpeed so it finishes the movement BEFORE
# the main loop can interrupt it with a stopMove() command.
# 0.3 means move at 30% of max speed for a smooth reset.
self.motion.angleInterpolationWithSpeed(names, neutral_angles, 0.3)
print("✅ Proper wave completed and reset")
except Exception as e: except Exception as e:
print(f"Wave error: {e}") print(f"Wave error: {e}")