Is there a way to write terminal commands within a ROS node?
Hello, I'll try to be clear. I want to build a ROS node in which some code will execute terminal commands without the user input. In fact i have a script that does some elaborations to .txt files and that takes only terminal (I'm on Ubuntu) commands to do its elaborations. For example, this is how i call the script from a terminal window:
get_hrv -R test.txt
So, what i want, it's a node that will have, for example, this piece of code above nested in some ROS code, so the terminal window with the results of the elaboration will show up when I'll run the node. I hope that it's all clear, let me know if you need a better explanation. Maybe, there is a ROS package that does the job that i want, i don't know, I'm searching it. Thank you in advance for your help!
Marco
Edit: Many thanks to both of you. In fact, since i'm using C++, i just used the code
system("get_hrv -R test.txt");
and all went fine! Thank you again and sorry for my bad knowledge of programming languages, i must use ROS and so on because i'm doing a project for my university, but i come from a completely different field, since i'm a mechanical engineer. Thank you!!!
@Marcofon: could I ask you to please not post answers unless you are actually answering a question? ROS Answers is slightly different from a 'normal' forum.
If any of the answers posted by @rbbg or @Airuno2L answered your question, could you please mark it as such by ticking the checkmark? Thanks!
Ok, i'm very sorry! No problem!
No need to apologise. Just keep it in mind.
Sure! Of course!