Hey all,
I have a subscriber written in Python and subscribes to some sensor msgs. It uses sound_play to perform speech synthesis and inform the user about the information received by the sensors. My main problem is that the latency is huge. The sensor detects the obstacle at time t and sends it to the subscriber. However, sound_play reporoduces the sound at time t + long_after. Apparently my subscriber sends too much messages to sound_play which accumulates the messages in a buffer. Is there any way to workaround this issue?
Thanks George
Alhough I am not 100% sure, the latency might come from both ROS' sound_play and also festival. Even though sound_play assures that it can handle multiple play request simultaneously, I had difficulty that caused a problem when trying to handle multiple requests within very short interval (ticket opened).
One workaround worth trying is to use festival (or other native player) directly. For example for text2speech, do something like this.
process = subprocess.Popen(['festival', '--tts'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout_value, stderr_value = process.communicate(spokenTxt)
process.wait()
For playing audio file, using mplayer is an option if you're on Ubuntu. These worked out for us well (although certain interval b/w each play was necessary to guarantee the proper execution and the sound quality).
Asked: 2011-12-14 15:46:18 -0500
Seen: 134 times
Last updated: Dec 15 '11
Subscriber and Publisher node at once in cpp
Which ways of communicating with a controller are real-time safe?
basic question in understanding publishing and subscribing
Programmatically get ModelState from Gazebo
Problem using subscribed motor position topic
Publisher Subscriber Teleoperation -- High Latency?
Rosserial/Arduino Publishers and Subscribers
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.