3 from __future__
import print_function
8 from sound_play.msg
import SoundRequest
19 rospy.logwarn(
"received speak_msg")
23 rospy.logwarn(
"received speak_msg_jp")
28 rospy.Subscriber(
'/robotsound', SoundRequest, self.
cb)
29 rospy.Subscriber(
'/robotsound_jp', SoundRequest, self.
cb_jp)
36 rospy.logwarn(
"waiting for speak_msg")
38 rospy.logwarn(
"check speak_msg")
39 self.assertTrue(self.speak_msg.command == SoundRequest.PLAY_ONCE)
40 if hasattr(SoundRequest,
'volume'):
41 self.assertTrue(self.speak_msg.volume > 0)
42 self.assertTrue(len(self.speak_msg.arg) > 0)
45 rospy.logwarn(
"waiting for speak_msg_jp")
47 rospy.logwarn(
"check speak_msg")
48 self.assertTrue(self.speak_msg_jp.command == SoundRequest.PLAY_ONCE)
49 if hasattr(SoundRequest,
'volume'):
50 self.assertTrue(self.speak_msg_jp.volume > 0)
51 self.assertTrue(len(self.speak_msg_jp.arg) > 0)
53 if __name__ ==
'__main__':
55 rostest.rosrun(PKG, NAME, TestSpeak)