Skip to content

Commit

Permalink
Merge pull request jsk-ros-pkg#123 from kochigami/master
Browse files Browse the repository at this point in the history
nao and pepper speaking function added
  • Loading branch information
k-okada committed Nov 7, 2014
2 parents 1c0c3ed + 9e33e88 commit 465cf01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion jsk_nao_robot/naoeus/euslisp/nao-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@
()
(send self :go-velocity 0 0 0 0 :stop nil)
)

(:speak
(str)
(let ((speech_msg (instance std_msgs::String :init)))
(send speech_msg :data str)
(ros::publish "/speech" speech_msg))
)

(:start-grasp
(&optional (arm :arms))
)
Expand Down
18 changes: 16 additions & 2 deletions jsk_pepper_robot/jsk_pepper_startup/tweet.l
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@


(ros::advertise "/tweet" std_msgs::String 1)
(ros::advertise "/speech" std_msgs::String 1)
;;(ros::advertise "robotsound_jp" sound_play::SoundRequest 5)
(defun speak-jp (str)
(let ((speech_msg (instance std_msgs::String :init)))
(send speech_msg :data str)
(ros::publish "/speech" speech_msg))
)


(defun tweet (str)
;; camera shot sound
Expand All @@ -15,14 +22,21 @@
;; :sound sound_play::SoundRequest::*play_file*
;; :command sound_play::SoundRequest::*play_once*
;; :arg (ros::resolve-ros-path "package://jsk_pr2_startup/jsk_pr2_lifelog/camera.wav")))

(speak-jp "写真を撮るよ")
(speak-jp "さん")
(unix:sleep 1)
(speak-jp "")
(unix:sleep 1)
(speak-jp "いち")
(unix:sleep 1)
(speak-jp "カシャ!")
;; save image sto /tmp/pepper_camera.jpg
(ros::service-call "/image_saver/save" (instance std_srvs::EmptyRequest :init))
(ros::sleep 3)
(ros::ros-info "save image")
;; tweet
(ros::publish "/tweet" (instance std_msgs::String :init :data (format nil "~A /tmp/pepper_camera.png" str)))
;; (speak-jp "ついーとしました")
(speak-jp (format nil "~A って ついーとしました" str))
(ros::ros-info "tweet ~A" str)
)

Expand Down

0 comments on commit 465cf01

Please sign in to comment.