fix(nao6): route /animation via SSH, clean up working animations

- Fix executeWithConfig to route play_animation actions through SSH
- Remove broken animations: friendly, think, show_sole
- Keep working: bow, hey, show_floor, enthusiastic, yes, no, idontknow
This commit is contained in:
2026-04-01 19:06:21 -04:00
parent c959e61f95
commit 4b04f2c415
3 changed files with 8 additions and 15 deletions
-8
View File
@@ -101,18 +101,10 @@ export async function POST(request: NextRequest) {
command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/ShowFloor_1'"`; command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/ShowFloor_1'"`;
break; break;
case "play_animation_show_sole":
command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/ShowSole_1'"`;
break;
case "play_animation_enthusiastic": case "play_animation_enthusiastic":
command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/Enthusiastic_4'"`; command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/Enthusiastic_4'"`;
break; break;
case "play_animation_think":
command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/Think_1'"`;
break;
case "play_animation_yes": case "play_animation_yes":
command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/Yes_1'"`; command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/Yes_1'"`;
break; break;
+8 -5
View File
@@ -463,7 +463,7 @@ export class WizardRosService extends EventEmitter {
// Execute based on action configuration or built-in mappings // Execute based on action configuration or built-in mappings
if (actionConfig) { if (actionConfig) {
await this.executeWithConfig(actionConfig, parameters); await this.executeWithConfig(actionConfig, parameters, actionId);
} else { } else {
await this.executeBuiltinAction(actionId, parameters); await this.executeBuiltinAction(actionId, parameters);
} }
@@ -721,6 +721,7 @@ export class WizardRosService extends EventEmitter {
}; };
}, },
parameters: Record<string, unknown>, parameters: Record<string, unknown>,
actionId?: string,
): Promise<void> { ): Promise<void> {
// Service-call actions — no topic publish involved // Service-call actions — no topic publish involved
if (config.payloadMapping.type === "service") { if (config.payloadMapping.type === "service") {
@@ -758,6 +759,12 @@ export class WizardRosService extends EventEmitter {
return; return;
} }
// Route /animation topic through SSH instead of ROS to avoid crashes
if (config.topic === "/animation" && actionId?.startsWith("play_animation_")) {
await this.executeAnimationSSH(actionId);
return;
}
this.publish(config.topic, config.messageType, msg); this.publish(config.topic, config.messageType, msg);
// Wait for action completion based on topic type // Wait for action completion based on topic type
@@ -928,9 +935,7 @@ export class WizardRosService extends EventEmitter {
case "play_animation_bow": case "play_animation_bow":
case "play_animation_hey": case "play_animation_hey":
case "play_animation_show_floor": case "play_animation_show_floor":
case "play_animation_friendly":
case "play_animation_enthusiastic": case "play_animation_enthusiastic":
case "play_animation_think":
case "play_animation_yes": case "play_animation_yes":
case "play_animation_no": case "play_animation_no":
case "play_animation_idontknow": case "play_animation_idontknow":
@@ -1032,9 +1037,7 @@ export class WizardRosService extends EventEmitter {
"play_animation_bow": "animations/Stand/Gestures/BowShort_1", "play_animation_bow": "animations/Stand/Gestures/BowShort_1",
"play_animation_hey": "animations/Stand/Gestures/Hey_1", "play_animation_hey": "animations/Stand/Gestures/Hey_1",
"play_animation_show_floor": "animations/Stand/Gestures/ShowFloor_1", "play_animation_show_floor": "animations/Stand/Gestures/ShowFloor_1",
"play_animation_friendly": "animations/Stand/Gestures/Friendly_1",
"play_animation_enthusiastic": "animations/Stand/Gestures/Enthusiastic_4", "play_animation_enthusiastic": "animations/Stand/Gestures/Enthusiastic_4",
"play_animation_think": "animations/Stand/Gestures/Think_1",
"play_animation_yes": "animations/Stand/Gestures/Yes_1", "play_animation_yes": "animations/Stand/Gestures/Yes_1",
"play_animation_no": "animations/Stand/Gestures/No_3", "play_animation_no": "animations/Stand/Gestures/No_3",
"play_animation_idontknow": "animations/Stand/Gestures/IDontKnow_1", "play_animation_idontknow": "animations/Stand/Gestures/IDontKnow_1",
@@ -269,9 +269,7 @@ export class RobotCommunicationService extends EventEmitter {
"play_animation_bow": "animations/Stand/Gestures/BowShort_1", "play_animation_bow": "animations/Stand/Gestures/BowShort_1",
"play_animation_hey": "animations/Stand/Gestures/Hey_1", "play_animation_hey": "animations/Stand/Gestures/Hey_1",
"play_animation_show_floor": "animations/Stand/Gestures/ShowFloor_1", "play_animation_show_floor": "animations/Stand/Gestures/ShowFloor_1",
"play_animation_friendly": "animations/Stand/Gestures/Friendly_1",
"play_animation_enthusiastic": "animations/Stand/Gestures/Enthusiastic_4", "play_animation_enthusiastic": "animations/Stand/Gestures/Enthusiastic_4",
"play_animation_think": "animations/Stand/Gestures/Think_1",
"play_animation_yes": "animations/Stand/Gestures/Yes_1", "play_animation_yes": "animations/Stand/Gestures/Yes_1",
"play_animation_no": "animations/Stand/Gestures/No_3", "play_animation_no": "animations/Stand/Gestures/No_3",
"play_animation_idontknow": "animations/Stand/Gestures/IDontKnow_1", "play_animation_idontknow": "animations/Stand/Gestures/IDontKnow_1",