diff --git a/src/app/api/robots/command/route.ts b/src/app/api/robots/command/route.ts index c570991..8e21e71 100644 --- a/src/app/api/robots/command/route.ts +++ b/src/app/api/robots/command/route.ts @@ -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; diff --git a/src/lib/ros/wizard-ros-service.ts b/src/lib/ros/wizard-ros-service.ts index 511cd92..4a4ef8a 100644 --- a/src/lib/ros/wizard-ros-service.ts +++ b/src/lib/ros/wizard-ros-service.ts @@ -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, + actionId?: string, ): Promise { // 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", diff --git a/src/server/services/robot-communication.ts b/src/server/services/robot-communication.ts index 1684692..5f21c64 100755 --- a/src/server/services/robot-communication.ts +++ b/src/server/services/robot-communication.ts @@ -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",