reduced arm stiffness while walking

This commit is contained in:
Lucca Pirovano
2026-07-16 14:47:22 -04:00
parent c6b9cb0718
commit f4140328e6
+20 -4
View File
@@ -10,6 +10,10 @@ import queue
import cv2
import numpy as np
import pygame
import subprocess
import os
import json
import re
# Import the new music module
from naomusic import NaoMusicPlayer
@@ -245,7 +249,8 @@ class NaoTeleop:
self.motion.angleInterpolation(names, angles, times, True)
neutral = [1.5, -0.15, 1.2, 0.5, 0.0, 0.0]
self.motion.angleInterpolationWithSpeed(names, neutral, 0.3)
self.motion.setStiffnesses("RArm", 0.6)
# Relaxed stiffness after completion
self.motion.setStiffnesses("RArm", 0.3)
except Exception as e:
print(f"Wave error: {e}")
@@ -253,7 +258,6 @@ class NaoTeleop:
if self.typing_mode: return
print("👋 YOU CAN'T SEE ME!")
try:
# 1. Trigger the classic line
self.tts.say("You can't see me")
self.motion.setStiffnesses("RArm", 1.0)
@@ -271,7 +275,8 @@ class NaoTeleop:
# Return to neutral
neutral = [1.5, -0.15, 1.2, 0.5, 0.0, 0.0]
self.motion.angleInterpolationWithSpeed(names, neutral, 0.3)
self.motion.setStiffnesses("RArm", 0.6)
# Relaxed stiffness after completion
self.motion.setStiffnesses("RArm", 0.3)
except Exception as e:
print(f"Cena gesture error: {e}")
@@ -315,10 +320,21 @@ class NaoTeleop:
self.last_batt_check = now
def run(self):
print("🤖 Waking up...")
self.motion.wakeUp()
print("🚶 Going to StandInit...")
self.posture.goToPosture("StandInit", 0.5)
time.sleep(1.0)
# Enable walk arms BEFORE forcing stiffness
print("💪 Enabling walk arms...")
self.motion.setMoveArmsEnabled(True, True)
# Give robot time to initialize motors
time.sleep(1.0)
# Force relaxed stiffness AFTER engine is active
self.motion.setStiffnesses(["RArm", "LArm"], 0.3)
print("🦶 Initializing walk engine...")
self._safe("moveInit", self.motion.moveInit)