reduced arm stiffness while walking
This commit is contained in:
+20
-4
@@ -10,6 +10,10 @@ import queue
|
|||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pygame
|
import pygame
|
||||||
|
import subprocess
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
# Import the new music module
|
# Import the new music module
|
||||||
from naomusic import NaoMusicPlayer
|
from naomusic import NaoMusicPlayer
|
||||||
@@ -245,7 +249,8 @@ class NaoTeleop:
|
|||||||
self.motion.angleInterpolation(names, angles, times, True)
|
self.motion.angleInterpolation(names, angles, times, True)
|
||||||
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]
|
||||||
self.motion.angleInterpolationWithSpeed(names, neutral, 0.3)
|
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:
|
except Exception as e:
|
||||||
print(f"Wave error: {e}")
|
print(f"Wave error: {e}")
|
||||||
|
|
||||||
@@ -253,7 +258,6 @@ class NaoTeleop:
|
|||||||
if self.typing_mode: return
|
if self.typing_mode: return
|
||||||
print("👋 YOU CAN'T SEE ME!")
|
print("👋 YOU CAN'T SEE ME!")
|
||||||
try:
|
try:
|
||||||
# 1. Trigger the classic line
|
|
||||||
self.tts.say("You can't see me")
|
self.tts.say("You can't see me")
|
||||||
|
|
||||||
self.motion.setStiffnesses("RArm", 1.0)
|
self.motion.setStiffnesses("RArm", 1.0)
|
||||||
@@ -271,7 +275,8 @@ class NaoTeleop:
|
|||||||
# 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]
|
||||||
self.motion.angleInterpolationWithSpeed(names, neutral, 0.3)
|
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:
|
except Exception as e:
|
||||||
print(f"Cena gesture error: {e}")
|
print(f"Cena gesture error: {e}")
|
||||||
|
|
||||||
@@ -315,11 +320,22 @@ class NaoTeleop:
|
|||||||
self.last_batt_check = now
|
self.last_batt_check = now
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
print("🤖 Waking up...")
|
||||||
self.motion.wakeUp()
|
self.motion.wakeUp()
|
||||||
|
|
||||||
|
print("🚶 Going to StandInit...")
|
||||||
self.posture.goToPosture("StandInit", 0.5)
|
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)
|
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...")
|
print("🦶 Initializing walk engine...")
|
||||||
self._safe("moveInit", self.motion.moveInit)
|
self._safe("moveInit", self.motion.moveInit)
|
||||||
print("🦶 Walk engine ready")
|
print("🦶 Walk engine ready")
|
||||||
|
|||||||
Reference in New Issue
Block a user