From d0ae8837d6ade9f263ed5bb96dbf4b90d409449a Mon Sep 17 00:00:00 2001 From: Ryohei Ueda Date: Wed, 15 Oct 2014 07:09:38 -0700 Subject: [PATCH] Speak the remaining percentages of the battery if it's not charged --- jsk_pr2_startup/jsk_pr2_warning/battery_warning.l | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jsk_pr2_startup/jsk_pr2_warning/battery_warning.l b/jsk_pr2_startup/jsk_pr2_warning/battery_warning.l index 16363bc60..a0934b302 100755 --- a/jsk_pr2_startup/jsk_pr2_warning/battery_warning.l +++ b/jsk_pr2_startup/jsk_pr2_warning/battery_warning.l @@ -5,6 +5,7 @@ (ros::roseus-add-msgs "pr2_msgs") (ros::roseus-add-msgs "actionlib_msgs") (ros::roseus-add-srvs "std_srvs") +(load "package://pr2eus/speak.l") (setq *ac* nil *ac-tm* (ros::time 0)) ;; ac_present > 0 (setq *motor* t) ;; if motors working @@ -30,6 +31,7 @@ (> 180.0 (send (ros::time- tm *ac-tm*) :to-sec))) (return-from check-power-state-cb nil)) (setq *ac-tm* tm) ;; check every 3min + (speak-jp (format nil "でんちのこり~Aパーセントです" p)) (cond ((< p 10) (ros::ros-info "need to back to M78 nebula") @@ -48,4 +50,5 @@ (ros::roseus "battery_warning") (ros::subscribe "/power_state" pr2_msgs::PowerState #'check-power-state-cb) (ros::advertise "/robotsound" sound_play::SoundRequest 10) +(ros::advertise "/robotsound_jp" sound_play::SoundRequest 5) (ros::spin)