From ed1d59ceace6362d0de5887074349ba3342b9f54 Mon Sep 17 00:00:00 2001 From: Ryohei Ueda Date: Tue, 8 Dec 2015 19:16:01 +0900 Subject: [PATCH] [jsk_topic_tools/rosping_existence] Add ~speak_text parameter to customization --- jsk_topic_tools/scripts/rosping_existence.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jsk_topic_tools/scripts/rosping_existence.py b/jsk_topic_tools/scripts/rosping_existence.py index 3f858350e..04ddd1950 100755 --- a/jsk_topic_tools/scripts/rosping_existence.py +++ b/jsk_topic_tools/scripts/rosping_existence.py @@ -122,7 +122,10 @@ def checkNodeExistence(stat): sound = SoundRequest() sound.sound = SoundRequest.SAY sound.command = SoundRequest.PLAY_ONCE - sound.arg = " ".join(nodes).replace("/", "").replace("_", " ") + " are dead" + if speak_text: + sound.arg = speak_text + else: + sound.arg = " ".join(nodes).replace("/", "").replace("_", " ") + " is dead" g_robotsound_pub.publish(sound) else: stat.summary(diagnostic_msgs.msg.DiagnosticStatus.OK, @@ -143,9 +146,10 @@ def checkNodeExistence(stat): # nodes = [n.namespace + n.name for n in config.nodes] nodes = argv[1:] speak = rospy.get_param("~speak", False) + speak_text = rospy.get_param("~speak_test", "") if speak: g_robotsound_pub = rospy.Publisher("/robotsound", SoundRequest) - r = rospy.Rate(0.1) + r = rospy.Rate(0.01) while not rospy.is_shutdown(): updater.update() r.sleep()