From f6224fc93840961a7e1c4a521149118059da61c5 Mon Sep 17 00:00:00 2001 From: Kanae Kochigami Date: Mon, 22 Aug 2022 19:36:02 +0900 Subject: [PATCH] (naoqieus) Get errors for invalid :volume :lang parameters in :speak --- jsk_naoqi_robot/naoqieus/naoqi-interface.l | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jsk_naoqi_robot/naoqieus/naoqi-interface.l b/jsk_naoqi_robot/naoqieus/naoqi-interface.l index d33a99bf8d..cf5cb57405 100644 --- a/jsk_naoqi_robot/naoqieus/naoqi-interface.l +++ b/jsk_naoqi_robot/naoqieus/naoqi-interface.l @@ -254,9 +254,11 @@ (setq wait t)) ;; set volume and language (when volume - (send self :set-master-volume (round (* volume 100)))) + (unless (send self :set-master-volume (round (* volume 100))) + (error "Invalid volume argument"))) (when lang - (send self :set-language lang)) + (unless (send self :set-language lang) + (error "Invalid language argument"))) ;; send speech request (send speech_msg :data str) (ros::publish (format nil "~A/speech" group-namespace) speech_msg) @@ -437,7 +439,7 @@ (send ret :data language) (setq res (ros::service-call (format nil "~A/naoqi_driver/set_language" group-namespace) ret)) (if (not (send res :success)) - (ros::ros-error ":speak :lang ~A must be English or Japanese" language)) + (ros::ros-error ":speak :lang ~A must be English or Japanese" language)) (send res :success)) ) (:get-language