added chat history exports
This commit is contained in:
+21
-15
@@ -51,34 +51,40 @@ class NaoTeleop:
|
||||
return None
|
||||
|
||||
def wave_gesture(self):
|
||||
print("🤚 Waving...")
|
||||
print("🤚 Waving hello...")
|
||||
try:
|
||||
# Simple friendly wave with right arm
|
||||
self.motion.setStiffnesses("RArm", 1.0)
|
||||
|
||||
# Wave motion
|
||||
# Friendly high wave
|
||||
names = ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw"]
|
||||
|
||||
# Better motion: arm raised higher + side-to-side wave
|
||||
angles = [
|
||||
[-0.3, -0.3, -0.3], # ShoulderPitch
|
||||
[0.0, 0.3, 0.0], # ShoulderRoll
|
||||
[0.0, 1.0, 0.0], # ElbowYaw
|
||||
[0.0, -1.0, 0.0], # ElbowRoll
|
||||
[0.0, 1.5, 0.0] # WristYaw
|
||||
[-1.0, -0.8, -1.0, -0.8, -1.0], # RShoulderPitch (raise arm high)
|
||||
[ 0.2, -0.5, 0.2, -0.5, 0.2], # RShoulderRoll
|
||||
[ 0.8, 1.2, 0.8, 1.2, 0.8], # RElbowYaw
|
||||
[-1.0, -0.3, -1.0, -0.3, -1.0], # RElbowRoll
|
||||
[ 0.0, 1.5, 0.0, -1.5, 0.0] # RWristYaw (hand wave)
|
||||
]
|
||||
times = [[1.0, 1.8, 2.6], [1.0, 1.8, 2.6], [1.0, 1.8, 2.6], [1.0, 1.8, 2.6], [1.0, 1.8, 2.6]]
|
||||
|
||||
times = [[0.5, 1.0, 1.5, 2.0, 2.5]] * 5
|
||||
|
||||
self.motion.angleInterpolation(names, angles, times, True)
|
||||
|
||||
# Return to neutral
|
||||
self.motion.setAngles("RArm", [0.0]*5, 0.4)
|
||||
# Strong return to neutral position
|
||||
self.motion.setAngles("RArm", [0.0] * 5, 0.6)
|
||||
time.sleep(0.8) # Give time to settle
|
||||
|
||||
print("✅ Better wave completed")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Wave error: {e}")
|
||||
|
||||
def handle_head_movement(self):
|
||||
keys = pygame.key.get_pressed()
|
||||
speed = 0.3
|
||||
|
||||
changed = False
|
||||
|
||||
if keys[pygame.K_i]:
|
||||
self.head_pitch = max(self.head_pitch - speed, -0.5); changed = True
|
||||
if keys[pygame.K_k]:
|
||||
@@ -97,8 +103,8 @@ class NaoTeleop:
|
||||
|
||||
print("🎮 Controls:")
|
||||
print(" WASD / Arrows = Walk")
|
||||
print(" I J K L = Head movement")
|
||||
print(" 1 = Wave gesture")
|
||||
print(" I J K L = Head")
|
||||
print(" 1 = Wave")
|
||||
print(" ESC = Quit")
|
||||
|
||||
while self.running:
|
||||
@@ -108,7 +114,7 @@ class NaoTeleop:
|
||||
elif event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE:
|
||||
self.running = False
|
||||
elif event.key == pygame.K_1: # Number key 1
|
||||
elif event.key == pygame.K_1:
|
||||
self.wave_gesture()
|
||||
|
||||
# Walking
|
||||
|
||||
Reference in New Issue
Block a user