Created
April 28, 2022 10:14
-
-
Save k-okada/c0ef7a3a2f4c0984cb014f1f25bad227 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
こんにちは | |
私はペッパーです | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
今日は東京大学からやってきました | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
とても楽しかったです. | |
また,あいましょう. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env roseus | |
(ros::roseus "speech_from_file") | |
(ros::advertise "/speech" std_msgs::string 1) | |
(unix::sleep 1) ;; wait for subscriber, | |
(dolist (file '("1.txt" "2.txt" "3.txt")) | |
(format t ";; Read ~A~%" file) | |
(with-open-file | |
(f file :direction :input) | |
(let (buf (contents "")) | |
(while (setq buf (read-line f nil nil)) | |
(setq contents (concatenate string contents buf))) | |
(format t ";; <~A>~%" contents) | |
(ros::publish "/speech" (instance std_msgs::String :data contents)) | |
(ros::spin-once) | |
(unix::sleep (max (/ (length contents) 12) 3)) | |
))) | |
(exit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment