Skip to content

Commit

Permalink
Merge pull request jsk-ros-pkg#106 from garaemon/speak-battery-remaining
Browse files Browse the repository at this point in the history
Speak the remaining percentages of the battery if it's not charged
  • Loading branch information
garaemon committed Oct 15, 2014
2 parents 6b509ef + d0ae883 commit b075dc9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsk_pr2_startup/jsk_pr2_warning/battery_warning.l
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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)

0 comments on commit b075dc9

Please sign in to comment.