Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr2eus: add text-to-spech method to robot-interface #318

Merged
merged 4 commits into from
Nov 8, 2017

Conversation

furushchev
Copy link
Member

Also addressed in jsk-ros-pkg/jsk_robot#833

This PR includes:

  • Cleanup unused text-to-speech methods
  • Add text-to-speech method caller to robot-interface

@furushchev
Copy link
Member Author

furushchev commented Sep 11, 2017

Test passed. Confirmed to work on real robot (PR1012, fetch).
Please give a feedback if you have CC: @k-okada @snozawa

@k-okada
Copy link
Member

k-okada commented Sep 11, 2017

@furushchev does google translate is not working? please also check #263, one idea is to support 'text' argument of ':speak' supports both 'string' and '((:jp . "こんにちは") (:en . "Hello"))'

@furushchev
Copy link
Member Author

@k-okada Thank you very much for feedback!

does google translate is not working?

Not working. Recently google updated their authentication policy to use request with correct header and token but gstreamer (on which sound_play depends) unfortunately does not support this feature.
(We still have alternative method to use google api if we use the package I made several months ago https://github.com/furushchev/ros_gtts. Is it ok to send a pull request to jsk_3rdparty?)

one idea is to support 'text' argument of ':speak' supports both 'string' and '((:jp . "こんにちは") (:en . "Hello"))'

That's a good idea! One possible problem is that we cannot know which language is available at euslisp level.
IMO, having global variable *speak-language* and set one language as its value solves this problem, but I don't think it is elegant so much...

@furushchev
Copy link
Member Author

@k-okada @snozawa Any advice or comment?

pr2eus/speak.l Outdated
@@ -8,7 +8,8 @@
(defparameter *speak-timeout* 20)

(defun send-speak-msg (msg
&key (topic-name "robotsound") (timeout *speak-timeout*)
&key (topic-name "robotsound")
(timeout *speak-timeout*)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change may not necessary.

(:speak-jp (text &rest args)
"Speak japanese sentence"
(apply #'speak-jp text args))
) ;; defmethod robot-interface (text-to-speech)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about add :(send-speak-msg here and change

(defun speak-jp (text &rest args)
 (warning-message 3 "Function `speak-jp` will be deprecated, please use (send *ri* :speak \"text\" :lang :ja") 
 (send* *ri* :speak text :lang :ja args) ;; this is dangerous, because it assumes *ri*..... is this ok? if not leave current implementation here, just to show warning message" 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k-okada Sorry for a late response.
That's indeed a good idea. I updated as followings:

  • added warning message for deprecated functions speak-jp and speak-en.
  • move text-to-speech into robot-interface
  • call robot-interface method :speak-jp internally in speak-jp function. (same for speak-en)
  • updated test codes

@k-okada
Copy link
Member

k-okada commented Nov 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants