ROS: How to use sound_play to speak messages published to a topic? - ros

I am a beginner with ROS and am trying to use ROS sound_play package to speak out loud my messages (which is in string format) that I have published to a particular topic.
So far, I am able to print out the messages onto my ROS terminal using the command $rostopic echo / , but I want my machine to concurrently SPEAK these exact messages that are printed out on my terminal.
I have also tried the command $rosrun sound_play say.py "" for my machine to speak the specific string text I input. My question is, how can I integrate sound_play to actually speak out the messages published to my topic that I have printed onto my terminal using the echo command?
Any help would be appreciated, thanks!

I think instead of using this package, I would recommend using a Python text to speech library like https://pypi.org/project/pyttsx3/
Instead of publishing the string, you can simply pass the string to the API of this library to play the sound.
Hope this helps.

Related

Delphi -How to recognize user voice inputs and convert it to windows commands

I am currently working with "Speech To Text" Desktop Application, I know how to do 'Text To Speech' using Microsoft Speech Object Library but, how to do 'Speech To Text' or 'speech to Command'.
Example 1: I say "Hello World", the Application Write 'Hello World' in for Ex: Note Pad or in 'TMemo'.
Example 2: i say "Open Note Pad", the Application will open the windows note pad.
I just need a simple tip to start with, also i would like to provide me with some properties or methods.
If this idea cannot be made with 'Microsoft Speech Object Library' then please guide me through some other way.
Please I really need some help, I haven't find any examples online.
There is a nice article about usage of Speech API 5.1 in Delphi: http://edn.embarcadero.com/article/29583 Also, there is good documentation from Microsoft: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ms723627(v%3dvs.85) Windows 10 has updated API, but it can't be used on previous versions of windows: https://learn.microsoft.com/en-us/uwp/api/Windows.Media.SpeechRecognition

How to integrate CANOE with Jenkins?

I want to integrate CANOE with Jenkins. Can anybody please tell me how to do that. For now I am able to open CANOE window through Jenkins. But it shows a disclaimer on startup. I want to click on "I accept" button automatically through Jenkins using any command. Can you please tell me how to do that or what is that command?. Is there any other way to click on that button without pressing the key?
CANoe is implemented as a COM-server. Using the COM-interface, you can start CANoe from a script and thus bypass the disclaimer. I have managed to do this either using C# or python with pywin32. The CANoe help-section contains some help on what COM-server commands are available to get you started.
edit:
If CANoe is associated with cfg-files as standard application, you can call the cfg-file directly and have it launch CANoe. That will still require you to manually click the disclaimer dialog though. In a script, such as the one I mentioned earlier, you can create it in such a way that you are able to specify which cfg-file to use as an input parameter. It can also be written so that you can specify certain test-suites containing your CAPL-scripts. It can basically give you access to most CANoe features necessary to run test-suites with different settings. However, I've not tried a lot of them yet.
Unfortunately, none of your examples can be achieved without creating this kind of script.
CANOE simply loads a .cfg configuration file. For jenkins, I am using the Visual Basics script and same triggering into the Jenkins job.
In this was it bypasses the "I accept" and other windows and loads the desired configuration also also using same kind of VB scirpt you can close the application.
'ToStart CANoe_Start.vbs
Set App = CreateObject("CANoe.Application")
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
dim CANoe_config
CANoe_config = fso.BuildPath(fso.GetAbsolutePathName("."), "<target.cfg>")
App.Measurement.Start()
After that you can add the operations in jenkins jobs; to close the same appilcation use :
'ToStop CANoe_Stop.vbs
Set App = CreateObject("CANoe.Application")
App.Quit()
This worked for me. You can call the vbs's over jenkins jobs.

ComputerCraft Run Chat Command

I host a server and I was wondering: is there any way to run chat commands through ComputerCraft? I want to be able to run /tps through the ComputerCraft terminal and then have it print out the TPS. Help would be greatly appreciated.
Thanks.
In the new Computercraft 1.7 there is a new type of computer, the Command Computer. It allows the user to run commands the same way as shell.run("mkdir", "foo"). It can only be obtained by ops, and can only directly be controlled (we are talking without using rednet and such) by ops
commands.exec(string command) -- Runs and outputs command output in chat.
commands.execAsync(string command) -- Quietly runs command without output.
Here is the wiki page:
Commands (API)
But if we are talking 1.6.4 (Which almost all modpacks use) there is no "stock" version of doing that.
Hope it helps /Tyrerexus
I believe that you can use this thing called the Chat Box.
http://ftbwiki.org/Chat_Box
It's not part of the default Computercraft, however. It is part of the Misc Peripherals mod I believe.

send command to zebra printer xcode

How would I send a CPCL or ZPL command to a Zebra printer through an app?
These commands would be similar to ones used in ToolBox.
For example how would I send "! U1 getvar "allcv"" to a printer and get the results.
I am using the Link-OS ios SDK and already have no problems connecting to and printing to the printers.
Did you ever figure this out? It's quite simple in the *nix world. If you send commands to the lp port via cat or some such, the printer will simply read them in. Note that this must be done as root if you don't have permissions set up on the device to allow normal users.
$ sudo cat command_file.txt > /dev/usb/lp0
So, I'm not a C or C++ developer, but the idea is the same in any language. Open the file for writing (probably O_RDWR so you can read back in any response from the printer) and then send commands to the fd returned from open().
You didn't specify an OS so I'll just stick with this *nix answer. That said, it wouldn't be different in Windows, I suppose. You just have to be able to find the right device.

ffmpeg, vlc - Unable to find input stream

Good day to all... I have some "little" problems with ffserver and ffmpeg...
What I need to do is to broadcast a live video. So I got the cam... used vlc and used send stream option. I sent it to 192.168.1.9:64555, which is a virtual machine on the same computer, running centos.
On the virtual machine I run the command ffmpeg -i 192.168.1.9:64555 output.mpg.
The response is "unable to find file whatever".
Can any1 tell me what I did wrong?
Thank you and have a great day.
Print-screen with error:
Seems that ffmpeg don't realize that it asked to open a network stream. So, it try to open the file with name "192.168.1.9:65444", not to connect a network on this address.
I suggest you consult the manual of ffmpeg. The network stream should have some prefix like udp:// or rtp:// or anything (the vlc itself uses such prefix)
Good day. I found the answer at the question. The problem was that ffmpeg can't manage live streams. It should be created a pipe.

Resources