mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-05-08 05:48:56 -04:00
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:
@@ -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'"`;
|
||||
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":
|
||||
command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/Enthusiastic_4'"`;
|
||||
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":
|
||||
command = `sshpass -p "${password}" ssh -o StrictHostKeyChecking=no "nao@${robotIp}" "qicli call ALAnimationPlayer.run 'animations/Stand/Gestures/Yes_1'"`;
|
||||
break;
|
||||
|
||||
@@ -463,7 +463,7 @@ export class WizardRosService extends EventEmitter {
|
||||
|
||||
// Execute based on action configuration or built-in mappings
|
||||
if (actionConfig) {
|
||||
await this.executeWithConfig(actionConfig, parameters);
|
||||
await this.executeWithConfig(actionConfig, parameters, actionId);
|
||||
} else {
|
||||
await this.executeBuiltinAction(actionId, parameters);
|
||||
}
|
||||
@@ -721,6 +721,7 @@ export class WizardRosService extends EventEmitter {
|
||||
};
|
||||
},
|
||||
parameters: Record<string, unknown>,
|
||||
actionId?: string,
|
||||
): Promise<void> {
|
||||
// Service-call actions — no topic publish involved
|
||||
if (config.payloadMapping.type === "service") {
|
||||
@@ -758,6 +759,12 @@ export class WizardRosService extends EventEmitter {
|
||||
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);
|
||||
|
||||
// Wait for action completion based on topic type
|
||||
@@ -928,9 +935,7 @@ export class WizardRosService extends EventEmitter {
|
||||
case "play_animation_bow":
|
||||
case "play_animation_hey":
|
||||
case "play_animation_show_floor":
|
||||
case "play_animation_friendly":
|
||||
case "play_animation_enthusiastic":
|
||||
case "play_animation_think":
|
||||
case "play_animation_yes":
|
||||
case "play_animation_no":
|
||||
case "play_animation_idontknow":
|
||||
@@ -1032,9 +1037,7 @@ export class WizardRosService extends EventEmitter {
|
||||
"play_animation_bow": "animations/Stand/Gestures/BowShort_1",
|
||||
"play_animation_hey": "animations/Stand/Gestures/Hey_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_think": "animations/Stand/Gestures/Think_1",
|
||||
"play_animation_yes": "animations/Stand/Gestures/Yes_1",
|
||||
"play_animation_no": "animations/Stand/Gestures/No_3",
|
||||
"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_hey": "animations/Stand/Gestures/Hey_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_think": "animations/Stand/Gestures/Think_1",
|
||||
"play_animation_yes": "animations/Stand/Gestures/Yes_1",
|
||||
"play_animation_no": "animations/Stand/Gestures/No_3",
|
||||
"play_animation_idontknow": "animations/Stand/Gestures/IDontKnow_1",
|
||||
|
||||
Reference in New Issue
Block a user